mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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/HEAD/root@127587 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -280,7 +280,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
|
||||
@@ -899,7 +899,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)
|
||||
@@ -913,11 +915,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));
|
||||
|
Reference in New Issue
Block a user