use of org.olat.core.util.vfs.callbacks.DefaultVFSSecurityCallback in project openolat by klemens.
the class DocumentPoolWebDAVMergeSource method loadRecursiveMergedContainers.
private VFSContainer loadRecursiveMergedContainers(Taxonomy taxonomy, INode node) {
VFSContainer container = null;
if (node instanceof TaxonomyTreeNode) {
TaxonomyTreeNode taxonomyNode = (TaxonomyTreeNode) node;
String name = RequestUtil.normalizeFilename(taxonomyNode.getTitle());
VirtualContainer levelContainer = new VirtualContainer(name);
levelContainer.setLocalSecurityCallback(new DefaultVFSSecurityCallback());
boolean hasDocuments = false;
if (taxonomyNode.getType() == TaxonomyTreeNodeType.templates) {
// the templates
return addTemplates(taxonomyNode, taxonomy);
} else if (taxonomyNode.getTaxonomyLevel() != null && taxonomyNode.isDocumentsLibraryEnabled() && taxonomyNode.isCanRead()) {
// the real thing
levelContainer.addItem(addDocument(taxonomyNode));
hasDocuments = true;
}
for (int i = 0; i < node.getChildCount(); i++) {
VFSContainer childContainer = loadRecursiveMergedContainers(taxonomy, node.getChildAt(i));
if (childContainer != null) {
levelContainer.addItem(childContainer);
hasDocuments = true;
}
}
container = hasDocuments ? levelContainer : null;
}
return container;
}
use of org.olat.core.util.vfs.callbacks.DefaultVFSSecurityCallback in project OpenOLAT by OpenOLAT.
the class DocumentPoolWebDAVMergeSource method loadRecursiveMergedContainers.
private VFSContainer loadRecursiveMergedContainers(Taxonomy taxonomy, INode node) {
VFSContainer container = null;
if (node instanceof TaxonomyTreeNode) {
TaxonomyTreeNode taxonomyNode = (TaxonomyTreeNode) node;
String name = RequestUtil.normalizeFilename(taxonomyNode.getTitle());
VirtualContainer levelContainer = new VirtualContainer(name);
levelContainer.setLocalSecurityCallback(new DefaultVFSSecurityCallback());
boolean hasDocuments = false;
if (taxonomyNode.getType() == TaxonomyTreeNodeType.templates) {
// the templates
return addTemplates(taxonomyNode, taxonomy);
} else if (taxonomyNode.getTaxonomyLevel() != null && taxonomyNode.isDocumentsLibraryEnabled() && taxonomyNode.isCanRead()) {
// the real thing
levelContainer.addItem(addDocument(taxonomyNode));
hasDocuments = true;
}
for (int i = 0; i < node.getChildCount(); i++) {
VFSContainer childContainer = loadRecursiveMergedContainers(taxonomy, node.getChildAt(i));
if (childContainer != null) {
levelContainer.addItem(childContainer);
hasDocuments = true;
}
}
container = hasDocuments ? levelContainer : null;
}
return container;
}
Aggregations