Search in sources :

Example 51 with GenericTreeNode

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

the class QTIStatisticResourceResult method buildQTICourseNodeSubTree.

private void buildQTICourseNodeSubTree(QTIDocument qtiDoc, GenericTreeNode rootNode) {
    for (Section section : qtiDoc.getAssessment().getSections()) {
        GenericTreeNode sectionNode = new SectionNode(section, null);
        sectionNode.setUserObject(section);
        rootNode.addChild(sectionNode);
        for (Item item : section.getItems()) {
            GenericTreeNode itemNode = new ItemNode(item);
            itemNode.setIdent(Long.toString(CodeHelper.getForeverUniqueID()));
            if (sectionNode.getDelegate() == null) {
                sectionNode.setDelegate(itemNode);
            }
            itemNode.setUserObject(item);
            sectionNode.addChild(itemNode);
        }
    }
}
Also used : Item(org.olat.ims.qti.editor.beecom.objects.Item) ItemNode(org.olat.ims.qti.editor.tree.ItemNode) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) Section(org.olat.ims.qti.editor.beecom.objects.Section) SectionNode(org.olat.ims.qti.editor.tree.SectionNode)

Example 52 with GenericTreeNode

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

the class NavigationHandler method copyIdent.

private void copyIdent(TreeNode guiNode, TreeNode originalNode) {
    if (guiNode instanceof GenericTreeNode) {
        ((GenericTreeNode) guiNode).setIdent(originalNode.getIdent());
    }
    for (int i = originalNode.getChildCount(); i-- > 0; ) {
        INode originalChild = originalNode.getChildAt(i);
        INode guiChild = guiNode.getChildAt(i);
        copyIdent((TreeNode) guiChild, (TreeNode) originalChild);
    }
}
Also used : INode(org.olat.core.util.nodes.INode) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode)

Example 53 with GenericTreeNode

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

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 54 with GenericTreeNode

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

the class QuestionPoolMenuTreeModel method buildReviewSubTreeModel.

public void buildReviewSubTreeModel(TreeNode rootNode) {
    if (!securityCallback.canUseReviewProcess())
        return;
    qpoolTaxonomyTreeBuilder.loadTaxonomyLevelsReview(identity);
    List<TaxonomyLevel> taxonomyLevels = qpoolTaxonomyTreeBuilder.getTreeTaxonomyLevels();
    if (!taxonomyLevels.isEmpty()) {
        reviewNode = new GenericTreeNode(translator.translate("menu.review"));
        reviewNode.setTitle(translator.translate("menu.review"));
        rootNode.addChild(reviewNode);
        for (TaxonomyLevel taxonomyLevel : taxonomyLevels) {
            TreeNode node = new ReviewTreeNode(stackPanel, securityCallback, taxonomyLevel, identity, roles);
            reviewNode.addChild(node);
        }
        setFirstChildAsDelegate(reviewNode);
    }
}
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 55 with GenericTreeNode

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

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