KIM Document Handlers are 'attached' to the document repository module and are executed:
- before a document is added to the repository
- after a document is added to the repository
- when a document is removed from the document repository
Each handler has to implement com.ontotext.kim.client.documentrepository.DocumentListener interface.
Document handlers are configured through the comma-separated list of values within <KIM_HOME>/config/install.properties called
com.ontotext.kim.docHandlers=
Handlers are useful when one wants to add user-defined document features to a document, which is about to be added, or to log statistics about that document.
Example: Adding LENGTH feature to the document
If users want to load that document handler within KIM context, they have to update the com.ontotext.kim.docHandlers= parameter like that:
com.ontotext.kim.docHandlers=my.package.name.DocumentLengthHandler
In order to preserve the specific document feature, users also need to add it to the list of supported features within <KIM_HOME>/config/document.repository.properties configuration file:
com.ontotext.kim.KIMConstants.DOCUMENT_FEAT_LIST=...