use of org.alfresco.repo.node.db.traitextender.NodeServiceTrait in project alfresco-repository by Alfresco.
the class VirtualNodeServiceExtension method getChildAssocs.
@Override
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern, int maxResults, boolean preload) {
NodeServiceTrait theTrait = getTrait();
boolean canVirtualize = canVirtualizeAssocNodeRef(nodeRef);
if (canVirtualize) {
Reference reference = smartStore.virtualize(nodeRef);
List<ChildAssociationRef> virtualAssociations = smartStore.getChildAssocs(reference, typeQNamePattern, qnamePattern, maxResults, preload);
List<ChildAssociationRef> associations = new LinkedList<>(virtualAssociations);
if (associations.size() < maxResults) {
if (smartStore.canMaterialize(reference)) {
NodeRef materialReference = smartStore.materialize(reference);
List<ChildAssociationRef> actualAssociations = theTrait.getChildAssocs(materialReference, typeQNamePattern, qnamePattern, maxResults - associations.size(), preload);
associations.addAll(actualAssociations);
}
}
return associations;
} else {
return theTrait.getChildAssocs(nodeRef, typeQNamePattern, qnamePattern, maxResults, preload);
}
}
use of org.alfresco.repo.node.db.traitextender.NodeServiceTrait in project alfresco-repository by Alfresco.
the class VirtualNodeServiceExtension method getChildAssocs.
@Override
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern) {
NodeServiceTrait theTrait = getTrait();
boolean canVirtualize = canVirtualizeAssocNodeRef(nodeRef);
if (canVirtualize) {
Reference reference = smartStore.virtualize(nodeRef);
List<ChildAssociationRef> virtualAssociations = smartStore.getChildAssocs(reference, typeQNamePattern, qnamePattern, Integer.MAX_VALUE, false);
List<ChildAssociationRef> associations = new LinkedList<>(virtualAssociations);
if (smartStore.canMaterialize(reference)) {
NodeRef materialReference = smartStore.materialize(reference);
List<ChildAssociationRef> actualAssociations = theTrait.getChildAssocs(materialReference, typeQNamePattern, qnamePattern);
associations.addAll(actualAssociations);
}
return associations;
} else {
return theTrait.getChildAssocs(nodeRef, typeQNamePattern, qnamePattern);
}
}
Aggregations