Create a Document Generator
The following describes the steps specific to creating a Document Generator plugin. For steps on creating and installing a plugin, see Create a plugin. Although this topic focuses on Java development, the same steps can be followed, for the most part, for .Net.
For more information about Document Generator plugins, see Document Generator plugin.
A custom Document Generator plugin is most commonly needed to:
- Integrate with a third party document generation provider.
- Provide document formats that are not supported in the default Document Generator (HTML, PDF, RTF and XLS are all currently supported).
- Access a data source to obtain other data not present in the interview, to be added into the document.
- Provide a different process to generating HTML and PDF format (for example, under .Net where the Document-Generation-Server cannot be hosted).
Assets and information needed
These assets are required to develop a Document Generator plugin (Libraries can be found either in the /lib/ or /bin/ directories of your Web Determinations deployment).
- Interview Engine Library - determinations-interview-engine.jar / Determinations.Interview.Engine.dll (and associated dependencies).
- Determinations Utilities Library (Java Only) - determinations-utilities.jar (and associated dependencies).
- Masquerade Library (.NET Only) - Oracle.Determinations.Masquerade.dll.
The following assets are recommended when developing a Document Generator Plugin.
- Web Determinations Library - web-determinations.jar / Web.Determinations.Platform.dll.
- Determinations Engine Library - determinations-engine.jar / Oracle.Determinations.Engine.dll.
- IDE - this will make it much easier when referring to objects in the library files.
- Document Generator plugin business case - this is the reason/need why the custom Commentary plugin is being developed.
Steps
Analysis and design:
Before starting on the development of the plugin, read the Document Generator plugin topic.
Once familiarized with the Document Generator plugin, do the following:
- Determine what rulebase (or rulebases) the Document Generator will be registered in. You can make a custom Document Generator plugin that services all the rulebases and its locales in a Web Determinations installation, or you can create the Document Generator plugin to only work for a specific Rulebase, or even only for one of its locales.
- Determine the document type (file format) that the Document Generator will provide.
- The Document Generator plugin business case should be able to address the following:
- Will the plugin use a template to generate the document?
- Does the plugin require data other than what is available in the interview session?
- Does the plugin need to access datasource/s to retrieve data?
- Will the documents generated need to have binary content?
- Design how the Document Generator plugin:
- will retrieve data that is not available in the interview session (if non-interview data is part of the document).
- will access the datasource (if datasource is involved).
- will construct and generate a document with non-text content.
Development
- Setup the IDE so that it has the Web Determinations libraries and data source libraries. This makes it easier to refer to objects for the Web Determinations or the data source.
- Create a document generator plugin class by implementing the DocumentGeneratorPlugin interface (See Document Generator - sample code for examples).
- Develop the Document Generator plugin based on the Analysis and design section above.
Install and test
For steps on installing the Document Generator plugin and testing, refer to the topic, Create a plugin.