use of org.alfresco.repo.virtual.ref.GetChildByIdMethod in project alfresco-repository by Alfresco.
the class VirtualStoreImpl method createChildReferences.
private List<Reference> createChildReferences(Reference parent, VirtualFolderDefinition structure) throws ProtocolMethodException {
List<VirtualFolderDefinition> structureChildren = structure.getChildren();
List<Reference> childReferences = new LinkedList<Reference>();
for (VirtualFolderDefinition child : structureChildren) {
childReferences.add(parent.execute(new GetChildByIdMethod(child.getId())));
}
return childReferences;
}
use of org.alfresco.repo.virtual.ref.GetChildByIdMethod in project alfresco-repository by Alfresco.
the class VirtualStoreImpl method getChildByName.
@Override
public Reference getChildByName(Reference reference, QName assocTypeQName, String childName) throws VirtualizationException {
VirtualFolderDefinition structure = resolveVirtualFolderDefinition(reference);
VirtualFolderDefinition theChild = structure.findChildByName(childName);
if (theChild != null) {
return reference.execute(new GetChildByIdMethod(theChild.getId()));
} else {
final VirtualQuery query = structure.getQuery();
if (query != null) {
PropertyValueConstraint constraint = new PropertyValueConstraint(new FilesFoldersConstraint(BasicConstraint.INSTANCE, true, true), ContentModel.PROP_NAME, childName, environment.getNamespacePrefixResolver());
PagingResults<Reference> result = query.perform(environment, constraint, null, reference);
List<Reference> page = result.getPage();
return page == null || page.isEmpty() ? null : page.get(0);
} else {
return null;
}
}
}
Aggregations