Search in sources :

Example 1 with DefaultVFSSecurityCallback

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;
}
Also used : DefaultVFSSecurityCallback(org.olat.core.util.vfs.callbacks.DefaultVFSSecurityCallback) VFSContainer(org.olat.core.util.vfs.VFSContainer) TaxonomyTreeNode(org.olat.modules.taxonomy.model.TaxonomyTreeNode) VirtualContainer(org.olat.core.util.vfs.VirtualContainer)

Example 2 with DefaultVFSSecurityCallback

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;
}
Also used : DefaultVFSSecurityCallback(org.olat.core.util.vfs.callbacks.DefaultVFSSecurityCallback) VFSContainer(org.olat.core.util.vfs.VFSContainer) TaxonomyTreeNode(org.olat.modules.taxonomy.model.TaxonomyTreeNode) VirtualContainer(org.olat.core.util.vfs.VirtualContainer)

Aggregations

VFSContainer (org.olat.core.util.vfs.VFSContainer)2 VirtualContainer (org.olat.core.util.vfs.VirtualContainer)2 DefaultVFSSecurityCallback (org.olat.core.util.vfs.callbacks.DefaultVFSSecurityCallback)2 TaxonomyTreeNode (org.olat.modules.taxonomy.model.TaxonomyTreeNode)2