private List<ContainerWrapper> createContainerWrapper( PrismContainer parent, ItemPath path, PageBase pageBase) { PrismContainerDefinition definition = parent.getDefinition(); List<ContainerWrapper> wrappers = new ArrayList<ContainerWrapper>(); List<ItemPathSegment> segments = new ArrayList<ItemPathSegment>(); if (path != null) { segments.addAll(path.getSegments()); } ItemPath parentPath = new ItemPath(segments); for (ItemDefinition def : (Collection<ItemDefinition>) definition.getDefinitions()) { if (!(def instanceof PrismContainerDefinition)) { continue; } if (ObjectSpecificationType.COMPLEX_TYPE.equals(def.getTypeName())) { continue; // TEMPORARY FIX } if (TriggerType.COMPLEX_TYPE.equals(def.getTypeName())) { continue; // TEMPORARY FIX TODO: remove after getEditSchema // (authorization) will be fixed. } if (ApprovalSchemaType.COMPLEX_TYPE.equals(def.getTypeName())) { continue; } LOGGER.trace("ObjectWrapper.createContainerWrapper processing definition: {}", def); PrismContainerDefinition containerDef = (PrismContainerDefinition) def; if (!showAssignments && AssignmentType.COMPLEX_TYPE.equals(containerDef.getTypeName())) { continue; } if (!showInheritedObjectAttributes) { boolean result = INHERITED_OBJECT_SUBCONTAINERS.contains(containerDef.getName()); LOGGER.info("checking " + containerDef.getName() + ", result = " + result); if (result) { continue; } } ItemPath newPath = createPropertyPath(parentPath, containerDef.getName()); // [med] // The following code fails to work when parent is multivalued or // potentially multivalued. // Therefore (as a brutal hack), for multivalued parents we simply // skip it. if (parent.size() <= 1) { // the same check as in getValue() implementation boolean isMultiValued = parent.getDefinition() != null && !parent.getDefinition().isDynamic() && !parent.getDefinition().isSingleValue(); if (!isMultiValued) { PrismContainer prismContainer = parent.findContainer(def.getName()); ContainerWrapper container; if (prismContainer != null) { container = new ContainerWrapper( this, prismContainer, ContainerStatus.MODIFYING, newPath, pageBase); } else { prismContainer = containerDef.instantiate(); container = new ContainerWrapper( this, prismContainer, ContainerStatus.ADDING, newPath, pageBase); } addSubresult(container.getResult()); wrappers.add(container); if (!AssignmentType.COMPLEX_TYPE.equals(containerDef.getTypeName()) || !ShadowType.F_ASSOCIATION.equals(parent.getElementName())) { // do // not // show // internals // of // Assignments // (e.g. // activation) wrappers.addAll(createContainerWrapper(prismContainer, newPath, pageBase)); } } } } return wrappers; }