Search in sources :

Example 1 with FolderIndexerWorker

use of org.olat.search.service.indexer.FolderIndexerWorker in project OpenOLAT by OpenOLAT.

the class TaxonomyLevelLibraryIndexer method doIndex.

@Override
public void doIndex(SearchResourceContext parentResourceContext, Object object, OlatFullIndexer indexerWriter) throws IOException, InterruptedException {
    if (object instanceof TaxonomyLevel) {
        TaxonomyLevel level = (TaxonomyLevel) object;
        VFSContainer library = taxonomyService.getDocumentsLibrary(level);
        if (library != null) {
            SearchResourceContext searchResourceContext = new SearchResourceContext(parentResourceContext);
            searchResourceContext.setBusinessControlFor(level);
            searchResourceContext.setTitle(level.getDisplayName());
            searchResourceContext.setDescription(level.getDescription());
            searchResourceContext.setLastModified(level.getLastModified());
            searchResourceContext.setCreatedDate(level.getCreationDate());
            FolderIndexerWorker runnableFolderIndexer = new FolderIndexerWorker();
            runnableFolderIndexer.setAccessRule(FolderIndexerAccess.FULL_ACCESS);
            runnableFolderIndexer.setParentResourceContext(searchResourceContext);
            runnableFolderIndexer.setContainer(library);
            runnableFolderIndexer.setIndexWriter(indexerWriter);
            runnableFolderIndexer.setFilePath("");
            indexerWriter.submit(runnableFolderIndexer);
        }
    }
}
Also used : SearchResourceContext(org.olat.search.service.SearchResourceContext) FolderIndexerWorker(org.olat.search.service.indexer.FolderIndexerWorker) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel) VFSContainer(org.olat.core.util.vfs.VFSContainer)

Example 2 with FolderIndexerWorker

use of org.olat.search.service.indexer.FolderIndexerWorker in project openolat by klemens.

the class TaxonomyLevelLibraryIndexer method doIndex.

@Override
public void doIndex(SearchResourceContext parentResourceContext, Object object, OlatFullIndexer indexerWriter) throws IOException, InterruptedException {
    if (object instanceof TaxonomyLevel) {
        TaxonomyLevel level = (TaxonomyLevel) object;
        VFSContainer library = taxonomyService.getDocumentsLibrary(level);
        if (library != null) {
            SearchResourceContext searchResourceContext = new SearchResourceContext(parentResourceContext);
            searchResourceContext.setBusinessControlFor(level);
            searchResourceContext.setTitle(level.getDisplayName());
            searchResourceContext.setDescription(level.getDescription());
            searchResourceContext.setLastModified(level.getLastModified());
            searchResourceContext.setCreatedDate(level.getCreationDate());
            FolderIndexerWorker runnableFolderIndexer = new FolderIndexerWorker();
            runnableFolderIndexer.setAccessRule(FolderIndexerAccess.FULL_ACCESS);
            runnableFolderIndexer.setParentResourceContext(searchResourceContext);
            runnableFolderIndexer.setContainer(library);
            runnableFolderIndexer.setIndexWriter(indexerWriter);
            runnableFolderIndexer.setFilePath("");
            indexerWriter.submit(runnableFolderIndexer);
        }
    }
}
Also used : SearchResourceContext(org.olat.search.service.SearchResourceContext) FolderIndexerWorker(org.olat.search.service.indexer.FolderIndexerWorker) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel) VFSContainer(org.olat.core.util.vfs.VFSContainer)

Example 3 with FolderIndexerWorker

use of org.olat.search.service.indexer.FolderIndexerWorker in project openolat by klemens.

the class TaxonomyTemplatesLibraryIndexer method doIndex.

@Override
public void doIndex(SearchResourceContext parentResourceContext, Object parentObject, OlatFullIndexer indexerWriter) throws IOException, InterruptedException {
    Taxonomy taxonomy = (Taxonomy) parentObject;
    VFSContainer templatesContainer = taxonomyService.getDocumentsLibrary(taxonomy);
    if (templatesContainer != null) {
        SearchResourceContext searchResourceContext = new SearchResourceContext(parentResourceContext);
        OLATResourceable templateOres = OresHelper.createOLATResourceableInstance(getSupportedTypeName(), 0l);
        searchResourceContext.setBusinessControlFor(templateOres);
        FolderIndexerWorker runnableFolderIndexer = new FolderIndexerWorker();
        runnableFolderIndexer.setAccessRule(FolderIndexerAccess.FULL_ACCESS);
        runnableFolderIndexer.setParentResourceContext(searchResourceContext);
        runnableFolderIndexer.setContainer(templatesContainer);
        runnableFolderIndexer.setIndexWriter(indexerWriter);
        runnableFolderIndexer.setFilePath("");
        indexerWriter.submit(runnableFolderIndexer);
    }
}
Also used : Taxonomy(org.olat.modules.taxonomy.Taxonomy) SearchResourceContext(org.olat.search.service.SearchResourceContext) OLATResourceable(org.olat.core.id.OLATResourceable) FolderIndexerWorker(org.olat.search.service.indexer.FolderIndexerWorker) VFSContainer(org.olat.core.util.vfs.VFSContainer)

Example 4 with FolderIndexerWorker

use of org.olat.search.service.indexer.FolderIndexerWorker in project OpenOLAT by OpenOLAT.

the class TaxonomyTemplatesLibraryIndexer method doIndex.

@Override
public void doIndex(SearchResourceContext parentResourceContext, Object parentObject, OlatFullIndexer indexerWriter) throws IOException, InterruptedException {
    Taxonomy taxonomy = (Taxonomy) parentObject;
    VFSContainer templatesContainer = taxonomyService.getDocumentsLibrary(taxonomy);
    if (templatesContainer != null) {
        SearchResourceContext searchResourceContext = new SearchResourceContext(parentResourceContext);
        OLATResourceable templateOres = OresHelper.createOLATResourceableInstance(getSupportedTypeName(), 0l);
        searchResourceContext.setBusinessControlFor(templateOres);
        FolderIndexerWorker runnableFolderIndexer = new FolderIndexerWorker();
        runnableFolderIndexer.setAccessRule(FolderIndexerAccess.FULL_ACCESS);
        runnableFolderIndexer.setParentResourceContext(searchResourceContext);
        runnableFolderIndexer.setContainer(templatesContainer);
        runnableFolderIndexer.setIndexWriter(indexerWriter);
        runnableFolderIndexer.setFilePath("");
        indexerWriter.submit(runnableFolderIndexer);
    }
}
Also used : Taxonomy(org.olat.modules.taxonomy.Taxonomy) SearchResourceContext(org.olat.search.service.SearchResourceContext) OLATResourceable(org.olat.core.id.OLATResourceable) FolderIndexerWorker(org.olat.search.service.indexer.FolderIndexerWorker) VFSContainer(org.olat.core.util.vfs.VFSContainer)

Aggregations

VFSContainer (org.olat.core.util.vfs.VFSContainer)4 SearchResourceContext (org.olat.search.service.SearchResourceContext)4 FolderIndexerWorker (org.olat.search.service.indexer.FolderIndexerWorker)4 OLATResourceable (org.olat.core.id.OLATResourceable)2 Taxonomy (org.olat.modules.taxonomy.Taxonomy)2 TaxonomyLevel (org.olat.modules.taxonomy.TaxonomyLevel)2