Search in sources :

Example 6 with TaxonomyTreeBuilder

use of org.olat.modules.taxonomy.manager.TaxonomyTreeBuilder in project openolat by klemens.

the class DocumentPoolWebDAVMergeSource method loadMergedContainers.

@Override
protected List<VFSContainer> loadMergedContainers() {
    List<VFSContainer> containers = new ArrayList<>();
    String taxonomyTreeKey = docPoolModule.getTaxonomyTreeKey();
    if (StringHelper.isLong(taxonomyTreeKey)) {
        Taxonomy taxonomy = taxonomyService.getTaxonomy(new TaxonomyRefImpl(new Long(taxonomyTreeKey)));
        if (taxonomy != null) {
            String templatesDir = Util.createPackageTranslator(DocumentPoolMainController.class, identityEnv.getLocale()).translate("document.pool.templates");
            TaxonomyTreeBuilder builder = new TaxonomyTreeBuilder(taxonomy, identityEnv.getIdentity(), null, identityEnv.getRoles().isOLATAdmin(), docPoolModule.isTemplatesDirectoryEnabled(), templatesDir, null);
            TreeModel model = builder.buildTreeModel();
            TreeNode rootNode = model.getRootNode();
            for (int i = 0; i < rootNode.getChildCount(); i++) {
                VFSContainer container = loadRecursiveMergedContainers(taxonomy, rootNode.getChildAt(i));
                if (container != null) {
                    containers.add(container);
                }
            }
        }
    }
    return containers;
}
Also used : TreeModel(org.olat.core.gui.components.tree.TreeModel) TaxonomyRefImpl(org.olat.modules.taxonomy.model.TaxonomyRefImpl) Taxonomy(org.olat.modules.taxonomy.Taxonomy) TreeNode(org.olat.core.gui.components.tree.TreeNode) TaxonomyTreeNode(org.olat.modules.taxonomy.model.TaxonomyTreeNode) VFSContainer(org.olat.core.util.vfs.VFSContainer) ArrayList(java.util.ArrayList) DocumentPoolMainController(org.olat.modules.docpool.ui.DocumentPoolMainController) TaxonomyTreeBuilder(org.olat.modules.taxonomy.manager.TaxonomyTreeBuilder)

Aggregations

TreeModel (org.olat.core.gui.components.tree.TreeModel)6 TaxonomyTreeBuilder (org.olat.modules.taxonomy.manager.TaxonomyTreeBuilder)6 TaxonomyTreeNode (org.olat.modules.taxonomy.model.TaxonomyTreeNode)6 ArrayList (java.util.ArrayList)4 TreeNode (org.olat.core.gui.components.tree.TreeNode)4 VFSContainer (org.olat.core.util.vfs.VFSContainer)4 DocumentPoolMainController (org.olat.modules.docpool.ui.DocumentPoolMainController)4 Taxonomy (org.olat.modules.taxonomy.Taxonomy)4 TaxonomyRefImpl (org.olat.modules.taxonomy.model.TaxonomyRefImpl)3 Date (java.util.Date)2 List (java.util.List)2 Locale (java.util.Locale)2 BaseSecurity (org.olat.basesecurity.BaseSecurity)2 FileInfo (org.olat.core.commons.modules.bc.FileInfo)2 FolderManager (org.olat.core.commons.modules.bc.FolderManager)2 MetaInfo (org.olat.core.commons.modules.bc.meta.MetaInfo)2 NotificationHelper (org.olat.core.commons.services.notifications.NotificationHelper)2 NotificationsHandler (org.olat.core.commons.services.notifications.NotificationsHandler)2 NotificationsManager (org.olat.core.commons.services.notifications.NotificationsManager)2 Publisher (org.olat.core.commons.services.notifications.Publisher)2