Welcome to JCopist

JCopist is a template-based document generation server based on OpenOffice.org.

JCopist templates are regular OpenDocuments, enhanced with the FreeMarker scripting language:

A simple OpenDocument template

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"?>

JCopist merges the template and the data, and converts the resulting OpenDocument to the requested format:

The resulting document

Thanks to OpenOffice.org's built-in converters, you have access to a wide range of document formats, for instance:

  • OpenOffice.org Writer to PDF, RTF, HTML, Microsoft Word.
  • OpenOffice.org Calc to PDF, HTML, Microsoft Excel.

There are two ways to process documents:

  • synchronous processing : the generated document is returned to the client. Typically, you can use this if you're calling JCopist from a web application and want to display the document in the user's web browser.
  • asynchronous processing : the client specifies one or more method(s) to send the generated document. JCopist currently supports e-mail sending, and will soon support sending to a network printer. You can develop your own document senders.

Finally, JCopist comes in two flavors (based on a common core module):

  • RMI version . This comes as a stand-alone server.
  • Web Service version , based on Codehaus XFire . This comes as a web application.


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.