Search in sources :

Example 96 with GenericTreeNode

use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.

the class TaxonomyAllTreesBuilder method loadTreeModel.

public void loadTreeModel(GenericTreeModel taxonomyTreesModel, Taxonomy taxonomy) {
    Map<Taxonomy, GenericTreeNode> rootNodesMap = new HashMap<>();
    GenericTreeNode rootNode = new GenericTreeNode("taxonomy-" + taxonomy.getKey());
    rootNode.setTitle(taxonomy.getDisplayName());
    rootNode.setIconCssClass("o_icon_taxonomy");
    rootNode.setUserObject(taxonomy);
    taxonomyTreesModel.setRootNode(rootNode);
    rootNodesMap.put(taxonomy, rootNode);
    loadTreeModel(rootNodesMap, taxonomy);
}
Also used : Taxonomy(org.olat.modules.taxonomy.Taxonomy) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) HashMap(java.util.HashMap)

Example 97 with GenericTreeNode

use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.

the class WikiMainController method updateWikiMenu.

private void updateWikiMenu(Wiki wiki) {
    Collection<String> links = wiki.getListOfAllPageNames();
    if (wikiMenuNode != null) {
        wikiMenuNode.removeAllChildren();
        for (String link : links) {
            String ident = "w" + Encoder.md5hash(link);
            GenericTreeNode menuItemNode = new GenericTreeNode(ident, link, link);
            wikiMenuNode.addChild(menuItemNode);
        }
    }
    wikiMenuDropdown.removeAllComponents();
    for (String link : links) {
        Link menuLink = LinkFactory.createToolLink(link, "select-page", link, this);
        wikiMenuDropdown.addComponent(menuLink);
    }
    if (editMenuButton != null) {
        wikiMenuDropdown.addComponent(new Spacer("wiki-spacer"));
        wikiMenuDropdown.addComponent(editMenuButton);
    }
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) Spacer(org.olat.core.gui.components.dropdown.Dropdown.Spacer) Link(org.olat.core.gui.components.link.Link)

Example 98 with GenericTreeNode

use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.

the class QuestionPoolMenuTreeModel method buildFinalSubTreeModel.

public void buildFinalSubTreeModel(TreeNode rootNode) {
    if (!securityCallback.canUseReviewProcess())
        return;
    qpoolTaxonomyTreeBuilder.loadTaxonomyLevelsFinal(identity);
    List<TaxonomyLevel> taxonomyLevels = qpoolTaxonomyTreeBuilder.getTreeTaxonomyLevels();
    if (!taxonomyLevels.isEmpty()) {
        finalNode = new GenericTreeNode(translator.translate("menu.final"));
        finalNode.setTitle(translator.translate("menu.final"));
        rootNode.addChild(finalNode);
        for (TaxonomyLevel taxonomyLevel : taxonomyLevels) {
            TreeNode node = new FinalTreeNode(stackPanel, securityCallback, taxonomyLevel);
            finalNode.addChild(node);
        }
        setFirstChildAsDelegate(finalNode);
    }
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel)

Example 99 with GenericTreeNode

use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.

the class QuestionPoolMenuTreeModel method buildTreeModel.

private void buildTreeModel() {
    TreeNode rootNode = new GenericTreeNode(translator.translate("topnav.qpool"));
    setRootNode(rootNode);
    // question database
    myNode = new PresentationTreeNode(translator.translate("menu.database"));
    rootNode.addChild(myNode);
    buildMySubTreeModel();
    // review process
    buildReviewSubTreeModel(rootNode);
    buildFinalSubTreeModel(rootNode);
    // pools + shares
    if (securityCallback.canUsePools() || securityCallback.canUseGroups()) {
        sharesNode = new SharesTreeNode(translator.translate("menu.share"));
        rootNode.addChild(sharesNode);
        buildShareSubTreeModel();
        setFirstChildAsDelegate(sharesNode);
    }
    buildPredifinedQueriesNode(rootNode);
    // administration
    TreeNode adminNode = new AdministrationTreeNode(translator.translate("menu.admin"));
    rootNode.addChild(adminNode);
    buildAdminSubTreeModel(adminNode);
    if (adminNode.getChildCount() > 0) {
        setFirstChildAsDelegate(adminNode);
    } else {
        // Admin tree node should not be visible if user has no particular admin rights.
        rootNode.remove(adminNode);
    }
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode)

Example 100 with GenericTreeNode

use of org.olat.core.gui.components.tree.GenericTreeNode in project openolat by klemens.

the class QuestionPoolMenuTreeModel method buildPredifinedQueriesNode.

private void buildPredifinedQueriesNode(TreeNode rootNode) {
    if (!securityCallback.canEditAllQuestions())
        return;
    GenericTreeNode queriesNode = new GenericTreeNode(translator.translate("menu.queries"));
    queriesNode.setTitle(translator.translate("menu.queries"));
    rootNode.addChild(queriesNode);
    TreeNode node = new AllQuestionsTreeNode(stackPanel, securityCallback, translator.translate("menu.queries.all"));
    queriesNode.addChild(node);
    node = new WithoutTaxonomyLevelTreeNode(stackPanel, securityCallback, translator.translate("menu.queries.without.taxonomy.level"));
    queriesNode.addChild(node);
    node = new WithoutAuthorTreeNode(stackPanel, securityCallback, translator.translate("menu.queries.without.author"));
    queriesNode.addChild(node);
    setFirstChildAsDelegate(queriesNode);
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode)

Aggregations

GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)124 TreeNode (org.olat.core.gui.components.tree.TreeNode)30 GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)24 CourseNode (org.olat.course.nodes.CourseNode)10 TaxonomyLevel (org.olat.modules.taxonomy.TaxonomyLevel)10 AssessmentSection (uk.ac.ed.ph.jqtiplus.node.test.AssessmentSection)10 HashMap (java.util.HashMap)8 INode (org.olat.core.util.nodes.INode)8 ArrayList (java.util.ArrayList)6 Element (org.dom4j.Element)6 XPath (org.dom4j.XPath)6 ExtManager (org.olat.core.extensions.ExtManager)6 Extension (org.olat.core.extensions.Extension)6 CatalogEntry (org.olat.repository.CatalogEntry)6 ActionExtension (org.olat.core.extensions.action.ActionExtension)4 GenericActionExtension (org.olat.core.extensions.action.GenericActionExtension)4 CourseNodeConfiguration (org.olat.course.nodes.CourseNodeConfiguration)4 QTI21QuestionType (org.olat.ims.qti21.model.QTI21QuestionType)4 Taxonomy (org.olat.modules.taxonomy.Taxonomy)4 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)4