use of org.alfresco.rest.api.model.Assoc in project alfresco-remote-api by Alfresco.
the class AbstractNodeRelation method listNodePeerAssocs.
protected CollectionWithPagingInfo<Node> listNodePeerAssocs(List<AssociationRef> assocRefs, Parameters parameters, boolean returnTarget) {
Map<QName, String> qnameMap = new HashMap<>(3);
Map<String, UserInfo> mapUserInfo = new HashMap<>(10);
List<String> includeParam = parameters.getInclude();
List<Node> collection = new ArrayList<Node>(assocRefs.size());
for (AssociationRef assocRef : assocRefs) {
// minimal info by default (unless "include"d otherwise)
NodeRef nodeRef = (returnTarget ? assocRef.getTargetRef() : assocRef.getSourceRef());
Node node = nodes.getFolderOrDocument(nodeRef, null, null, includeParam, mapUserInfo);
QName assocTypeQName = assocRef.getTypeQName();
if (!EXCLUDED_NS.contains(assocTypeQName.getNamespaceURI())) {
String assocType = qnameMap.get(assocTypeQName);
if (assocType == null) {
assocType = assocTypeQName.toPrefixString(namespaceService);
qnameMap.put(assocTypeQName, assocType);
}
node.setAssociation(new Assoc(assocType));
collection.add(node);
}
}
return listPage(collection, parameters.getPaging());
}
Aggregations