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);
}
}
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);
}
}
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 });
}
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();
}
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);
}
}
Aggregations