Search in sources :

Example 86 with TaxonomyLevel

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

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 87 with TaxonomyLevel

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

the class QuestionPoolMenuTreeModel method buildMyTaxonomyNodes.

private void buildMyTaxonomyNodes(TreeNode parentNode) {
    if (!securityCallback.canUseReviewProcess())
        return;
    qpoolTaxonomyTreeBuilder.loadTaxonomyLevelsMy(identity);
    List<TaxonomyLevel> taxonomyLevels = qpoolTaxonomyTreeBuilder.getTreeTaxonomyLevels();
    for (TaxonomyLevel taxonomyLevel : taxonomyLevels) {
        TreeNode node = new MyTaxonomyLevelTreeNode(stackPanel, securityCallback, taxonomyLevel);
        parentNode.addChild(node);
    }
}
Also used : GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel)

Example 88 with TaxonomyLevel

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

the class GeneralMetadataEditController method setTaxonomicPath.

private void setTaxonomicPath() {
    String selectedKey = taxonomyLevelEl.isOneSelected() ? taxonomyLevelEl.getSelectedKey() : null;
    TaxonomyLevel taxonomyLevel = qpoolTaxonomyTreeBuilder.getTaxonomyLevel(selectedKey);
    String taxonomicPath = "";
    if (taxonomyLevel != null) {
        taxonomicPath = taxonomyLevel.getMaterializedPathIdentifiers();
    }
    taxonomyLevelEl.setExampleKey("general.taxonomy.path", new String[] { taxonomicPath });
}
Also used : TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel)

Example 89 with TaxonomyLevel

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

the class GeneralMetadataEditController method buildTaxonomyLevelEl.

private void buildTaxonomyLevelEl() {
    qpoolTaxonomyTreeBuilder.loadTaxonomyLevelsSelection(getIdentity(), securityCallback.canRemoveTaxonomy(), ignoreCompetences);
    String[] selectableKeys = qpoolTaxonomyTreeBuilder.getSelectableKeys();
    String[] selectableValues = qpoolTaxonomyTreeBuilder.getSelectableValues();
    taxonomyLevelEl.setKeysAndValues(selectableKeys, selectableValues, null);
    if (item instanceof QuestionItemImpl) {
        QuestionItemImpl itemImpl = (QuestionItemImpl) item;
        TaxonomyLevel selectedTaxonomyLevel = itemImpl.getTaxonomyLevel();
        if (selectedTaxonomyLevel != null) {
            String selectedTaxonomyLevelKey = String.valueOf(selectedTaxonomyLevel.getKey());
            for (String taxonomyKey : qpoolTaxonomyTreeBuilder.getSelectableKeys()) {
                if (taxonomyKey.equals(selectedTaxonomyLevelKey)) {
                    taxonomyLevelEl.select(taxonomyKey, true);
                }
            }
            if (!taxonomyLevelEl.isOneSelected() && itemImpl.getTaxonomyLevel() != null) {
                if (selectableKeys.length == 0) {
                    selectableKeys = new String[] { "dummy" };
                    selectableValues = new String[1];
                }
                selectableValues[0] = itemImpl.getTaxonomyLevel().getDisplayName();
                taxonomyLevelEl.setEnabled(false);
            }
        }
    }
    taxonomyLevelEl.addActionListener(FormEvent.ONCHANGE);
    setTaxonomicPath();
}
Also used : QuestionItemImpl(org.olat.modules.qpool.model.QuestionItemImpl) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel)

Example 90 with TaxonomyLevel

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

the class IdentityCompetencesController method doAddTaxonomyLevelsAsCompetence.

private void doAddTaxonomyLevelsAsCompetence(TaxonomyLevel selectedLevel, TaxonomyCompetenceTypes competenceType) {
    if (selectedLevel == null) {
        showWarning("warning.atleastone.level.competence");
    } else {
        boolean found = false;
        List<TaxonomyCompetence> currentCompetences = taxonomyService.getTaxonomyCompetences(assessedIdentity, competenceType);
        for (TaxonomyCompetence currentCompetence : currentCompetences) {
            if (selectedLevel.equals(currentCompetence.getTaxonomyLevel())) {
                found = true;
            }
        }
        if (!found) {
            TaxonomyLevel taxonomyLevel = taxonomyService.getTaxonomyLevel(selectedLevel);
            Taxonomy taxonomy = taxonomyLevel.getTaxonomy();
            TaxonomyCompetence competence = taxonomyService.addTaxonomyLevelCompetences(taxonomyLevel, assessedIdentity, competenceType, null);
            String after = taxonomyService.toAuditXml(competence);
            taxonomyService.auditLog(TaxonomyCompetenceAuditLog.Action.addCompetence, null, after, null, taxonomy, competence, assessedIdentity, getIdentity());
        }
        loadModel();
        tableEl.reset(true, true, true);
    }
}
Also used : Taxonomy(org.olat.modules.taxonomy.Taxonomy) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel) TaxonomyCompetence(org.olat.modules.taxonomy.TaxonomyCompetence)

Aggregations

TaxonomyLevel (org.olat.modules.taxonomy.TaxonomyLevel)238 Taxonomy (org.olat.modules.taxonomy.Taxonomy)122 Test (org.junit.Test)106 Identity (org.olat.core.id.Identity)58 ArrayList (java.util.ArrayList)40 TaxonomyCompetence (org.olat.modules.taxonomy.TaxonomyCompetence)40 TaxonomyLevelType (org.olat.modules.taxonomy.TaxonomyLevelType)34 Date (java.util.Date)24 TaxonomyLevelRefImpl (org.olat.modules.taxonomy.model.TaxonomyLevelRefImpl)24 URI (java.net.URI)22 HttpResponse (org.apache.http.HttpResponse)22 TreeNode (org.olat.core.gui.components.tree.TreeNode)22 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)18 QuestionItemImpl (org.olat.modules.qpool.model.QuestionItemImpl)16 HashMap (java.util.HashMap)14 List (java.util.List)14 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)12 TaxonomyCompetenceTypes (org.olat.modules.taxonomy.TaxonomyCompetenceTypes)12 TaxonomyTreeNode (org.olat.modules.taxonomy.model.TaxonomyTreeNode)12 Path (javax.ws.rs.Path)10