-
Type: User story
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: Renditions
-
Impact type:API added
Use cases
There are several cases where it makes sens to generate a rendition of a Nuxeo Document.
Typically :
- you store product related information in Nuxeo
=> you want to generate a Product description file in .doc or .pdf
(with most important meta-data + version and history info + picture)
- you manage mails in Nuxeo
=> you want to generate the response letter
(with logo, custom header ...)
- you store Specifications / Code audit / Benchmark results in Nuxeo
=> you want to generate the delivrable report
(with Cover page, Index, and data aggregated from several documents ...)
We already have several features like this in Nuxeo Platform :
- generate PDF / Excel view via JSF / Seam / iText
=> but template is not easy to update for users
=> page layout must remain simple
- generate BIRT reports
=> creating a BIRT report design can be complicated
=> the goal of BIRT is more data aggregation and BI than rendering
Constraints
Easy templating
The main constraints has to be the template model.
In a lot of cases, users need to be able to modify the template, but :
- contributing XML / Layouts is either :
- not flexible enough
- not powerful enough
- writting complete JSF / Freemarker template seen complicated
Truth is that most people want to use Office tools (like MSO or OpenOffice) to do that.
Standard based
As much as possible we need to rely on "standard" like OpenDocument and DocX.
It's easier to use XML based generation and it avoids relying on a running OpenOffice server.
Approach
We have already done some successful tests with DocX and JODReport.
The approach of JODReport, using Freemarker to generate OpenDocument seems like the right one.
On the Nuxeo level we have :
- a TemplateDocument : this documents holds the template file as well as some default parameters
- a TemplateBasedDocument : this is a standard Nuxeo Document that is associated with a Template and can then support rendition
In the prototype the logic is bound to Facets so that you can create a rendition from potentially any kind of Document (this may require to store the resulting rendering in a field associated to the facet wich is not the case for now).
High level User Story
- Template file creation
- create an office document via OpenOffice or MSOffice
- From within the editor program I mark some fields or section to be merge/replaced
(basically I tag the Document)
- Create the Template document in Nuxeo
- Inside Nuxeo I create a new Template Document and upload my template file
- Nuxeo extract the structure from the template file and gives me a listing of the fields
- I can define types and binding for each fields ( direct value, or XPath to document properties)
- I can add fields if needed
- Create a Template Based document in Nuxeo
- For selected Document types when I create them I can select the associated template
- If some parameters are still unset at template level the user will be prompted to enter them
- depends on
-
NXP-9501 Fix associated template Edit tab
- Resolved
-
NXP-9502 Template detach caching bug
- Resolved
-
NXP-9520 Template parameter edition screen crashes if parameter contains illegal chars
- Resolved
-
NXP-9545 Variable extract should take into account the Context extensions
- Resolved
-
NXP-9567 Rendition and Template URL codec should propertly escape spaces and special characters
- Resolved
-
NXP-9620 Bad variable extraction when templating doc contains complex FreeMarker expression
- Resolved
-
NXP-9104 Improve Template Mangement module
- Resolved
-
NXP-9547 Provide support for complex type XDOCReport tool
- Resolved