Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Apr 13, 2018
2 parents 75b5c26 + 179fc93 commit d796298
Show file tree
Hide file tree
Showing 21 changed files with 5,492 additions and 94 deletions.
Expand Up @@ -53,6 +53,10 @@
<key>fi</key>
<label>Suomi</label>
</row>
<row>
<key>fr</key>
<label>Français</label>
</row>
<row>
<key>hu</key>
<label>Magyar</label>
Expand Down
Expand Up @@ -44,6 +44,10 @@
<key>fi</key>
<label>Suomi</label>
</row>
<row>
<key>fr</key>
<label>Français</label>
</row>
<row>
<key>hu</key>
<label>Magyar</label>
Expand Down
Expand Up @@ -2979,7 +2979,7 @@ SystemConfigPanel.mail.server.remove.warn=Could not delete selected mail server
SystemConfigPanel.mail.server.tooltip=Select the mail server to configure it. To add new configuration, press '+' button. To remove selected configuration, press '-' button.
SystemConfigPanel.mail.transportSecurity=Transport security
SystemConfigPanel.mail.username=Username
SystemConfigPanel.misc.enableExperimentalCode=Enable experimental code
SystemConfigPanel.misc.enableExperimentalCode=Enable MODEL experimental code
SystemConfigPanel.notification.redirectToFile.placeholder=Filename
SystemConfigPanel.notification.redirectToFile=Redirect to file
SystemConfigPanel.title.accountSynchronization=Global account synchronization settings
Expand Down Expand Up @@ -3676,6 +3676,7 @@ PageAssignmentsList.submitButton=Submit
PageAssignmentsList.resolveConflicts=Resolve conflicts
PageAssignmentsList.commentHere=Comment here...
PageAssignmentsList.requestComment=Request comment (optional)
PageAssignmentsList.saveAssignmentsError=Could not save assignments. Reason:
AssignmentShoppingCartPanel.treeTitle=Role catalog
AssignmentViewType.ROLE_CATALOG_VIEW=Role catalog view
AssignmentViewType.ROLE_TYPE=All roles view
Expand Down Expand Up @@ -3979,3 +3980,4 @@ pageAdminFocus.dataProtection=Data protection
PageInternals.title.cache=Caches
PageInternals.tab.cache=Cache management
InternalsCachePanel.button.clearCaches=Clear caches
PageAccountActivation.user.not.found=Unexpected problem occurs. Please contact system administrator.
3,983 changes: 3,983 additions & 0 deletions gui/admin-gui/src/main/resources/localization/Midpoint_fr.properties

Large diffs are not rendered by default.

Expand Up @@ -37,6 +37,9 @@ es.flag=es
fi.name=Suomi
fi.flag=fi

fr.name=Fran\u00E7ais
fr.flag=fr

hu.name=Magyar
hu.flag=hu

Expand Down
Expand Up @@ -689,4 +689,4 @@ relation.owner=owner
relation.consent=consent
AbstractCredentialType.forceChange=Force change on next login
PasswordType.value=Value
AdminGuiConfigurationType.enableExperimentalFeatures=Enable GUI experimental features
AdminGuiConfigurationType.enableExperimentalFeature=Enable GUI experimental features
692 changes: 692 additions & 0 deletions infra/schema/src/main/resources/localization/schema_fr.properties

Large diffs are not rendered by default.

Expand Up @@ -177,9 +177,11 @@ public <F extends FocusType> void processActivationUserCurrent(LensContext<F> co
return;
}

boolean shadowShouldExist = evaluateExistenceMapping(context, projCtx, now, true, task, result);
LOGGER.trace("Evaluating intended existence of projection {} (legal={})", projCtxDesc, projCtx.isLegal());

boolean shadowShouldExist = evaluateExistenceMapping(context, projCtx, now, MappingTimeEval.CURRENT, task, result);

LOGGER.trace("Evaluated intended existence of projection {} to {}", projCtxDesc, shadowShouldExist);
LOGGER.trace("Evaluated intended existence of projection {} to {} (legal={})", projCtxDesc, shadowShouldExist, projCtx.isLegal());

// Let's reconcile the existence intent (shadowShouldExist) and the synchronization intent in the context

Expand Down Expand Up @@ -294,7 +296,7 @@ public <F extends FocusType> void processActivationUserCurrent(LensContext<F> co
evaluateActivationMapping(context, projCtx,
activationType.getAdministrativeStatus(),
SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS, SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS,
capActivation, now, true, ActivationType.F_ADMINISTRATIVE_STATUS.getLocalPart(), task, result);
capActivation, now, MappingTimeEval.CURRENT, ActivationType.F_ADMINISTRATIVE_STATUS.getLocalPart(), task, result);
} else {
LOGGER.trace("Skipping activation administrative status processing because {} does not have activation administrative status capability", projCtx.getResource());
}
Expand All @@ -307,7 +309,7 @@ public <F extends FocusType> void processActivationUserCurrent(LensContext<F> co
} else {
evaluateActivationMapping(context, projCtx, activationType.getValidFrom(),
SchemaConstants.PATH_ACTIVATION_VALID_FROM, SchemaConstants.PATH_ACTIVATION_VALID_FROM,
null, now, true, ActivationType.F_VALID_FROM.getLocalPart(), task, result);
null, now, MappingTimeEval.CURRENT, ActivationType.F_VALID_FROM.getLocalPart(), task, result);
}

ResourceBidirectionalMappingType validToMappingType = activationType.getValidTo();
Expand All @@ -318,14 +320,14 @@ public <F extends FocusType> void processActivationUserCurrent(LensContext<F> co
} else {
evaluateActivationMapping(context, projCtx, activationType.getValidTo(),
SchemaConstants.PATH_ACTIVATION_VALID_TO, SchemaConstants.PATH_ACTIVATION_VALID_TO,
null, now, true, ActivationType.F_VALID_TO.getLocalPart(), task, result);
null, now, MappingTimeEval.CURRENT, ActivationType.F_VALID_TO.getLocalPart(), task, result);
}

if (capLockoutStatus != null) {
evaluateActivationMapping(context, projCtx,
activationType.getLockoutStatus(),
SchemaConstants.PATH_ACTIVATION_LOCKOUT_STATUS, SchemaConstants.PATH_ACTIVATION_LOCKOUT_STATUS,
capActivation, now, true, ActivationType.F_LOCKOUT_STATUS.getLocalPart(), task, result);
capActivation, now, MappingTimeEval.CURRENT, ActivationType.F_LOCKOUT_STATUS.getLocalPart(), task, result);
} else {
LOGGER.trace("Skipping activation lockout status processing because {} does not have activation lockout status capability", projCtx.getResource());
}
Expand Down Expand Up @@ -415,7 +417,7 @@ public <F extends FocusType> void processActivationUserFuture(LensContext<F> con

accCtx.recompute();

evaluateExistenceMapping(context, accCtx, now, false, task, result);
evaluateExistenceMapping(context, accCtx, now, MappingTimeEval.FUTURE, task, result);

PrismObject<F> focusNew = context.getFocusContext().getObjectNew();
if (focusNew == null) {
Expand Down Expand Up @@ -446,26 +448,26 @@ public <F extends FocusType> void processActivationUserFuture(LensContext<F> con

evaluateActivationMapping(context, accCtx, activationType.getAdministrativeStatus(),
SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS, SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS,
capActivation, now, false, ActivationType.F_ADMINISTRATIVE_STATUS.getLocalPart(), task, result);
capActivation, now, MappingTimeEval.FUTURE, ActivationType.F_ADMINISTRATIVE_STATUS.getLocalPart(), task, result);
}

if (capValidFrom != null) {
evaluateActivationMapping(context, accCtx, activationType.getAdministrativeStatus(),
SchemaConstants.PATH_ACTIVATION_VALID_FROM, SchemaConstants.PATH_ACTIVATION_VALID_FROM,
null, now, false, ActivationType.F_VALID_FROM.getLocalPart(), task, result);
null, now, MappingTimeEval.FUTURE, ActivationType.F_VALID_FROM.getLocalPart(), task, result);
}

if (capValidTo != null) {
evaluateActivationMapping(context, accCtx, activationType.getAdministrativeStatus(),
SchemaConstants.PATH_ACTIVATION_VALID_TO, SchemaConstants.PATH_ACTIVATION_VALID_TO,
null, now, false, ActivationType.F_VALID_FROM.getLocalPart(), task, result);
null, now, MappingTimeEval.FUTURE, ActivationType.F_VALID_FROM.getLocalPart(), task, result);
}

}


private <F extends FocusType> boolean evaluateExistenceMapping(final LensContext<F> context,
final LensProjectionContext projCtx, final XMLGregorianCalendar now, final boolean current,
final LensProjectionContext projCtx, final XMLGregorianCalendar now, final MappingTimeEval current,
Task task, final OperationResult result)
throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException {
final String projCtxDesc = projCtx.toHumanReadableString();
Expand All @@ -475,8 +477,6 @@ private <F extends FocusType> boolean evaluateExistenceMapping(final LensContext
throw new IllegalStateException("Null 'legal' for "+projCtxDesc);
}

LOGGER.trace("Evaluating intended existence of projection {}; legal={}", projCtxDesc, legal);

ResourceObjectTypeDefinitionType resourceAccountDefType = projCtx.getResourceObjectTypeDefinitionType();
if (resourceAccountDefType == null) {
return legal;
Expand Down Expand Up @@ -581,7 +581,7 @@ private <F extends FocusType> boolean evaluateExistenceMapping(final LensContext
private <T, F extends FocusType> void evaluateActivationMapping(final LensContext<F> context,
final LensProjectionContext projCtx, ResourceBidirectionalMappingType bidirectionalMappingType,
final ItemPath focusPropertyPath, final ItemPath projectionPropertyPath,
final ActivationCapabilityType capActivation, XMLGregorianCalendar now, final boolean current,
final ActivationCapabilityType capActivation, XMLGregorianCalendar now, final MappingTimeEval current,
String desc, final Task task, final OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException {

MappingInitializer<PrismPropertyValue<T>,PrismPropertyDefinition<T>> initializer =
Expand Down Expand Up @@ -645,7 +645,7 @@ private <T, F extends FocusType> void evaluateOutboundMapping(final LensContext<
final LensProjectionContext projCtx, ResourceBidirectionalMappingType bidirectionalMappingType,
final ItemPath focusPropertyPath, final ItemPath projectionPropertyPath,
final MappingInitializer<PrismPropertyValue<T>,PrismPropertyDefinition<T>> initializer,
XMLGregorianCalendar now, final boolean evaluateCurrent, String desc, final Task task, final OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException {
XMLGregorianCalendar now, final MappingTimeEval evaluateCurrent, String desc, final Task task, final OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException {

if (bidirectionalMappingType == null) {
LOGGER.trace("No '{}' definition in projection {}, skipping", desc, projCtx.toHumanReadableString());
Expand Down Expand Up @@ -694,15 +694,15 @@ private <T, F extends FocusType> void evaluateOutboundMapping(final LensContext<
Map<ItemPath, MappingOutputStruct<PrismPropertyValue<T>>> outputTripleMap = mappingEvaluator.evaluateMappingSetProjection(params, task, result);

if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Mapping processing output after {}:\n{}", desc, DebugUtil.debugDump(outputTripleMap, 1));
LOGGER.trace("Mapping processing output after {} ({}):\n{}", desc, evaluateCurrent, DebugUtil.debugDump(outputTripleMap, 1));
}

if (projCtx.isDoReconciliation()) {
reconcileOutboundValue(context, projCtx, outputTripleMap, desc);
}

}

/**
* TODO: can we align this with ReconciliationProcessor?
*/
Expand Down Expand Up @@ -924,7 +924,7 @@ private <F extends FocusType> void processLifecycleFocus(LensContext<F> context,
LOGGER.trace("Computing projection lifecycle (mapping): {}", lifecycleStateMappingType);
evaluateActivationMapping(context, projCtx, lifecycleStateMappingType,
SchemaConstants.PATH_LIFECYCLE_STATE, SchemaConstants.PATH_LIFECYCLE_STATE,
null, now, true, ObjectType.F_LIFECYCLE_STATE.getLocalPart(), task, result);
null, now, MappingTimeEval.CURRENT, ObjectType.F_LIFECYCLE_STATE.getLocalPart(), task, result);
}

}
Expand Down
Expand Up @@ -143,7 +143,7 @@ public <T, F extends FocusType> void evaluateOutboundMapping(final LensContext<F
final LensProjectionContext projCtx, List<MappingType> outboundMappings,
final ItemPath focusPropertyPath, final ItemPath projectionPropertyPath,
final MappingInitializer<PrismPropertyValue<T>,PrismPropertyDefinition<T>> initializer, MappingOutputProcessor<PrismPropertyValue<T>> processor,
XMLGregorianCalendar now, final boolean evaluateCurrent, boolean evaluateWeak,
XMLGregorianCalendar now, final MappingTimeEval evaluateCurrent, boolean evaluateWeak,
String desc, final Task task, final OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException {

String projCtxDesc = projCtx.toHumanReadableString();
Expand Down Expand Up @@ -232,11 +232,11 @@ public <V extends PrismValue, D extends ItemDefinition, T extends ObjectType, F
Boolean timeConstraintValid = mapping.evaluateTimeConstraintValid(task, result);

if (params.getEvaluateCurrent() != null) {
if (params.getEvaluateCurrent() && !timeConstraintValid) {
if (params.getEvaluateCurrent() == MappingTimeEval.CURRENT && !timeConstraintValid) {
LOGGER.trace("Mapping {} is non-current, but evulating current mappings, skipping {}", mappingName, params.getContext().getChannel());
continue;
}
if (!params.getEvaluateCurrent() && timeConstraintValid) {
if (params.getEvaluateCurrent() == MappingTimeEval.FUTURE && timeConstraintValid) {
LOGGER.trace("Mapping {} is current, but evulating non-current mappings, skipping {}", mappingName, params.getContext().getChannel());
continue;
}
Expand Down
Expand Up @@ -50,7 +50,7 @@ public class MappingEvaluatorParams<V extends PrismValue, D extends ItemDefiniti
private ItemPath defaultTargetItemPath;
// Only needed if defaultTargetItemPath == null
private D targetItemDefinition;
private Boolean evaluateCurrent;
private MappingTimeEval evaluateCurrent;
private boolean evaluateWeak = true;
private LensContext<F> context;
private boolean hasFullTargetObject;
Expand Down Expand Up @@ -137,11 +137,11 @@ public void setSourceContext(ObjectDeltaObject<?> sourceContext) {
this.sourceContext = sourceContext;
}

public Boolean getEvaluateCurrent() {
public MappingTimeEval getEvaluateCurrent() {
return evaluateCurrent;
}

public void setEvaluateCurrent(Boolean evaluateCurrent) {
public void setEvaluateCurrent(MappingTimeEval evaluateCurrent) {
this.evaluateCurrent = evaluateCurrent;
}

Expand Down
@@ -0,0 +1,26 @@
/**
* Copyright (c) 2018 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.evolveum.midpoint.model.impl.lens.projector;

/**
* @author semancik
*
*/
public enum MappingTimeEval {

CURRENT, FUTURE;

}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2017 Evolveum
* Copyright (c) 2010-2018 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,6 +40,7 @@
import com.evolveum.midpoint.model.impl.lens.projector.MappingEvaluator;
import com.evolveum.midpoint.model.impl.lens.projector.MappingInitializer;
import com.evolveum.midpoint.model.impl.lens.projector.MappingOutputProcessor;
import com.evolveum.midpoint.model.impl.lens.projector.MappingTimeEval;
import com.evolveum.midpoint.prism.ItemDefinition;
import com.evolveum.midpoint.prism.OriginType;
import com.evolveum.midpoint.prism.PrismContainerValue;
Expand Down Expand Up @@ -255,7 +256,7 @@ public ValuePolicyType resolve() {

mappingEvaluator.evaluateOutboundMapping(context, projCtx, outboundMappingTypes,
SchemaConstants.PATH_PASSWORD_VALUE, SchemaConstants.PATH_PASSWORD_VALUE, initializer, processor,
now, true, evaluateWeak, "password mapping", task, result);
now, MappingTimeEval.CURRENT, evaluateWeak, "password mapping", task, result);

}

Expand Down
Expand Up @@ -396,16 +396,25 @@ private void processAssignment(DeltaSetTriple<EvaluatedAssignmentImpl<F>> evalua
} else {
// No change in assignment
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Processing unchanged assignment {}", SchemaDebugUtil.prettyPrint(assignmentCVal));
LOGGER.trace("Processing unchanged assignment ({}) {}",
presentInCurrent ? "present" : "not present",
SchemaDebugUtil.prettyPrint(assignmentCVal));
}
EvaluatedAssignmentImpl<F> evaluatedAssignment = evaluateAssignment(createAssignmentIdiNoChange(assignmentCVal), PlusMinusZero.ZERO, false, context, source, assignmentEvaluator, assignmentPlacementDesc, task, result);
if (evaluatedAssignment == null) {
return;
}
// NOTE: unchanged may mean both:
// * was there before, is there now
// * was not there before, is not there now
evaluatedAssignment.setPresentInCurrentObject(presentInCurrent);
evaluatedAssignment.setPresentInOldObject(presentInOld);
evaluatedAssignment.setWasValid(evaluatedAssignment.isValid());
collectToZero(evaluatedAssignmentTriple, evaluatedAssignment, forceRecon);
if (presentInCurrent) {
collectToZero(evaluatedAssignmentTriple, evaluatedAssignment, forceRecon);
} else {
collectToMinus(evaluatedAssignmentTriple, evaluatedAssignment, forceRecon);
}
}
}
}
Expand Down
Expand Up @@ -51,6 +51,7 @@
import com.evolveum.midpoint.model.impl.lens.projector.MappingEvaluatorParams;
import com.evolveum.midpoint.model.impl.lens.projector.MappingInitializer;
import com.evolveum.midpoint.model.impl.lens.projector.MappingOutputProcessor;
import com.evolveum.midpoint.model.impl.lens.projector.MappingTimeEval;
import com.evolveum.midpoint.model.impl.lens.projector.credentials.CredentialsProcessor;
import com.evolveum.midpoint.prism.Item;
import com.evolveum.midpoint.prism.ItemDefinition;
Expand Down Expand Up @@ -1428,7 +1429,7 @@ private <F extends FocusType> void processSpecialPropertyInbound(Collection<Mapp
params.setAPrioriTargetDelta(userPrimaryDelta);
params.setTargetContext(context.getFocusContext());
params.setDefaultTargetItemPath(targetPath);
params.setEvaluateCurrent(true);
params.setEvaluateCurrent(MappingTimeEval.CURRENT);
params.setContext(context);
params.setHasFullTargetObject(true);
mappingEvaluator.evaluateMappingSetProjection(params, task, opResult);
Expand Down

0 comments on commit d796298

Please sign in to comment.