Document generator - DocumentGenerator
The component is used to generate documents (PDF) based on XSL-FO templates. It also allows saving generated documents to the DMS system, as well as providing their contents as a base64-encoded string.
Component properties
List of documents
items
List of documents to be generated.
Save to DMS
saveToDms
Flag indicating whether the document should be saved to DMS (default value "true").
Save to DMS on abandonment
saveToDmsOnAbandon
Flag indicating whether the document should be saved to DMS when the application is abandoned (default value "false").
Passing document content in base64 String
fileContentInValue
Flag indicating whether the generated file's content will be passed in the component value as base64 String.
More information about component properties: Common component properties
List of documents to be generated
We add the component configuration in the Source. Example configurations:
<p1:GesDocumentGenerator id="GesDocumentGenerator1" inheritLayout="true">
<p1:GesDocumentGenerator.layoutData>
<GridData horizontalAlignment="FILL" horizontalSpan="16"/>
</p1:GesDocumentGenerator.layoutData>
<data:DocumentGeneratorItems>
<data:DocumentGeneratorItem generatorName="fop" fileName="my_file.pdf" documentTemplate="my_temp.xsl-*"/>
</data:DocumentGeneratorItems>
</p1:GesDocumentGenerator>Above are example configurations of documents to be generated. The parameter generatorName specifies the name of the document generator to be used to generate the document, in the next parameter we specify the file name (fileName), which will be presented to the user, and the last one is the name of the document template available in the repository (documentTemplate in the format TEMPLATE_NAME-VERSION).
Document generation takes place according to the dependency graph flow — therefore you should remember to set the listening list appropriately.
If the component is on the last page of the application, which also contains fields passed to the generated document, then the component must listen to something that changes on exiting the page. Examples:
Create an Exit Service with a simple Echo Service (e.g., returning the value true) and assign the Echo Service result to a variable that the document generator will then listen to.
Add listening in GesDocumentGenerator to the predefined variable currentPageMid.
Component illustration

Last updated
Was this helpful?
