This feature allows users to create their own Document Repository module, thus integrating their preferred indexing/storage engine or change document repository behavior with their own.
There are several steps to load and use custom document repository.
Create a class implementing the DocumentRepositoryAPI interface.
This will be the object, providing all functionality for adding, retrieving and removing documents, index management and search.
Example:
Create a class that will initialize and return your document repository object
This class must implement the CustomDocumentRepositoryImplementation interface. The interface provides two methods:
- init(FeatureSchema fSchema) - initializes your document repository
- getDocumentRepositoryInstance() - returns the initialized DocumentRepositoryAPI object
All implementing classes must have a constructor without parameters in order to be dynamically loaded using reflection. After the new object is created, the init(...) method is called. Developers can put various code there, as well as in the getDocumentRepositoryInstance() method, which would return the object to serve as DocumentRepositoryAPI.
Example:
Configure KIM to use the custom DocumentRepositoryAPI object
In order to load the custom DocumentRepositoryAPI object, one should:
- pack the custom code as a jar library and add it to KIM classpath (put the .jar file in the <KIM_HOME/lib directory)
- update the corresponding configuration options in <KIM_HOME/config/document.repository.properties>
Parameter com.ontotext.kim.KIMConstants.DOCUMENT_REPOSITORY_TYPE should be set to other while parameter com.ontotext.kim.KIMConstants.CUSTOM_DOC_REPOSITORY_CLASS_NAME should point to the class implementing the CustomDocumentRepositoryImplementation interface.