diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/ACAttributePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/ACAttributePanel.java index e3eb0faed43..65e4a65e8a8 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/ACAttributePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/ACAttributePanel.java @@ -18,7 +18,7 @@ import com.evolveum.midpoint.common.refinery.RefinedAttributeDefinition; import com.evolveum.midpoint.prism.PrismPropertyDefinition; -import com.evolveum.midpoint.web.component.util.BasePanel; +import com.evolveum.midpoint.web.component.util.BaseDeprecatedPanel; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.basic.Label; @@ -33,7 +33,7 @@ /** * @author lazyman */ -public class ACAttributePanel extends BasePanel { +public class ACAttributePanel extends BaseDeprecatedPanel { private static final String ID_ATTRIBUTE_LABEL = "attributeLabel"; private static final String ID_VALUES = "values"; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/ResourceListPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/ResourceListPanel.java index 8c460ab7edd..dca82a76af6 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/ResourceListPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/ResourceListPanel.java @@ -19,7 +19,7 @@ import com.evolveum.midpoint.web.component.data.ObjectDataProvider; import com.evolveum.midpoint.web.component.data.TablePanel; import com.evolveum.midpoint.web.component.data.column.LinkColumn; -import com.evolveum.midpoint.web.component.util.BasePanel; +import com.evolveum.midpoint.web.component.util.BaseDeprecatedPanel; import com.evolveum.midpoint.web.component.util.SelectableBean; import com.evolveum.midpoint.web.page.PageBase; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; @@ -34,7 +34,7 @@ /** * @author lazyman */ -public class ResourceListPanel extends BasePanel { +public class ResourceListPanel extends BaseDeprecatedPanel { public ResourceListPanel(String id) { super(id, null); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/menu/UserMenuPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/menu/UserMenuPanel.java index c68bcec4c75..b06432d2d0b 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/menu/UserMenuPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/menu/UserMenuPanel.java @@ -29,6 +29,7 @@ import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.web.component.AjaxButton; +import com.evolveum.midpoint.web.component.util.BasePageAwarePanel; import com.evolveum.midpoint.web.component.util.BaseSimplePanel; import com.evolveum.midpoint.web.component.util.LoadableModel; import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; @@ -40,6 +41,7 @@ import com.evolveum.midpoint.web.security.SecurityUtils; import com.evolveum.midpoint.web.util.WebMiscUtil; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; + import org.apache.wicket.AttributeModifier; import org.apache.wicket.Page; import org.apache.wicket.ajax.AjaxRequestTarget; @@ -103,7 +105,7 @@ public UserMenuPanel(String id) { @Override protected PasswordQuestionsDto load() { - return loadModel(); + return loadModel(null); } }; isPasswordModelLoaded = true; @@ -122,7 +124,7 @@ protected List load() { @Override protected void initLayout() { if (userModel != null && userModel.getObject() == null){ - loadModel(); + loadModel(null); } WebMarkupContainer iconBox = new WebMarkupContainer(ID_ICON_BOX); add(iconBox); @@ -142,7 +144,7 @@ public AbstractResource getObject() { @Override public boolean isVisible(){ if (userModel != null && userModel.getObject() == null){ - loadModel(); + loadModel(null); } return jpegPhoto != null; } @@ -154,7 +156,7 @@ public boolean isVisible(){ @Override public boolean isVisible(){ if (userModel != null && userModel.getObject() == null){ - loadModel(); + loadModel(null); } return jpegPhoto == null; @@ -191,7 +193,7 @@ public AbstractResource getObject() { @Override public boolean isVisible(){ if (userModel != null && userModel.getObject() == null){ - loadModel(); + loadModel(null); } return jpegPhoto != null; } @@ -203,7 +205,7 @@ public boolean isVisible(){ @Override public boolean isVisible(){ if (userModel != null && userModel.getObject() == null){ - loadModel(); + loadModel(null); } return jpegPhoto == null; } @@ -237,10 +239,6 @@ public void onClick(AjaxRequestTarget target) { }; add(editPasswordQ); - if (!isUserModelLoaded) { - loadModel(); - - } if (!isPasswordModelLoaded ){ passwordQuestionsDtoIModel = new LoadableModel(false) { @@ -248,7 +246,7 @@ public void onClick(AjaxRequestTarget target) { @Override protected PasswordQuestionsDto load() { - return loadModel(); + return loadModel(null); } }; isPasswordModelLoaded = true; @@ -287,21 +285,30 @@ private String getShortUserName() { return principal.toString(); } - private PasswordQuestionsDto loadModel() { + private PasswordQuestionsDto loadModel(PageBase parentPage) { LOGGER.trace("Loading user for Security Question Page."); PasswordQuestionsDto dto =new PasswordQuestionsDto(); OperationResult result = new OperationResult(OPERATION_LOAD_USER); - try{ - + + if (parentPage == null) { + parentPage = ((PageBase)getPage()); + } + + try { - String userOid = SecurityUtils.getPrincipalUser().getOid(); - Task task = ((PageBase)getPage()).createSimpleTask(OPERATION_LOAD_USER); + MidPointPrincipal principal = SecurityUtils.getPrincipalUser(); + if (principal == null) { + result.recordNotApplicableIfUnknown(); + return null; + } + String userOid = principal.getOid(); + Task task = parentPage.createSimpleTask(OPERATION_LOAD_USER); OperationResult subResult = result.createSubresult(OPERATION_LOAD_USER); Collection options = SelectorOptions.createCollection(UserType.F_JPEG_PHOTO, GetOperationOptions.createRetrieve(RetrieveOption.INCLUDE)); - PrismObject user = ((PageBase)getPage()).getModelService().getObject(UserType.class, userOid, options, task, subResult); + PrismObject user = parentPage.getModelService().getObject(UserType.class, userOid, options, task, subResult); userModel.setObject(user); jpegPhoto = user == null ? null : (user.asObjectable() == null ? null : user.asObjectable().getJpegPhoto()); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ContainerWrapper.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ContainerWrapper.java index 1bf7eee55a4..e65258093e0 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ContainerWrapper.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ContainerWrapper.java @@ -22,7 +22,11 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; @@ -30,6 +34,7 @@ import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.polystring.PolyString; import com.evolveum.midpoint.schema.constants.SchemaConstants; + import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; @@ -40,6 +45,7 @@ import com.evolveum.midpoint.util.DebugDumpable; import com.evolveum.midpoint.util.DebugUtil; import com.evolveum.midpoint.util.exception.SchemaException; +import com.evolveum.midpoint.util.exception.SystemException; import com.evolveum.midpoint.util.logging.LoggingUtils; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; @@ -54,6 +60,7 @@ import com.evolveum.midpoint.xml.ns._public.common.common_3.PasswordType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowAssociationType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ActivationCapabilityType; @@ -73,7 +80,7 @@ public class ContainerWrapper implements ItemWrapper, private static final String CREATE_PROPERTIES = DOT_CLASS + "createProperties"; private String displayName; - private ObjectWrapper object; + private ObjectWrapper objectWrapper; private T container; private ContainerStatus status; @@ -87,23 +94,35 @@ public class ContainerWrapper implements ItemWrapper, private OperationResult result; private PrismContainerDefinition containerDefinition; - - public ContainerWrapper(ObjectWrapper object, T container, ContainerStatus status, ItemPath path, + + public ContainerWrapper(ObjectWrapper objectWrapper, T container, ContainerStatus status, ItemPath path, PageBase pageBase) { + this(objectWrapper, container, status, path, true, pageBase); + } + + private ContainerWrapper(ObjectWrapper objectWrapper, T container, ContainerStatus status, ItemPath path, + boolean createProperties, PageBase pageBase) { Validate.notNull(container, "Prism object must not be null."); Validate.notNull(status, "Container status must not be null."); Validate.notNull(pageBase, "pageBase must not be null."); - this.object = object; + this.objectWrapper = objectWrapper; this.container = container; this.status = status; this.path = path; main = path == null; - readonly = object.isReadonly(); // [pm] this is quite questionable - showInheritedObjectAttributes = object.isShowInheritedObjectAttributes(); + readonly = objectWrapper.isReadonly(); // [pm] this is quite questionable + showInheritedObjectAttributes = objectWrapper.isShowInheritedObjectAttributes(); // have to be after setting "main" property containerDefinition = getItemDefinition(); - properties = createProperties(pageBase); + if (createProperties) { + // HACK HACK HACK, the container wrapper should not parse itself. This code should not be here. + // Constructor should NOT parse the object + // the createProperties parameter is here to avoid looping when parsing associations + properties = createProperties(pageBase); + } else { + properties = new ArrayList<>(); + } } public void revive(PrismContext prismContext) throws SchemaException { @@ -123,9 +142,9 @@ public void revive(PrismContext prismContext) throws SchemaException { @Override public PrismContainerDefinition getItemDefinition() { if (main) { - return object.getDefinition(); + return objectWrapper.getDefinition(); } else { - return object.getDefinition().findContainerDefinition(path); + return objectWrapper.getDefinition().findContainerDefinition(path); } } @@ -138,7 +157,7 @@ void clearResult() { } ObjectWrapper getObject() { - return object; + return objectWrapper; } ContainerStatus getStatus() { @@ -180,7 +199,7 @@ private List createProperties(PageBase pageBase) { if (ShadowType.F_ATTRIBUTES.equals(name)) { try { - definition = object.getRefinedAttributeDefinition(); + definition = objectWrapper.getRefinedAttributeDefinition(); if (definition == null) { PrismReference resourceRef = parent.findReference(ShadowType.F_RESOURCE_REF); @@ -188,7 +207,7 @@ private List createProperties(PageBase pageBase) { definition = pageBase .getModelInteractionService() - .getEditObjectClassDefinition((PrismObject) object.getObject(), resource, + .getEditObjectClassDefinition((PrismObject) objectWrapper.getObject(), resource, AuthorizationPhaseType.REQUEST) .toResourceAttributeContainerDefinition(); @@ -266,12 +285,31 @@ private List createProperties(PageBase pageBase) { } } else if (isShadowAssociation()) { - if (object.getAssociations() != null) { - for (PrismProperty property : object.getAssociations()) { - // TODO: fix this -> for now, read only is supported.. - PropertyWrapper propertyWrapper = new PropertyWrapper(this, property, false, - ValueStatus.NOT_CHANGED); - properties.add(propertyWrapper); + if (objectWrapper.getAssociations() != null) { + Map> assocMap = new HashMap<>(); + for (PrismContainerValue cval : objectWrapper.getAssociations()) { + ShadowAssociationType associationType = cval.asContainerable(); + QName assocName = associationType.getName(); + PrismContainer fractionalContainer = assocMap.get(assocName); + if (fractionalContainer == null) { + fractionalContainer = new PrismContainer<>(ShadowType.F_ASSOCIATION, ShadowAssociationType.class, cval.getPrismContext()); + fractionalContainer.setDefinition(cval.getParent().getDefinition()); + // HACK: set the name of the association as the element name so wrapper.getName() will return correct data. + fractionalContainer.setElementName(assocName); + assocMap.put(assocName, fractionalContainer); + } + try { + fractionalContainer.add(cval.clone()); + } catch (SchemaException e) { + // Should not happen + throw new SystemException("Unexpected error: "+e.getMessage(),e); + } + } + + for (Entry> assocEntry: assocMap.entrySet()) { + // HACK HACK HACK, the container wrapper should not parse itself. This code should not be here. + PropertyWrapper assocWrapper = new PropertyWrapper(this, assocEntry.getValue(), this.isReadonly(), ValueStatus.NOT_CHANGED); + properties.add(assocWrapper); } } @@ -311,7 +349,7 @@ private List createProperties(PageBase pageBase) { // decision is based on parent object status, not this // container's one (because container can be added also // to an existing object) - if (object.getStatus() == ContainerStatus.MODIFYING) { + if (objectWrapper.getStatus() == ContainerStatus.MODIFYING) { propertyIsReadOnly = !def.canModify(); } else { @@ -336,7 +374,7 @@ private List createProperties(PageBase pageBase) { // decision is based on parent object status, not this // container's one (because container can be added also // to an existing object) - if (object.getStatus() == ContainerStatus.MODIFYING) { + if (objectWrapper.getStatus() == ContainerStatus.MODIFYING) { propertyIsReadOnly = !def.canModify(); } else { @@ -487,7 +525,7 @@ boolean isItemVisible(ItemWrapper item) { // we decide not according to status of this container, but according to // the status of the whole object - if (object.getStatus() == ContainerStatus.ADDING) { + if (objectWrapper.getStatus() == ContainerStatus.ADDING) { return def.canAdd(); } @@ -506,8 +544,13 @@ boolean isItemVisible(ItemWrapper item) { private boolean showEmpty(ItemWrapper item) { ObjectWrapper object = getObject(); List values = item.getValues(); - boolean isEmpty = values.isEmpty(); - if (values.size() == 1) { + boolean isEmpty; + if (values == null) { + isEmpty = true; + } else { + isEmpty = values.isEmpty(); + } + if (!isEmpty && values.size() == 1) { ValueWrapper value = values.get(0); if (ValueStatus.ADDED.equals(value.getStatus())) { isEmpty = true; @@ -529,6 +572,11 @@ public void setDisplayName(String name) { this.displayName = name; } + @Override + public QName getName() { + return getItem().getElementName(); + } + public boolean isMain() { return main; } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ItemWrapper.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ItemWrapper.java index 21710f70af1..70d055d0a85 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ItemWrapper.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ItemWrapper.java @@ -18,6 +18,8 @@ import java.util.List; +import javax.xml.namespace.QName; + import com.evolveum.midpoint.prism.Item; import com.evolveum.midpoint.prism.ItemDefinition; import com.evolveum.midpoint.prism.Revivable; @@ -28,6 +30,8 @@ */ public interface ItemWrapper extends Revivable, DebugDumpable { + QName getName(); + String getDisplayName(); void setDisplayName(String name); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ObjectWrapper.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ObjectWrapper.java index d978f5a2e7b..e816dccf256 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ObjectWrapper.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ObjectWrapper.java @@ -28,6 +28,7 @@ import javax.xml.namespace.QName; import com.evolveum.midpoint.prism.delta.*; + import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; @@ -123,7 +124,7 @@ public class ObjectWrapper implements Serializable, Reviva private OperationResult result; private boolean protectedAccount; - private List associations; + private List> associations; private Collection> parentOrgs = new ArrayList<>(); private OperationResult fetchResult; @@ -178,11 +179,11 @@ public void revive(PrismContext prismContext) throws SchemaException { } } - public List getAssociations() { + public List> getAssociations() { return associations; } - public void setAssociations(List associations) { + public void setAssociations(List> associations) { this.associations = associations; } @@ -625,7 +626,7 @@ public ObjectDelta getObjectDelta() throws SchemaException { ItemPath path = containerWrapper.getPath() != null ? containerWrapper.getPath() : new ItemPath(); if (itemWrapper instanceof PropertyWrapper) { - PropertyDelta pDelta = computePropertyDeltas((PropertyWrapper) itemWrapper, path); + ItemDelta pDelta = computePropertyDeltas((PropertyWrapper) itemWrapper, path); if (!pDelta.isEmpty()) { delta.addModification(pDelta); } @@ -647,14 +648,15 @@ public ObjectDelta getObjectDelta() throws SchemaException { return delta; } - private PropertyDelta computePropertyDeltas(PropertyWrapper propertyWrapper, ItemPath path) { - PrismPropertyDefinition propertyDef = propertyWrapper.getItem().getDefinition(); + private ItemDelta computePropertyDeltas(PropertyWrapper propertyWrapper, ItemPath path) { + ItemDefinition itemDef = propertyWrapper.getItem().getDefinition(); - PropertyDelta pDelta = new PropertyDelta(path, propertyDef.getName(), propertyDef, - propertyDef.getPrismContext()); // hoping the - // prismContext is there + ItemDelta pDelta = itemDef.createEmptyDelta(path); +// PropertyDelta pDelta = new PropertyDelta(path, itemDef.getName(), itemDef, +// itemDef.getPrismContext()); // hoping the +// // prismContext is there - addItemDelta(propertyWrapper, pDelta, propertyDef, path); + addItemDelta(propertyWrapper, pDelta, itemDef, path); return pDelta; } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PrismObjectPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PrismObjectPanel.java index 62f6b078033..307e4b8e873 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PrismObjectPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PrismObjectPanel.java @@ -150,7 +150,7 @@ public boolean isDisabled(ObjectWrapper wrapper) { if (enabledProperty == null || enabledProperty.getValues().isEmpty()) { return false; } - ValueWrapper value = enabledProperty.getValues().get(0); + ValueWrapper value = (ValueWrapper) enabledProperty.getValues().get(0); if (value.getValue() == null) { return false; } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PrismValuePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PrismValuePanel.java index 0627b67def9..494f6a41cc6 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PrismValuePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PrismValuePanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Evolveum + * Copyright (c) 2010-2015 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,10 @@ import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; +import com.evolveum.midpoint.common.refinery.CompositeRefinedObjectClassDefinition; +import com.evolveum.midpoint.common.refinery.RefinedAssociationDefinition; +import com.evolveum.midpoint.common.refinery.RefinedObjectClassDefinition; +import com.evolveum.midpoint.common.refinery.RefinedResourceSchema; import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.query.*; import com.evolveum.midpoint.util.logging.LoggingUtils; @@ -33,6 +37,7 @@ import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.web.page.admin.users.component.AssociationValueChoosePanel; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; + import org.apache.commons.lang.ClassUtils; import org.apache.commons.lang.Validate; import org.apache.wicket.AttributeModifier; @@ -63,12 +68,14 @@ import com.evolveum.midpoint.schema.RetrieveOption; import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.constants.SchemaConstants; +import com.evolveum.midpoint.schema.processor.ObjectClassComplexTypeDefinition; import com.evolveum.midpoint.schema.processor.ResourceAttribute; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.ShadowUtil; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.util.DOMUtil; import com.evolveum.midpoint.util.exception.SchemaException; +import com.evolveum.midpoint.util.exception.SystemException; import com.evolveum.midpoint.web.component.form.ValueChoosePanel; import com.evolveum.midpoint.web.component.input.AutoCompleteTextPanel; import com.evolveum.midpoint.web.component.input.DatePanel; @@ -370,6 +377,9 @@ protected void onUpdate(AjaxRequestTarget target) { // } } } + if (component == null) { + throw new RuntimeException("Cannot create input component for item "+property+" ("+valueWrapper+") in "+objectWrapper); + } return component; } @@ -402,36 +412,13 @@ private Panel createTypedInputComponent(String id) { final Item item = model.getObject().getItem().getItem(); Panel panel = null; - if (item instanceof PrismProperty){ + if (item instanceof PrismProperty) { final PrismProperty property = (PrismProperty) item; PrismPropertyDefinition definition = property.getDefinition(); QName valueType = definition.getTypeName(); final String baseExpression = "value.value"; //pointing to prism property real value - ItemWrapper itemWrapper = model.getObject().getItem(); - ContainerWrapper containerWrapper = itemWrapper.getContainer(); - if(containerWrapper != null && containerWrapper.getPath() != null){ - if(ShadowType.F_ASSOCIATION.getLocalPart().equals(containerWrapper.getPath().toString())){ - PrismContext prismContext = item.getPrismContext(); - if (prismContext == null) { - prismContext = pageBase.getPrismContext(); - } - - PrismContainerValue assocContainer = (PrismContainerValue)item.getParent(); - PrismProperty objectClassItem = (PrismProperty)assocContainer.findItem(ShadowType.F_OBJECT_CLASS); - PrismProperty kindItem = (PrismProperty)assocContainer.findItem(ShadowType.F_KIND); - PrismProperty intentItem = (PrismProperty)assocContainer.findItem(ShadowType.F_INTENT); - PrismObject resource = ((ShadowType)containerWrapper.getObject().getObject().asObjectable()).getResource().asPrismObject(); - ObjectQuery query = getAssociationsSearchQuery(prismContext, resource, - objectClassItem, kindItem, intentItem); - - PropertyModel propertyModel = new PropertyModel<>(model, "value"); - List values = item.getValues(); - return new AssociationValueChoosePanel(id, model, values, false, ShadowType.class, query); - } - } - //fixing MID-1230, will be improved with some kind of annotation or something like that //now it works only in description if (ObjectType.F_DESCRIPTION.equals(definition.getName())) { @@ -621,7 +608,7 @@ public void checkInputValue(AutoCompleteTextField input, AjaxRequestTarget targe panel = new TextPanel<>(id, new PropertyModel(model, baseExpression), type); } } - } else if (item instanceof PrismReference){ + } else if (item instanceof PrismReference) { // ((PrismReferenceDefinition) item.getDefinition()). Class typeFromName = null; PrismContext prismContext = item.getPrismContext(); @@ -635,7 +622,40 @@ public void checkInputValue(AutoCompleteTextField input, AjaxRequestTarget targe final Class typeClass = typeFromName != null ? typeFromName : (item.getDefinition().getTypeClassIfKnown() != null ? item.getDefinition().getTypeClassIfKnown() : FocusType.class); panel = new ValueChoosePanel(id, new PropertyModel<>(model, "value"), item.getValues(), false, typeClass); - } + + } else if (item instanceof PrismContainer) { + ItemWrapper itemWrapper = model.getObject().getItem(); + final PrismContainer container = (PrismContainer) item; + PrismContainerDefinition definition = container.getDefinition(); + QName valueType = definition.getTypeName(); + + if (ShadowAssociationType.COMPLEX_TYPE.equals(valueType)) { + + PrismContext prismContext = item.getPrismContext(); + if (prismContext == null) { + prismContext = pageBase.getPrismContext(); + } + + ShadowType shadowType = ((ShadowType)itemWrapper.getContainer().getObject().getObject().asObjectable()); + PrismObject resource = shadowType.getResource().asPrismObject(); + RefinedResourceSchema refinedSchema; + CompositeRefinedObjectClassDefinition rOcDef; + try { + refinedSchema = RefinedResourceSchema.getRefinedSchema(resource); + rOcDef = refinedSchema.determineCompositeObjectClassDefinition(shadowType.asPrismObject()); + } catch (SchemaException e) { + throw new SystemException(e.getMessage(),e); + } + RefinedAssociationDefinition assocDef = rOcDef.findAssociation(itemWrapper.getName()); + RefinedObjectClassDefinition assocTarget = assocDef.getAssociationTarget(); + + ObjectQuery query = getAssociationsSearchQuery(prismContext, resource, + assocTarget.getTypeName(), assocTarget.getKind(), assocTarget.getIntent()); + + List values = item.getValues(); + return new AssociationValueChoosePanel(id, model, values, false, ShadowType.class, query); + } + } return panel; } @@ -792,13 +812,13 @@ private void removeValue(AjaxRequestTarget target) { target.add(parent.getParent()); } - private ObjectQuery getAssociationsSearchQuery(PrismContext prismContext, PrismObject resource, PrismProperty objectClass, PrismProperty kind, - PrismProperty intent){ + private ObjectQuery getAssociationsSearchQuery(PrismContext prismContext, PrismObject resource, QName objectClass, ShadowKindType kind, + String intent) { try { ObjectFilter andFilter = AndFilter.createAnd( - EqualFilter.createEqual(ShadowType.F_OBJECT_CLASS, ShadowType.class, prismContext, objectClass.getRealValue()), - EqualFilter.createEqual(ShadowType.F_KIND, ShadowType.class, prismContext, kind.getRealValue()), -// EqualFilter.createEqual(ShadowType.F_INTENT, ShadowType.class, prismContext, intent.getRealValue()), + EqualFilter.createEqual(ShadowType.F_OBJECT_CLASS, ShadowType.class, prismContext, objectClass), + EqualFilter.createEqual(ShadowType.F_KIND, ShadowType.class, prismContext, kind), +// EqualFilter.createEqual(ShadowType.F_INTENT, ShadowType.class, prismContext, intent), RefFilter.createReferenceEqual(new ItemPath(ShadowType.F_RESOURCE_REF), ShadowType.class, prismContext, resource.getOid())); ObjectQuery query = ObjectQuery.createObjectQuery(andFilter); return query; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PropertyWrapper.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PropertyWrapper.java index f6c8cc4e612..a90c0ae62a7 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PropertyWrapper.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/PropertyWrapper.java @@ -16,12 +16,14 @@ package com.evolveum.midpoint.web.component.prism; +import com.evolveum.midpoint.prism.Item; import com.evolveum.midpoint.prism.ItemDefinition; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.PrismProperty; import com.evolveum.midpoint.prism.PrismPropertyDefinition; import com.evolveum.midpoint.prism.PrismPropertyValue; +import com.evolveum.midpoint.prism.PrismValue; import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.polystring.PolyString; import com.evolveum.midpoint.schema.SchemaConstantsGenerated; @@ -39,20 +41,22 @@ import java.util.ArrayList; import java.util.List; +import javax.xml.namespace.QName; + /** * @author lazyman */ -public class PropertyWrapper implements ItemWrapper, Serializable, DebugDumpable { +public class PropertyWrapper implements ItemWrapper, Serializable, DebugDumpable { private ContainerWrapper container; - private PrismProperty property; + private I property; private ValueStatus status; private List values; private String displayName; private boolean readonly; - private PrismPropertyDefinition itemDefinition; + private ItemDefinition itemDefinition; - public PropertyWrapper(ContainerWrapper container, PrismProperty property, boolean readonly, ValueStatus status) { + public PropertyWrapper(ContainerWrapper container, I property, boolean readonly, ValueStatus status) { Validate.notNull(property, "Property must not be null."); Validate.notNull(status, "Property status must not be null."); @@ -82,10 +86,10 @@ public void revive(PrismContext prismContext) throws SchemaException { } @Override - public PrismPropertyDefinition getItemDefinition() { - PrismPropertyDefinition propDef = null; + public ItemDefinition getItemDefinition() { + ItemDefinition propDef = null; if (container.getItemDefinition() != null){ - propDef = container.getItemDefinition().findPropertyDefinition(property.getDefinition().getName()); + propDef = container.getItemDefinition().findItemDefinition(property.getDefinition().getName()); } if (propDef == null) { propDef = property.getDefinition(); @@ -114,8 +118,13 @@ public String getDisplayName() { } return ContainerWrapper.getDisplayNameFromItem(property); } - + @Override + public QName getName() { + return getItem().getElementName(); + } + + @Override public void setDisplayName(String displayName) { this.displayName = displayName; } @@ -133,14 +142,14 @@ public List getValues() { } @Override - public PrismProperty getItem() { + public I getItem() { return property; } private List createValues() { List values = new ArrayList(); - for (PrismPropertyValue prismValue : (List) property.getValues()) { + for (PrismValue prismValue : (List) property.getValues()) { values.add(new ValueWrapper(this, prismValue, ValueStatus.NOT_CHANGED)); } @@ -161,7 +170,7 @@ public void addValue(){ } public ValueWrapper createAddedValue() { - PrismPropertyDefinition definition = property.getDefinition(); + ItemDefinition definition = property.getDefinition(); ValueWrapper wrapper; if (SchemaConstants.T_POLY_STRING_TYPE.equals(definition.getTypeName())) { diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ReferenceWrapper.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ReferenceWrapper.java index b78ede47502..66da3420077 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ReferenceWrapper.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ReferenceWrapper.java @@ -19,6 +19,8 @@ import java.util.ArrayList; import java.util.List; +import javax.xml.namespace.QName; + import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; @@ -98,8 +100,13 @@ public String getDisplayName() { public void setDisplayName(String displayName) { this.displayName = displayName; } + + @Override + public QName getName() { + return getItem().getElementName(); + } - public ValueStatus getStatus() { + public ValueStatus getStatus() { return status; } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BaseDeprecatedPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BaseDeprecatedPanel.java new file mode 100644 index 00000000000..ed5ca981ab0 --- /dev/null +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BaseDeprecatedPanel.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2013 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.web.component.util; + +import com.evolveum.midpoint.web.page.PageBase; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.Validate; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.StringResourceModel; + +/** + * @author lazyman + */ +@Deprecated +public abstract class BaseDeprecatedPanel extends Panel { + + private IModel model; + private boolean initialized; + + public BaseDeprecatedPanel(String id, IModel model) { + super(id); + + this.model = model; + } + + @Override + protected void onBeforeRender() { + super.onBeforeRender(); + + if (initialized) { + return; + } + initLayout(); + initialized = true; + } + + protected IModel getModel() { + return model; + } + + public String getString(String resourceKey, Object... objects) { + return createStringResource(resourceKey, objects).getString(); + } + + public StringResourceModel createStringResource(String resourceKey, Object... objects) { + return new StringResourceModel(resourceKey, this, null, resourceKey, objects); + } + + public StringResourceModel createStringResource(Enum e) { + String resourceKey = e.getDeclaringClass().getSimpleName() + "." + e.name(); + return createStringResource(resourceKey); + } + + public PageBase getPageBase() { + return (PageBase) getPage(); + } + + protected void initLayout() { + } + + protected String createComponentPath(String... components) { + return StringUtils.join(components, ":"); + } +} diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BasePageAwarePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BasePageAwarePanel.java new file mode 100644 index 00000000000..bfab5d7ba82 --- /dev/null +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BasePageAwarePanel.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015 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.web.component.util; + +import org.apache.wicket.model.IModel; + +import com.evolveum.midpoint.web.page.PageBase; + +/** + * @author semancik + */ +public class BasePageAwarePanel extends BasePanel { + + public BasePageAwarePanel(String id, PageBase parentPage) { + this(id, null, parentPage); + } + + public BasePageAwarePanel(String id, IModel model, PageBase parentPage) { + super(id, model); + + initLayout(parentPage); + } + + protected void initLayout(PageBase parentPage) { + + } +} diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BasePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BasePanel.java index d2531730432..b3dd40f4536 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BasePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BasePanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Evolveum + * Copyright (c) 2010-2015 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,43 +16,43 @@ package com.evolveum.midpoint.web.component.util; -import com.evolveum.midpoint.web.page.PageBase; +import com.evolveum.midpoint.web.security.MidPointApplication; +import com.evolveum.midpoint.web.security.MidPointAuthWebSession; +import com.evolveum.midpoint.web.security.WebApplicationConfiguration; import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.Validate; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.StringResourceModel; /** * @author lazyman + * @author semancik */ -@Deprecated -public abstract class BasePanel extends Panel { +public class BasePanel extends Panel { private IModel model; - private boolean initialized; + + public BasePanel(String id) { + this(id, null); + } public BasePanel(String id, IModel model) { super(id); - - this.model = model; + this.model = model == null ? createModel() : model; } - @Override - protected void onBeforeRender() { - super.onBeforeRender(); - - if (initialized) { - return; - } - initLayout(); - initialized = true; + public IModel createModel() { + return null; } - protected IModel getModel() { + public IModel getModel() { return model; } + public T getModelObject() { + return model != null ? model.getObject() : null; + } + public String getString(String resourceKey, Object... objects) { return createStringResource(resourceKey, objects).getString(); } @@ -62,18 +62,44 @@ public StringResourceModel createStringResource(String resourceKey, Object... ob } public StringResourceModel createStringResource(Enum e) { - String resourceKey = e.getDeclaringClass().getSimpleName() + "." + e.name(); - return createStringResource(resourceKey); + return createStringResource(e, null); } - public PageBase getPageBase() { - return (PageBase) getPage(); + public StringResourceModel createStringResource(Enum e, String prefix) { + return createStringResource(e, prefix, null); } - protected void initLayout() { + public StringResourceModel createStringResource(Enum e, String prefix, String nullKey) { + StringBuilder sb = new StringBuilder(); + if (StringUtils.isNotEmpty(prefix)) { + sb.append(prefix).append('.'); + } + + if (e == null) { + if (StringUtils.isNotEmpty(nullKey)) { + sb.append(nullKey); + } else { + sb = new StringBuilder(); + } + } else { + sb.append(e.getDeclaringClass().getSimpleName()).append('.'); + sb.append(e.name()); + } + + return createStringResource(sb.toString()); } protected String createComponentPath(String... components) { return StringUtils.join(components, ":"); } + + public WebApplicationConfiguration getWebApplicationConfiguration() { + MidPointApplication application = (MidPointApplication) MidPointApplication.get(); + return application.getWebApplicationConfiguration(); + } + + @Override + public MidPointAuthWebSession getSession() { + return (MidPointAuthWebSession) super.getSession(); + } } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BaseSimplePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BaseSimplePanel.java index 5466ddaa407..2d7da60d95d 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BaseSimplePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/util/BaseSimplePanel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 Evolveum + * Copyright (c) 2010-2015 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,95 +16,25 @@ package com.evolveum.midpoint.web.component.util; -import com.evolveum.midpoint.web.security.MidPointApplication; -import com.evolveum.midpoint.web.security.MidPointAuthWebSession; -import com.evolveum.midpoint.web.security.WebApplicationConfiguration; -import org.apache.commons.lang.StringUtils; -import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.model.IModel; -import org.apache.wicket.model.StringResourceModel; /** * @author lazyman + * @author semancik */ -public class BaseSimplePanel extends Panel { - - private IModel model; +public class BaseSimplePanel extends BasePanel { public BaseSimplePanel(String id) { this(id, null); } public BaseSimplePanel(String id, IModel model) { - super(id); - this.model = model == null ? createModel() : model; + super(id, model); initLayout(); } - public IModel createModel() { - return null; - } - - public IModel getModel() { - return model; - } - - public T getModelObject() { - return model != null ? model.getObject() : null; - } - - public String getString(String resourceKey, Object... objects) { - return createStringResource(resourceKey, objects).getString(); - } - - public StringResourceModel createStringResource(String resourceKey, Object... objects) { - return new StringResourceModel(resourceKey, this, null, resourceKey, objects); - } - - public StringResourceModel createStringResource(Enum e) { - return createStringResource(e, null); - } - - public StringResourceModel createStringResource(Enum e, String prefix) { - return createStringResource(e, prefix, null); - } - - public StringResourceModel createStringResource(Enum e, String prefix, String nullKey) { - StringBuilder sb = new StringBuilder(); - if (StringUtils.isNotEmpty(prefix)) { - sb.append(prefix).append('.'); - } - - if (e == null) { - if (StringUtils.isNotEmpty(nullKey)) { - sb.append(nullKey); - } else { - sb = new StringBuilder(); - } - } else { - sb.append(e.getDeclaringClass().getSimpleName()).append('.'); - sb.append(e.name()); - } - - return createStringResource(sb.toString()); - } - - protected String createComponentPath(String... components) { - return StringUtils.join(components, ":"); - } - protected void initLayout() { } - - public WebApplicationConfiguration getWebApplicationConfiguration() { - MidPointApplication application = (MidPointApplication) MidPointApplication.get(); - return application.getWebApplicationConfiguration(); - } - - @Override - public MidPointAuthWebSession getSession() { - return (MidPointAuthWebSession) super.getSession(); - } } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/BaseFocusPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/BaseFocusPanel.java index 94bc032c58d..8b030813ab0 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/BaseFocusPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/BaseFocusPanel.java @@ -54,6 +54,7 @@ import com.evolveum.midpoint.web.util.OnePageParameterEncoder; import com.evolveum.midpoint.web.util.WebMiscUtil; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; + import org.apache.commons.lang.StringUtils; import org.apache.wicket.Component; import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior; @@ -74,6 +75,7 @@ import org.apache.wicket.util.string.StringValue; import javax.xml.namespace.QName; + import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -722,7 +724,7 @@ private void updateShadowActivation(AjaxRequestTarget target, List> getFocusModel() { } public void initialize(final PrismObject userToEdit) { - focusModel = new LoadableModel>(false) { - - @Override - protected ObjectWrapper load() { - return loadFocusWrapper(userToEdit); - } - }; - shadowModel = new LoadableModel>(false) { - - @Override - protected List load() { - return loadShadowWrappers(); - } - }; - - orgModel = new LoadableModel>(false) { - - @Override - protected List load() { - return loadOrgWrappers(); - } - }; - - assignmentsModel = new LoadableModel>(false) { - - @Override - protected List load() { - return loadAssignments(); - } - }; - - performCustomInitialization(); - - initLayout(); + try { + + focusModel = new LoadableModel>(false) { + + @Override + protected ObjectWrapper load() { + return loadFocusWrapper(userToEdit); + } + }; + shadowModel = new LoadableModel>(false) { + + @Override + protected List load() { + return loadShadowWrappers(); + } + }; + + orgModel = new LoadableModel>(false) { + + @Override + protected List load() { + return loadOrgWrappers(); + } + }; + + assignmentsModel = new LoadableModel>(false) { + + @Override + protected List load() { + return loadAssignments(); + } + }; + + performCustomInitialization(); + + initLayout(); + + LOGGER.trace("Page {} initialized", this); + } catch (Exception e) { + LoggingUtils.logException(LOGGER, "Error initializing page "+this, e); + } } protected void performCustomInitialization() { @@ -681,9 +691,9 @@ private

List loadProjectionWrappers(C PrismContainer associationContainer = projection .findContainer(ShadowType.F_ASSOCIATION); if (associationContainer != null && associationContainer.getValues() != null) { - List associations = new ArrayList<>( + List> associations = new ArrayList<>( associationContainer.getValues().size()); - for (PrismContainerValue associationVal : associationContainer.getValues()) { + for (PrismContainerValue associationVal : associationContainer.getValues()) { ShadowAssociationType associationType = (ShadowAssociationType) associationVal .asContainerable(); ObjectReferenceType shadowRef = associationType.getShadowRef(); @@ -691,12 +701,11 @@ private

List loadProjectionWrappers(C // associations we can safely eliminate fetching // from resource, because we need only the name if (shadowRef != null) { - PrismObject association = getModelService() - .getObject(ShadowType.class, shadowRef.getOid(), - SelectorOptions.createCollection( - GetOperationOptions.createNoFetch()), - task, subResult); - associations.add(association.findProperty(ShadowType.F_NAME)); + PrismObject associationTargetShadow = getModelService().getObject(ShadowType.class, + shadowRef.getOid(), SelectorOptions.createCollection(GetOperationOptions.createNoFetch()), + task, subResult); + shadowRef.asReferenceValue().setObject(associationTargetShadow); + associations.add(associationVal); } } wrapper.setAssociations(associations); @@ -1704,7 +1713,7 @@ private void updateShadowActivation(AjaxRequestTarget target, List extends BasePanel { +public abstract class AbstractAssignableSelectionPanel extends BaseDeprecatedPanel { private static final String ID_ADD = "add"; protected Class type = (Class) RoleType.class; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/AssociationValueChoosePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/AssociationValueChoosePanel.java index cdfde587186..40d3798bc01 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/AssociationValueChoosePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/AssociationValueChoosePanel.java @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2010-2015 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.web.page.admin.users.component; import com.evolveum.midpoint.prism.*; @@ -57,11 +72,9 @@ public class AssociationValueChoosePanel extends Simpl private static final String ID_REMOVE = "remove"; private static final String ID_BUTTON_GROUP = "buttonGroup"; private static final String ID_EDIT = "edit"; - private IModel model; - protected static final String MODAL_ID_OBJECT_SELECTION_POPUP = "objectSelectionPopup"; - + private IModel model; private ObjectQuery query = null; public AssociationValueChoosePanel(String id, IModel model, List values, boolean required, Class type, diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ResourcesSelectionPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ResourcesSelectionPanel.java index 6771307fc88..d3012e9adbd 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ResourcesSelectionPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/users/component/ResourcesSelectionPanel.java @@ -28,7 +28,7 @@ import com.evolveum.midpoint.web.component.assignment.AssignmentSearchDto; import com.evolveum.midpoint.web.component.data.TablePanel; import com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn; -import com.evolveum.midpoint.web.component.util.BasePanel; +import com.evolveum.midpoint.web.component.util.BaseDeprecatedPanel; import com.evolveum.midpoint.web.component.util.LoadableModel; import com.evolveum.midpoint.web.component.util.SelectableBean; import com.evolveum.midpoint.web.page.PageBase; @@ -51,7 +51,7 @@ import java.util.ArrayList; import java.util.List; -public class ResourcesSelectionPanel extends BasePanel { +public class ResourcesSelectionPanel extends BaseDeprecatedPanel { private static final String ID_BASIC_SEARCH = "basicSearch"; private static final String ID_SEARCH_FORM = "searchForm"; diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/error/PageError.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/error/PageError.html index 2fde0f00a75..7f8898e7517 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/error/PageError.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/error/PageError.html @@ -1,6 +1,6 @@