JCopist is a template-based document generation server based on OpenOffice.org.
JCopist templates are regular OpenDocuments, enhanced with the FreeMarker scripting language:
These templates are deployed on the JCopist server, either via a deploy directory, or via a template service that allows hot redeployment. To invoke the document service, you provide the name of a deployed template, a destination format, and dynamic XML data:
<?xml version="1.0" encoding="UTF-8"?> <message> <word>Hello</word> <word>World</word> </message>
JCopist merges the template and the data, and converts the resulting OpenDocument to the requested format:
Thanks to OpenOffice.org's built-in converters, you have access to a wide range of document formats, for instance:
There are two ways to process documents:
Finally, JCopist comes in two flavors (based on a common core module):
Using FreeMarker markup in OpenDocuments is not a new idea : it was originally used in the JooReports library by Mirko Nasato.
JCopist is not based on JooReports, since the strategy used to deal with complex FreeMarker syntax is a bit different: JCopist supports "advanced" tags like [#list] without manually editing the content.xml file, but this requires pre-processing the templates when they are first deployed.
Furthermore, the two projects have a different scope: JooReports is a software library that can be embedded into an existing application, while JCopist is a stand-alone server application.
For more information, check out the JooReports home page.