Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/performance…
Browse files Browse the repository at this point in the history
…-stable

# Conflicts:
#	repo/task-quartz-impl/src/main/java/com/evolveum/midpoint/task/quartzimpl/work/WorkStateManager.java
  • Loading branch information
1azyman committed Apr 17, 2018
2 parents 89d9ba4 + 389311c commit 3f2bc60
Show file tree
Hide file tree
Showing 68 changed files with 6,491 additions and 204 deletions.
1 change: 1 addition & 0 deletions config/sql/_all/h2-3.8-all.sql
Expand Up @@ -237,6 +237,7 @@ CREATE TABLE m_audit_event (
targetOid VARCHAR(36),
targetOwnerName VARCHAR(255),
targetOwnerOid VARCHAR(36),
targetOwnerType INTEGER,
targetType INTEGER,
taskIdentifier VARCHAR(255),
taskOID VARCHAR(255),
Expand Down
1 change: 1 addition & 0 deletions config/sql/_all/mysql-3.8-all-utf8mb4.sql
Expand Up @@ -283,6 +283,7 @@ CREATE TABLE m_audit_event (
targetOid VARCHAR(36) CHARSET utf8 COLLATE utf8_bin ,
targetOwnerName VARCHAR(255),
targetOwnerOid VARCHAR(36) CHARSET utf8 COLLATE utf8_bin ,
targetOwnerType INTEGER,
targetType INTEGER,
taskIdentifier VARCHAR(255),
taskOID VARCHAR(255) CHARSET utf8 COLLATE utf8_bin ,
Expand Down
1 change: 1 addition & 0 deletions config/sql/_all/mysql-3.8-all.sql
Expand Up @@ -283,6 +283,7 @@ CREATE TABLE m_audit_event (
targetOid VARCHAR(36),
targetOwnerName VARCHAR(255),
targetOwnerOid VARCHAR(36),
targetOwnerType INTEGER,
targetType INTEGER,
taskIdentifier VARCHAR(255),
taskOID VARCHAR(255),
Expand Down
1 change: 1 addition & 0 deletions config/sql/_all/oracle-3.8-all.sql
Expand Up @@ -233,6 +233,7 @@ CREATE TABLE m_audit_event (
targetOid VARCHAR2(36 CHAR),
targetOwnerName VARCHAR2(255 CHAR),
targetOwnerOid VARCHAR2(36 CHAR),
targetOwnerType NUMBER(10, 0),
targetType NUMBER(10, 0),
taskIdentifier VARCHAR2(255 CHAR),
taskOID VARCHAR2(255 CHAR),
Expand Down
1 change: 1 addition & 0 deletions config/sql/_all/postgresql-3.8-all.sql
Expand Up @@ -233,6 +233,7 @@ CREATE TABLE m_audit_event (
targetOid VARCHAR(36),
targetOwnerName VARCHAR(255),
targetOwnerOid VARCHAR(36),
targetOwnerType INT4,
targetType INT4,
taskIdentifier VARCHAR(255),
taskOID VARCHAR(255),
Expand Down
1 change: 1 addition & 0 deletions config/sql/_all/sqlserver-3.8-all.sql
Expand Up @@ -233,6 +233,7 @@ CREATE TABLE m_audit_event (
targetOid NVARCHAR(36) COLLATE database_default,
targetOwnerName NVARCHAR(255) COLLATE database_default,
targetOwnerOid NVARCHAR(36) COLLATE database_default,
targetOwnerType INT,
targetType INT,
taskIdentifier NVARCHAR(255) COLLATE database_default,
taskOID NVARCHAR(255) COLLATE database_default,
Expand Down
Expand Up @@ -1546,7 +1546,9 @@ public String getBubbleLabel() {
addMenuItem(item, "PageAdmin.menu.top.cases.listAll", PageCasesAll.class);
addMenuItem(item, "PageAdmin.menu.top.caseWorkItems.list", PageCaseWorkItemsAllocatedToMe.class);
addMenuItem(item, "PageAdmin.menu.top.caseWorkItems.listAll", PageCaseWorkItemsAll.class);
addMenuItem(item, "PageAdmin.menu.top.caseWorkItems.view", PageCaseWorkItem.class);

createFocusPageViewMenu(item.getItems(), "PageAdmin.menu.top.caseWorkItems.view", PageCaseWorkItem.class);

addMenuItem(item, "PageAdmin.menu.top.case.new", PageCase.class);

return item;
Expand Down
Expand Up @@ -232,6 +232,11 @@ protected void executeCustomAction(AjaxRequestTarget target, ShadowType object)
pageBase.getPrismContext());
}

@Override
protected void executeCustomRemoveAction(AjaxRequestTarget target) {
ExpressionUtil.removeEvaluatorByName(ExpressionValuePanel.this.getModelObject(), SchemaConstantsGenerated.C_VALUE);
}

@Override
protected ObjectQuery getChooseQuery() {
ObjectQuery query = new ObjectQuery();
Expand Down
Expand Up @@ -393,22 +393,23 @@ private <C extends Containerable> void createContainerWrapper(ItemDefinition ite
private <T, C extends Containerable> PropertyWrapper<T> createPropertyWrapper(
PrismPropertyDefinition<T> def, ContainerValueWrapper<C> cWrapper, boolean onlyEmpty) {
PrismContainerValue<C> containerValue = cWrapper.getContainerValue();

PrismProperty property = containerValue.findProperty(def.getName());
boolean propertyIsReadOnly = isItemReadOnly(def, cWrapper);

if (property != null && onlyEmpty) {
return null;
}

if (ExpressionType.COMPLEX_TYPE.equals(def.getTypeName())){
if (property == null) {
PrismProperty newProperty = def.instantiate();
return new ExpressionWrapper(cWrapper, newProperty, propertyIsReadOnly, ValueStatus.ADDED, cWrapper.getPath().append(newProperty.getPath()));
} else {
return new ExpressionWrapper(cWrapper, property, propertyIsReadOnly, cWrapper.getStatus() == ValueStatus.ADDED ? ValueStatus.ADDED: ValueStatus.NOT_CHANGED, property.getPath());
}
}
if (property == null) {
PrismProperty<T> newProperty = def.instantiate();
// try {
// newProperty = containerValue.createProperty(def);
// } catch (SchemaException e) {
// LoggingUtils.logException(LOGGER, "Failed to create new property " + def, e);
// return null;
// }
return new PropertyWrapper(cWrapper, newProperty, propertyIsReadOnly, ValueStatus.ADDED, cWrapper.getPath().append(newProperty.getPath()));
}
return new PropertyWrapper(cWrapper, property, propertyIsReadOnly, cWrapper.getStatus() == ValueStatus.ADDED ? ValueStatus.ADDED: ValueStatus.NOT_CHANGED, property.getPath());
Expand Down
@@ -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;
}
}
Expand Up @@ -17,6 +17,7 @@
package com.evolveum.midpoint.web.component.prism;

import com.evolveum.midpoint.common.refinery.RefinedAttributeDefinition;
import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.prism.*;
Expand All @@ -27,8 +28,10 @@
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.component.input.ExpressionValuePanel;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.util.InfoTooltipBehavior;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;
import com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType;
Expand Down Expand Up @@ -257,7 +260,14 @@ public boolean isVisible() {

@Override
protected void populateItem(final ListItem<ValueWrapper> item) {
PrismValuePanel panel = new PrismValuePanel("value", item.getModel(), label, form, getValueCssClass(), getInputCssClass());
BasePanel panel;
if (item.getModelObject().getItem().getItemDefinition().getTypeName().equals(ExpressionType.COMPLEX_TYPE)){
ExpressionWrapper expressionWrapper = (ExpressionWrapper)item.getModelObject().getItem();
panel = new ExpressionValuePanel("value", new PropertyModel(item.getModel(), "value.value"),
expressionWrapper.getConstruction(), pageBase);
} else {
panel = new PrismValuePanel("value", item.getModel(), label, form, getValueCssClass(), getInputCssClass());
}
item.add(panel);
item.add(AttributeModifier.append("class", createStyleClassModel(item.getModel())));

Expand Down
Expand Up @@ -464,24 +464,6 @@ private Panel createTypedInputComponent(String id) {
typePanel.setOutputMarkupId(true);
return typePanel;
}
if (ExpressionType.COMPLEX_TYPE.equals(valueType)) {
//it is expected that ExpressionType property is in the
// construction/association/outbound container
// so we will try to find ConstructionType
//TODO refactor to more pretty code
ConstructionType construction = new ConstructionType();
try {
ContainerValueWrapper cvw = ((PropertyWrapper)(getModel().getObject().getItem())).getContainerValue();
PrismContainerValue association = (PrismContainerValue)cvw.getContainer().getItem().getParent();
PrismContainer associationContainer = (PrismContainer)association.asContainerable().asPrismContainerValue().getParent();
PrismContainerValue<ConstructionType> constructionContainerValue = (PrismContainerValue<ConstructionType>) associationContainer.getParent();
construction = constructionContainerValue.asContainerable();
} catch (Exception ex){
LOGGER.error("Unable to find Construction container for expression property");
}
return new ExpressionValuePanel(id, new PropertyModel<>(getModel(), baseExpression), construction, getPageBase());
}

if (DOMUtil.XSD_DATETIME.equals(valueType)) {
panel = new DatePanel(id, new PropertyModel<>(getModel(), baseExpression));

Expand Down
Expand Up @@ -254,6 +254,26 @@ public static boolean isEmpty(ExpressionType expression) {
return expression == null || expression.getExpressionEvaluator().isEmpty();
}

public static boolean isShadowRefNotEmpty(ExpressionType expression) {
ObjectReferenceType shadowRefValue = getShadowRefValue(expression);
return !isEmpty(expression) && shadowRefValue != null && StringUtils.isNotEmpty(shadowRefValue.getOid());
}

public static boolean isAssociationTargetSearchNotEmpty(ExpressionType expression) {
String path = getTargetSearchExpPathValue(expression);
String value = getTargetSearchExpValue(expression);
return StringUtils.isNotEmpty(path) && StringUtils.isNotEmpty(value);
}

public static boolean isLiteralExpressionValueNotEmpty(ExpressionType expression) throws SchemaException{
List<String> values = getLiteralExpressionValues(expression);
return values != null && values.size() > 0;
}

public static boolean areAllExpressionValuesEmpty(ExpressionType expression) throws SchemaException{
return !isShadowRefNotEmpty(expression) && !isLiteralExpressionValueNotEmpty(expression) && !isAssociationTargetSearchNotEmpty(expression);
}

public static void parseExpressionEvaluators(String xml, ExpressionType expressionObject, PrismContext context) throws SchemaException {
expressionObject.getExpressionEvaluator().clear();
if (StringUtils.isNotBlank(xml)) {
Expand Down
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.

0 comments on commit 3f2bc60

Please sign in to comment.