Search in sources :

Example 6 with GenericTreeNode

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

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

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

the class MembersManagementMainController method buildTreeModel.

private GenericTreeModel buildTreeModel() {
    GenericTreeModel gtm = new GenericTreeModel();
    GenericTreeNode root = new GenericTreeNode();
    root.setTitle(translate("menu.members"));
    root.setAltText(translate("menu.members.alt"));
    gtm.setRootNode(root);
    if (entryAdmin || memberManagementRight) {
        GenericTreeNode node = new GenericTreeNode(translate("menu.members"), CMD_MEMBERS);
        node.setAltText(translate("menu.members.alt"));
        node.setCssClass("o_sel_membersmgt_members");
        root.addChild(node);
    }
    if (entryAdmin || memberManagementRight || groupManagementRight) {
        GenericTreeNode node = new GenericTreeNode(translate("menu.groups"), CMD_GROUPS);
        node.setAltText(translate("menu.groups.alt"));
        node.setCssClass("o_sel_membersmgt_groups");
        root.addChild(node);
    }
    if (acModule.isEnabled() && (entryAdmin || memberManagementRight)) {
        // check if the course is managed and/or has offers
        if (!RepositoryEntryManagedFlag.isManaged(repoEntry, RepositoryEntryManagedFlag.bookings) || acService.isResourceAccessControled(repoEntry.getOlatResource(), null)) {
            GenericTreeNode node = new GenericTreeNode(translate("menu.orders"), CMD_BOOKING);
            node.setAltText(translate("menu.orders.alt"));
            node.setCssClass("o_sel_membersmgt_orders");
            root.addChild(node);
        }
    }
    if (entryAdmin) {
        GenericTreeNode node = new GenericTreeNode(translate("menu.rights"), CMD_RIGHTS);
        node.setAltText(translate("menu.rights.alt"));
        node.setCssClass("o_sel_membersmgt_rights");
        root.addChild(node);
    }
    return gtm;
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel)

Example 8 with GenericTreeNode

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

the class CPTreeDataModel method addItem.

private void addItem(List<TreeNode> nodeList, CPItem item) throws JSONException {
    String nId = putIdentifierForNodeID(item.getIdentifier());
    GenericTreeNode child = new GenericTreeNode(nId, item.getTitle(), item);
    child.setIconCssClass("o_cp_item");
    nodeList.add(child);
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode)

Example 9 with GenericTreeNode

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

the class WikiMainController method getAndUseExternalTree.

public GenericTreeModel getAndUseExternalTree() {
    final String resId = ores.getResourceableId().toString();
    Wiki wiki = getWiki();
    wikiMenuModel = new GenericTreeModel();
    String root = "wiki-" + resId;
    GenericTreeNode rootNode = new GenericTreeNode(root);
    wikiMenuModel.setRootNode(rootNode);
    // Index
    String navMainItem = "nav-main-item-" + resId;
    navMainPageNode = new GenericTreeNode(navMainItem, translate("navigation.mainpage"), navMainItem);
    rootNode.addChild(navMainPageNode);
    // Wiki-Menu
    String wikiMenuTitle = translate("navigation.menu");
    String wikiMenuItem = "menu-item-" + resId;
    wikiMenuNode = new GenericTreeNode(wikiMenuItem, wikiMenuTitle, wikiMenuItem);
    rootNode.addChild(wikiMenuNode);
    String navAZItem = "nav-az-item-" + resId;
    navAZNode = new GenericTreeNode(navAZItem, translate("navigation.a-z"), navAZItem);
    rootNode.addChild(navAZNode);
    String navChangesItem = "nav-changes-item-" + resId;
    navChangesNode = new GenericTreeNode(navChangesItem, translate("navigation.changes"), navChangesItem);
    rootNode.addChild(navChangesNode);
    updateWikiMenu(wiki);
    navigationDropdown.setVisible(false);
    wikiMenuDropdown.setVisible(false);
    navigationContent.contextPut("navigationEnabled", Boolean.FALSE);
    return wikiMenuModel;
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel)

Example 10 with GenericTreeNode

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

the class QTI21StatisticResourceResult method buildRecursively.

private TreeNode buildRecursively(AssessmentItemRef itemRef, TreeNode parentNode) {
    GenericTreeNode itemNode = new GenericTreeNode();
    ResolvedAssessmentItem resolvedAssessmentItem = resolvedAssessmentTest.getResolvedAssessmentItem(itemRef);
    BadResourceException ex = resolvedAssessmentItem.getItemLookup().getBadResourceException();
    if (ex == null) {
        AssessmentItem assessmentItem = resolvedAssessmentItem.getItemLookup().getRootNodeHolder().getRootNode();
        itemNode.setTitle(assessmentItem.getTitle());
        QTI21QuestionType type = QTI21QuestionType.getTypeRelax(assessmentItem);
        if (type != null) {
            itemNode.setIconCssClass("o_icon ".concat(type.getCssClass()));
        } else {
            itemNode.setIconCssClass("o_icon o_mi_qtiunkown");
        }
        itemNode.setUserObject(itemRef);
        parentNode.addChild(itemNode);
    }
    return itemNode;
}
Also used : BadResourceException(uk.ac.ed.ph.jqtiplus.provision.BadResourceException) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) ResolvedAssessmentItem(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem) QTI21QuestionType(org.olat.ims.qti21.model.QTI21QuestionType) ResolvedAssessmentItem(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem) AssessmentItem(uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)

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