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 passing their content 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 the DMS (default value "true").
Save to DMS on abandon
saveToDmsOnAbandon
Flag indicating whether the document should be saved to the DMS when the application is abandoned (default value "false").
Passing document content in base64 String
fileContentInValue
Flag indicating whether the generated file content will be passed in the component's 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><p1:GesDocumentGenerator id="GesDocumentGenerator1" inheritLayout="false">
<data:ListeningOn>
<data:ListenField id="xmlDocument"/>
</data:ListeningOn>
<data:ClearOn/>
<p1:GesDocumentGenerator.layoutData>
<ns6:GridData horizontalAlignment="LEFT" horizontalSpan="6" verticalAlignment="CENTER"/>
</p1:GesDocumentGenerator.layoutData>
<data:DocumentGeneratorItems>
<data:DocumentGeneratorItem generatorName="fopFromVariable" fileName="my_file.pdf" documentTemplate="my_template.xsl-*"/>
</data:DocumentGeneratorItems>
</p1:GesDocumentGenerator>The above shows 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 the name of the document template available in the repository (documentTemplate in the format TEMPLATE_NAME-VERSION).
Document generation occurs according to the dependency graph flow — therefore remember to set the listening list appropriately.
If the component is on the last page of the application, where the fields passed to the generated document are also located, then the component must listen to something that changes when exiting the page. Examples:
Create an Exit Service with a simple Echo Service (e.g., returning true) and assign the result of the Echo Service 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?
