use of org.olat.modules.taxonomy.model.TaxonomyRefImpl in project openolat by klemens.
the class DocumentPoolIndexer method doIndex.
@Override
public void doIndex(SearchResourceContext parentResourceContext, Object object, OlatFullIndexer indexerWriter) throws IOException, InterruptedException {
String taxonomyTreeKey = documentPoolModule.getTaxonomyTreeKey();
if (StringHelper.isLong(taxonomyTreeKey)) {
Long taxonomyKey = new Long(taxonomyTreeKey);
Taxonomy taxonomy = taxonomyService.getTaxonomy(new TaxonomyRefImpl(taxonomyKey));
OLATResourceable docPoolOres = OresHelper.createOLATResourceableInstanceWithoutCheck(getSupportedTypeName(), 0l);
SearchResourceContext searchResourceContext = new SearchResourceContext(parentResourceContext);
searchResourceContext.setBusinessControlFor(docPoolOres);
searchResourceContext.setTitle(taxonomy.getDisplayName());
searchResourceContext.setDescription(taxonomy.getDescription());
searchResourceContext.setLastModified(taxonomy.getLastModified());
searchResourceContext.setCreatedDate(taxonomy.getCreationDate());
doIndexTaxonomyLibrary(searchResourceContext, taxonomy, indexerWriter);
}
}
use of org.olat.modules.taxonomy.model.TaxonomyRefImpl in project openolat by klemens.
the class DocumentPoolAdminController method doOpenPermissions.
private void doOpenPermissions(UserRequest ureq) {
removeAsListenerAndDispose(permissionsCtrl);
if (StringHelper.containsNonWhitespace(docPoolModule.getTaxonomyTreeKey())) {
WindowControl bwControl = addToHistory(ureq, OresHelper.createOLATResourceableType("Types"), null);
Taxonomy taxonomy = taxonomyService.getTaxonomy(new TaxonomyRefImpl(new Long(docPoolModule.getTaxonomyTreeKey())));
permissionsCtrl = new DocumentPoolAdminPermissionsController(ureq, bwControl, taxonomy);
listenTo(permissionsCtrl);
mainVC.put("segmentCmp", permissionsCtrl.getInitialComponent());
}
}
use of org.olat.modules.taxonomy.model.TaxonomyRefImpl in project openolat by klemens.
the class DocumentPoolWebDAVMergeSource method loadMergedContainers.
@Override
protected List<VFSContainer> loadMergedContainers() {
List<VFSContainer> containers = new ArrayList<>();
String taxonomyTreeKey = docPoolModule.getTaxonomyTreeKey();
if (StringHelper.isLong(taxonomyTreeKey)) {
Taxonomy taxonomy = taxonomyService.getTaxonomy(new TaxonomyRefImpl(new Long(taxonomyTreeKey)));
if (taxonomy != null) {
String templatesDir = Util.createPackageTranslator(DocumentPoolMainController.class, identityEnv.getLocale()).translate("document.pool.templates");
TaxonomyTreeBuilder builder = new TaxonomyTreeBuilder(taxonomy, identityEnv.getIdentity(), null, identityEnv.getRoles().isOLATAdmin(), docPoolModule.isTemplatesDirectoryEnabled(), templatesDir, null);
TreeModel model = builder.buildTreeModel();
TreeNode rootNode = model.getRootNode();
for (int i = 0; i < rootNode.getChildCount(); i++) {
VFSContainer container = loadRecursiveMergedContainers(taxonomy, rootNode.getChildAt(i));
if (container != null) {
containers.add(container);
}
}
}
}
return containers;
}
Aggregations