Repository plugins
Daisy provides a number of interfaces through which the repository functionality can be extended or customized. The components that do this are called plugins.
Anatomy of a plugin
A plugin is basically an implementation of a certain plugin interface. The various plugin interfaces are listed further on.
To deploy the plugin in the repository server, it should be packaged as a container jar for the Daisy Runtime. A container jar is a jar file containing a Spring container definition.
The Spring container definition should contain a bean which (usually upon initialization) registers the plugin implementation with the plugin registry. The bean which performs the registration can simply be the plugin implementation itself.
To gain access to the plugin registry, the Spring container can use the daisy:import-service instruction (a custom tag provided by the Daisy Runtime).
When the Spring container of the plugin is destroyed, it should properly unregister the plugin.
To deploy the plugin, the container jar can be copied to a specific subdirectory of the repository data directory.
This may sound like a lot, but it's not, as is illustrated by this example.
Plugin types
Extensions
Repository extensions are very generic plugins which can implement any sort of functionality. The main advantage of putting this functionality in the form of a repository extension is that the extension can then be easily retrieved using the Repository.getExtension(name) function.
Various non-core functionality in Daisy has been added as extensions, such as the NavigationManager, the Publisher, the EmailNotifier, etc.
For details see repository extensions.
Pre-save hooks
A pre-save hook is a component which can modify the content of a document right before it is saved. An example is the image pre-save hook included with Daisy, which can generate thumbnails in document parts and extract EXIF data to document fields.
A pre-save hook should implement the following interface:
org.outerj.daisy.repository.spi.local.PreSaveHook
Authentication schemes
The task of an authentication scheme is to tell if a username/password combination is valid. By default Daisy uses its own authentication based on Daisy's user management. New authentication schemes can be added to check against external systems. Daisy ships with example authentication schemes for LDAP and NTLM which are usable through simple configuration. If you have other needs, you can implement your own scheme. See also user management and an example.
An authentication scheme should implement the following interface:
org.outerj.daisy.authentication.spi.AuthenticationScheme
Text extractors
Text extractors extract text from various content formats for the purpose of full text indexing. Daisy includes a variety of such text extractors, e.g. for MS Word and PDF.
A text extractor should implement the following interface:
org.outerj.daisy.textextraction.TextExtractor
Link extractors
Link extractors extract Daisy document links from various content formats. These extracted links are maintained by the repository to enable searching which documents link to a certain document.
A link extractor should implement the following interface:
org.outerj.daisy.linkextraction.LinkExtractor
HTTP handlers
Adding new functionality to the HTTP interface of the repository server can be done by implementing a request handler:
org.outerj.daisy.httpconnector.spi.RequestHandler
This is mostly useful for extensions which want to support remote invocation.
Other
It's possible to add it any sort of component to be launched as part of the repository server, it doesn't necessarily need to register something in the plugin registry. Such components could perform all sorts of tasks such as listening to JMS or synchronous repository events, performing timed actions, etc.



There are no comments.