Skip to content

Commit

Permalink
fixing displaying association (GUI)
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Oct 13, 2014
1 parent b01dab8 commit fe81f23
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Expand Up @@ -260,7 +260,10 @@ private List<ContainerWrapper> createCustomContainerWrapper(PrismObject object,
ContainerWrapper wrapper = new ContainerWrapper(this, container, status, new ItemPath(name), pageBase);
addSubresult(wrapper.getResult());
list.add(wrapper);
// list.addAll(createContainerWrapper(container, null, pageBase));
if (!ShadowType.F_ASSOCIATION.equals(name)){
list.addAll(createContainerWrapper(container, new ItemPath(name), pageBase)); // [pm] is this OK? "name" is the name of the container itself; originally here was an empty path - that seems more logical
}

return list;
}
Expand Down Expand Up @@ -305,7 +308,10 @@ private List<ContainerWrapper> createContainers(PageBase pageBase) {

PrismContainer<ShadowAssociationType> associationContainer = object.findContainer(ShadowType.F_ASSOCIATION);
if (associationContainer != null) {
containers.addAll(createCustomContainerWrapper(object, ShadowType.F_ASSOCIATION, pageBase));
container = new ContainerWrapper(this, associationContainer, ContainerStatus.MODIFYING, new ItemPath(
ShadowType.F_ASSOCIATION), pageBase);
addSubresult(container.getResult());
containers.add(container);
}
} else if (ResourceType.class.isAssignableFrom(clazz)) {
containers = createResourceContainers(pageBase);
Expand Down Expand Up @@ -406,6 +412,7 @@ private List<ContainerWrapper> createContainerWrapper(PrismContainer parent, Ite
if (TriggerType.COMPLEX_TYPE.equals(def.getTypeName())) {
continue; // TEMPORARY FIX TODO: remove after getEditSchema (authorization) will be fixed.
}

LOGGER.trace("ObjectWrapper.createContainerWrapper processing definition: {}", def);

PrismContainerDefinition containerDef = (PrismContainerDefinition) def;
Expand All @@ -421,8 +428,11 @@ private List<ContainerWrapper> createContainerWrapper(PrismContainer parent, Ite
}

ItemPath newPath = createPropertyPath(parentPath, containerDef.getName());
PrismContainer prismContainer = parent.findContainer(def.getName());
ContainerWrapper container;

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 {
Expand All @@ -432,7 +442,7 @@ private List<ContainerWrapper> createContainerWrapper(PrismContainer parent, Ite
addSubresult(container.getResult());
wrappers.add(container);

if (!AssignmentType.COMPLEX_TYPE.equals(containerDef.getTypeName())) { // do not show internals of Assignments (e.g. activation)
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
Expand Up @@ -1270,7 +1270,6 @@ private void forceRenameIfNeeded(ShadowType currentShadowType, ShadowType oldSha
if (oldSecondaryIdentifiers.isEmpty()){
return;
}
LOGGER.info("force rename if needed");
ResourceAttributeContainer newSecondaryIdentifiers = ShadowUtil.getAttributesContainer(currentShadowType);

//remember name before normalizing attributes
Expand Down
Expand Up @@ -97,7 +97,6 @@ private ParsedQuery parse(ObjectQuery objectQuery) {
return null;
}

LOGGER.info("create shadow disjunction parse");
AndFilter andFilter = (AndFilter) objectQuery.getFilter();

RefFilter refFilter = null;
Expand Down Expand Up @@ -201,7 +200,6 @@ public RQuery createQuery(ObjectQuery objectQuery, Class<? extends ObjectType> t
cMain.setProjection(projections);

cMain.setResultTransformer(GetObjectResult.RESULT_TRANSFORMER);
LOGGER.info("Criteria: {}", cMain);
return new RQueryCriteriaImpl(cMain);
}

Expand Down

0 comments on commit fe81f23

Please sign in to comment.