Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feature/performance…
…-stable # Conflicts: # repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/work/WorkStateManager.java
- Loading branch information
Showing
68 changed files
with
6,491 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ExpressionWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package com.evolveum.midpoint.web.component.prism; | ||
|
||
import com.evolveum.midpoint.prism.*; | ||
import com.evolveum.midpoint.prism.path.ItemPath; | ||
import com.evolveum.midpoint.repo.common.expression.Expression; | ||
import com.evolveum.midpoint.util.exception.SchemaException; | ||
import com.evolveum.midpoint.util.logging.LoggingUtils; | ||
import com.evolveum.midpoint.util.logging.Trace; | ||
import com.evolveum.midpoint.util.logging.TraceManager; | ||
import com.evolveum.midpoint.web.util.ExpressionUtil; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ConstructionType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Created by honchar | ||
*/ | ||
public class ExpressionWrapper<T> extends PropertyWrapper<T> { | ||
|
||
private static final Trace LOGGER = TraceManager.getTrace(ExpressionWrapper.class); | ||
private ConstructionType construction; | ||
|
||
public ExpressionWrapper(@Nullable ContainerValueWrapper container, PrismProperty property, boolean readonly, ValueStatus status, ItemPath path) { | ||
super(container, property, readonly, status, path); | ||
|
||
PrismContainer outboundPrismContainer = container.getContainer().getItem(); | ||
if (outboundPrismContainer != null) { | ||
PrismContainerValue outboundValue = (PrismContainerValue) outboundPrismContainer.getParent(); | ||
if (outboundValue != null) { | ||
PrismContainer associationContainer = (PrismContainer) outboundValue.getParent(); | ||
if (associationContainer != null) { | ||
PrismContainerValue<ConstructionType> constructionContainer = (PrismContainerValue<ConstructionType>) associationContainer.getParent(); | ||
if (constructionContainer != null) { | ||
construction = constructionContainer.asContainerable(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
public ConstructionType getConstruction() { | ||
return construction; | ||
} | ||
|
||
public void setConstruction(ConstructionType construction) { | ||
this.construction = construction; | ||
} | ||
|
||
@Override | ||
public boolean hasChanged() { | ||
for (ValueWrapper valueWrapper : values) { | ||
ExpressionType expression = (ExpressionType) ((PrismPropertyValue) valueWrapper.getValue()).getValue(); | ||
ExpressionType oldExpressionValue = (ExpressionType)((PrismPropertyValue)valueWrapper.getOldValue()).getValue(); | ||
try { | ||
switch (valueWrapper.getStatus()) { | ||
case DELETED: | ||
return true; | ||
case ADDED: | ||
case NOT_CHANGED: | ||
if (ExpressionUtil.areAllExpressionValuesEmpty(oldExpressionValue) && ExpressionUtil.areAllExpressionValuesEmpty(expression)) { | ||
return false; | ||
} else if (!ExpressionUtil.areAllExpressionValuesEmpty(oldExpressionValue) && ExpressionUtil.areAllExpressionValuesEmpty(expression)) { | ||
return true; | ||
} else if (ExpressionUtil.areAllExpressionValuesEmpty(oldExpressionValue) && !ExpressionUtil.areAllExpressionValuesEmpty(expression)) { | ||
return true; | ||
} else if (valueWrapper.hasValueChanged()) { | ||
return true; | ||
} | ||
} | ||
} catch (SchemaException e) { | ||
LoggingUtils.logException(LOGGER, "Cannot check changes of the expression value" + expression, e); | ||
return false; | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.