Skip to content

Commit

Permalink
Fixed missing extension container in org editor
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Feb 13, 2015
1 parent 8bc1ad1 commit 0618f95
Showing 1 changed file with 19 additions and 15 deletions.
Expand Up @@ -430,25 +430,29 @@ private List<ContainerWrapper> createContainerWrapper(PrismContainer parent, Ite
ItemPath newPath = createPropertyPath(parentPath, containerDef.getName());

// [med]
// The following code fails to work when parent is multivalued.
// 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) {
PrismContainer prismContainer = null;
prismContainer = parent.findContainer(def.getName());

ContainerWrapper container;
if (prismContainer != null && !prismContainer.getElementName().equals(CredentialsType.F_PASSWORD)) {
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));
// 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 && !prismContainer.getElementName().equals(CredentialsType.F_PASSWORD)) {
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));
}
}
}
}
Expand Down

0 comments on commit 0618f95

Please sign in to comment.