use of org.olat.modules.taxonomy.model.TaxonomyModel in project OpenOLAT by OpenOLAT.
the class MoveTaxonomyLevelController method loadModel.
private void loadModel() {
new TaxonomyAllTreesBuilder().loadTreeModel(taxonomyModel, taxonomy);
// remove children of the level to move
for (TaxonomyLevel levelToMove : levelsToMove) {
TreeNode nodeToMove = taxonomyModel.getNodeById(TaxonomyAllTreesBuilder.nodeKey(levelToMove));
nodeToMove.removeAllChildren();
}
// remove the level with
List<TreeNode> openedNodes = new ArrayList<>();
filterByAllowedTypes(taxonomyModel.getRootNode(), openedNodes);
taxonomyModel.sort(taxonomyModel.getRootNode());
List<String> nodeIds = openedNodes.stream().map(node -> node.getIdent()).collect(Collectors.toList());
taxonomyEl.setOpenNodeIds(nodeIds);
}
use of org.olat.modules.taxonomy.model.TaxonomyModel in project OpenOLAT by OpenOLAT.
the class MoveTaxonomyLevelController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
taxonomyModel = new TaxonomyModel();
taxonomyEl = uifactory.addTreeMultiselect("taxonomy", null, formLayout, taxonomyModel, this);
taxonomyEl.setMultiSelect(false);
taxonomyEl.setRootVisible(true);
uifactory.addFormCancelButton("cancel", formLayout, ureq, getWindowControl());
uifactory.addFormSubmitButton("move.taxonomy.level", formLayout);
}
use of org.olat.modules.taxonomy.model.TaxonomyModel in project openolat by klemens.
the class MoveTaxonomyLevelController method loadModel.
private void loadModel() {
new TaxonomyAllTreesBuilder().loadTreeModel(taxonomyModel, taxonomy);
// remove children of the level to move
for (TaxonomyLevel levelToMove : levelsToMove) {
TreeNode nodeToMove = taxonomyModel.getNodeById(TaxonomyAllTreesBuilder.nodeKey(levelToMove));
nodeToMove.removeAllChildren();
}
// remove the level with
List<TreeNode> openedNodes = new ArrayList<>();
filterByAllowedTypes(taxonomyModel.getRootNode(), openedNodes);
taxonomyModel.sort(taxonomyModel.getRootNode());
List<String> nodeIds = openedNodes.stream().map(node -> node.getIdent()).collect(Collectors.toList());
taxonomyEl.setOpenNodeIds(nodeIds);
}
use of org.olat.modules.taxonomy.model.TaxonomyModel in project openolat by klemens.
the class TaxonomyAllTreesBuilder method buildTreeModel.
public TaxonomyModel buildTreeModel(Taxonomy taxonomy) {
TaxonomyModel taxonomyTreesModel = new TaxonomyModel();
loadTreeModel(taxonomyTreesModel, taxonomy);
return taxonomyTreesModel;
}
use of org.olat.modules.taxonomy.model.TaxonomyModel in project openolat by klemens.
the class TaxonomyAllTreesBuilder method buildTreeModel.
public TaxonomyModel buildTreeModel() {
TaxonomyModel taxonomyTreesModel = new TaxonomyModel();
loadTreeModel(taxonomyTreesModel);
return taxonomyTreesModel;
}
Aggregations