Package org.dspace.discovery.indexobject
Class CollectionIndexFactoryImpl
java.lang.Object
org.dspace.discovery.indexobject.IndexFactoryImpl<T,S>
org.dspace.discovery.indexobject.DSpaceObjectIndexFactoryImpl<IndexableCollection,Collection>
org.dspace.discovery.indexobject.CollectionIndexFactoryImpl
- All Implemented Interfaces:
CollectionIndexFactory,DSpaceObjectIndexFactory<IndexableCollection,,Collection> IndexFactory<IndexableCollection,Collection>
public class CollectionIndexFactoryImpl
extends DSpaceObjectIndexFactoryImpl<IndexableCollection,Collection>
implements CollectionIndexFactory
Factory implementation for indexing/retrieving collections in the search core
- Author:
- Kevin Van de Velde (kevin at atmire dot com)
-
Field Summary
FieldsFields inherited from class org.dspace.discovery.indexobject.IndexFactoryImpl
solrSearchCore, solrServiceIndexPlugins -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.solr.common.SolrInputDocumentbuildDocument(Context context, IndexableCollection indexableCollection) Build a solr document for a DSpace Collection.Retrieve all instances of a certain indexable object typefindIndexableObject(Context context, String id) Retrieve a single indexable object using the provided identifiergetCollectionLocations(Context context, Collection collection) Return a list of the identifiers of the owning communities from the provided collection prepended by "m"getIndexableObjects(Context context, Collection object) Retrieve all the indexable objects for the provided objectgetLocations(Context context, IndexableCollection indexableCollection) Return a list of the identifiers from the parents for the provided IndexableObject, communities will be prepended by "m", collections b "c"getType()Return the type of the indexable objectbooleanDetermine whether the class can handle the factory implementationMethods inherited from class org.dspace.discovery.indexobject.DSpaceObjectIndexFactoryImpl
addContainerMetadataField, storeCommunityCollectionLocationsMethods inherited from class org.dspace.discovery.indexobject.IndexFactoryImpl
addFacetIndex, addFacetIndex, addNamedResourceTypeIndex, buildNewDocument, delete, delete, deleteAll, writeDocument, writeDocumentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dspace.discovery.indexobject.factory.DSpaceObjectIndexFactory
storeCommunityCollectionLocationsMethods inherited from interface org.dspace.discovery.indexobject.factory.IndexFactory
buildNewDocument, delete, delete, deleteAll, writeDocument
-
Field Details
-
collectionService
-
communityService
-
-
Constructor Details
-
CollectionIndexFactoryImpl
public CollectionIndexFactoryImpl()
-
-
Method Details
-
findAll
Description copied from interface:IndexFactoryRetrieve all instances of a certain indexable object type- Specified by:
findAllin interfaceIndexFactory<IndexableCollection,Collection> - Parameters:
context- DSpace context object- Returns:
- An iterator containing all the objects to be indexed for the indexable object
- Throws:
SQLException- If database error
-
getType
Description copied from interface:IndexFactoryReturn the type of the indexable object- Specified by:
getTypein interfaceIndexFactory<IndexableCollection,Collection> - Returns:
- a string containing the type
-
buildDocument
public org.apache.solr.common.SolrInputDocument buildDocument(Context context, IndexableCollection indexableCollection) throws IOException, SQLException Build a solr document for a DSpace Collection.- Specified by:
buildDocumentin interfaceIndexFactory<IndexableCollection,Collection> - Overrides:
buildDocumentin classDSpaceObjectIndexFactoryImpl<IndexableCollection,Collection> - Parameters:
context- The relevant DSpace Context.indexableCollection- indexableCollection to be indexed- Returns:
- initialized solr document
- Throws:
SQLException- sql exceptionIOException- IO exception
-
supports
Description copied from interface:IndexFactoryDetermine whether the class can handle the factory implementation- Specified by:
supportsin interfaceIndexFactory<IndexableCollection,Collection> - Parameters:
object- The object which we want to check- Returns:
- True if the factory implementation can handle the given object. False if it doesn't.
-
getIndexableObjects
Description copied from interface:IndexFactoryRetrieve all the indexable objects for the provided object- Specified by:
getIndexableObjectsin interfaceIndexFactory<IndexableCollection,Collection> - Parameters:
context- DSpace context objectobject- The object we want to retrieve our indexable objects for- Returns:
- A list of indexable objects
-
findIndexableObject
public Optional<IndexableCollection> findIndexableObject(Context context, String id) throws SQLException Description copied from interface:IndexFactoryRetrieve a single indexable object using the provided identifier- Specified by:
findIndexableObjectin interfaceIndexFactory<IndexableCollection,Collection> - Parameters:
context- DSpace context objectid- The identifier for which we want to retrieve our indexable object- Returns:
- An indexable object
- Throws:
SQLException- If database error
-
getLocations
public List<String> getLocations(Context context, IndexableCollection indexableCollection) throws SQLException Description copied from interface:DSpaceObjectIndexFactoryReturn a list of the identifiers from the parents for the provided IndexableObject, communities will be prepended by "m", collections b "c"- Specified by:
getLocationsin interfaceDSpaceObjectIndexFactory<IndexableCollection,Collection> - Parameters:
context- DSpace context object- Returns:
- A list of community identifiers with "m" prepended to every one
- Throws:
SQLException- If database error
-
getCollectionLocations
public List<String> getCollectionLocations(Context context, Collection collection) throws SQLException Description copied from interface:CollectionIndexFactoryReturn a list of the identifiers of the owning communities from the provided collection prepended by "m"- Specified by:
getCollectionLocationsin interfaceCollectionIndexFactory- Parameters:
context- DSpace context objectcollection- DSpace collection- Returns:
- A list of community identifiers with "m" prepended to every one
- Throws:
SQLException- If database error
-