Merged HEAD (5.2) to 5.2.N (5.2.1)

127587 jkaabimofrad: Merged API-STRIKES-BACK (5.2.0) to HEAD (5.2)
      127040 jvonka: Node Associations - child & peer
      - exclude "sys" namespace
      - common code for listing
      - RA-745, 920, RA-921, RA-930, RA-742, RA-918, RA-919


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@127679 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-06-03 14:15:20 +00:00
parent 67494ff093
commit 8ccacdd032
6 changed files with 123 additions and 191 deletions

View File

@@ -287,7 +287,7 @@ public class NodesImpl implements Nodes
this.poster = poster;
}
// excluded namespaces (aspects and properties)
// excluded namespaces (aspects, properties, assoc types)
private static final List<String> EXCLUDED_NS = Arrays.asList(NamespaceService.SYSTEM_MODEL_1_0_URI);
// excluded aspects
@@ -906,7 +906,9 @@ public class NodesImpl implements Nodes
{
// Ugh ... can we optimise this and return the actual assoc directly (via FileFolderService/GetChildrenCQ) ?
ChildAssociationRef parentAssocRef = nodeService.getPrimaryParent(nodeRef);
if (! parentAssocRef.getParentRef().equals(parentNodeRef))
// note: parentAssocRef.parentRef can be null for -root- node !
if ((parentAssocRef == null) || (parentAssocRef.getParentRef() == null) || (! parentAssocRef.getParentRef().equals(parentNodeRef)))
{
List<ChildAssociationRef> parentAssocRefs = nodeService.getParentAssocs(nodeRef);
for (ChildAssociationRef pAssocRef : parentAssocRefs)
@@ -920,11 +922,18 @@ public class NodesImpl implements Nodes
}
}
AssocChild childAssoc = new AssocChild(
parentAssocRef.getTypeQName().toPrefixString(namespaceService),
parentAssocRef.isPrimary());
if (parentAssocRef != null)
{
QName assocTypeQName = parentAssocRef.getTypeQName();
if ((assocTypeQName != null) && (! EXCLUDED_NS.contains(assocTypeQName.getNamespaceURI())))
{
AssocChild childAssoc = new AssocChild(
assocTypeQName.toPrefixString(namespaceService),
parentAssocRef.isPrimary());
node.setAssociation(childAssoc);
node.setAssociation(childAssoc);
}
}
}
node.setNodeType(nodeTypeQName.toPrefixString(namespaceService));