use of org.olat.modules.taxonomy.manager.TaxonomyAllTreesBuilder in project OpenOLAT by OpenOLAT.
the class EditTaxonomyLevelController method buildPathKeysAndValues.
private void buildPathKeysAndValues(List<String> pathKeyList, List<String> pathValueList) {
pathKeyList.add("-");
pathValueList.add("");
List<TreeNode> nodeList = new TaxonomyAllTreesBuilder().getFlattedModel(taxonomy, false);
for (TreeNode node : nodeList) {
TaxonomyLevel taxonomyLevel = (TaxonomyLevel) node.getUserObject();
pathKeyList.add(taxonomyLevel.getKey().toString());
pathValueList.add(taxonomyLevel.getMaterializedPathIdentifiers());
}
}
use of org.olat.modules.taxonomy.manager.TaxonomyAllTreesBuilder 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.manager.TaxonomyAllTreesBuilder 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.manager.TaxonomyAllTreesBuilder in project openolat by klemens.
the class EditTaxonomyLevelController method buildPathKeysAndValues.
private void buildPathKeysAndValues(List<String> pathKeyList, List<String> pathValueList) {
pathKeyList.add("-");
pathValueList.add("");
List<TreeNode> nodeList = new TaxonomyAllTreesBuilder().getFlattedModel(taxonomy, false);
for (TreeNode node : nodeList) {
TaxonomyLevel taxonomyLevel = (TaxonomyLevel) node.getUserObject();
pathKeyList.add(taxonomyLevel.getKey().toString());
pathValueList.add(taxonomyLevel.getMaterializedPathIdentifiers());
}
}
Aggregations