Document list - DocumentList
List of generated documents

Component properties
List of documents
items
List of documents to present
Component presentation as a button (Download all documents) (section Basic properties)
allowDownloadingOfAllDocuments
Presentation of the component as a single button enabling download of all documents. Default value "false". Availability of the feature depends on the license and may not be available in all deployments.
Showing a loader while generating the document (section Basic properties)
async
Option that shows a loader while the document is being generated. Default value "false".
The availability of features depends on the license and may not be available in all deployments.
Collapsible document list (Other section)
GesDocumentList.foldable
The presentation of the document list is hidden in a collapsible section.
Availability of the feature depends on the license and may not be available in all deployments
More information about component properties: Common component properties

After adding the component from the palette, the remaining configuration (concerning the list of displayed documents) should be set on the Sourcetab. Example configuration for the component:
<p1:GesDocumentList id="GesDocumentList1" mid="GesDocumentList1" labelKey="GesDocumentList1.label" ariaLabelKey="GesDocumentList1.ariaLabel" ariaDescriptionKey="GesDocumentList1.ariaDescription" documentsAreNotReadyMessageKey="GesDocumentList1.documentsAreNotReadyMessage">
<data:ListeningOn>
<data:ListenField id="currentPageMid"/>
</data:ListeningOn>
<data:ClearOn/>
<p1:GesDocumentList.layoutData>
<ns6:GridData horizontalAlignment="FILL" horizontalSpan="16" verticalAlignment="CENTER"/>
</p1:GesDocumentList.layoutData>
<data:DocumentGeneratorItems>
<data:DocumentGeneratorItem generatorName="fop" fileName="my_file.pdf" documentTemplate="my_template.xsl-*"/>
</data:DocumentGeneratorItems>
<data:GesDocumentList.foldable enabled="false"/>
</p1:GesDocumentList>The most important parts of the above configuration are to specify:
fileName="my_file.pdf" - in quotes we provide the document name shown on the template.
documentTemplate="my_template.xsl-" - in quotes we provide the name of the xsl template in the format name- where the asterisk denotes the highest version of the component.
If the artifact attached in the Document List component is fed with data from the application form, you should add a listener on the DocumentList component, e.g. for currentPageMid (or another element that changes on the form when navigating between pages). This will prevent a situation where data changes are not reflected in the printout.
If the generated document is to be saved to DMS, you should add this document to the document generator on the last page before submitting the form (more here: Document Generator - Document Generator), providing the document in 'items'.
Configuring the items property to feed the document list with a PDF printout generated using an XSL template
Name of the generator
Generator name
"fop" - if the data feeding the printout comes from the application form. "fopFromVariable" - if the data feeding the printout is generated from a variable xmlDocument (in which case the component must also listen to that variable!)
Document name
File name
the document name shown on the template
Artifact name
Document template
name of the component in the format name-* where the asterisk denotes the highest version of the component (there is also the possibility to specify a particular version)
Feeding the document list with data from a service
The component can be fed with data from a service attached to the component or to the page.
Feeding the document list with links from a service (external links)
We attach the service to the component in the standard way via EXTERNAL DATA SOURCE (External Data Source). It should return (endpoint names are bolded):
documentLink — a list of links or document identifiers that we want to display,
fileName — the file name to download,
documentLabel — optionally a label displayed next to the file (if absent, the file name is displayed),
source — the type of source (values: "externalWeb" or "internalDoc"), a constant that tells the platform whether the source system is the CMS ("externalWeb") or nemo ("internalDoc").
Keep in mind that if the document list is to be presented in channels other than native, the service must return values correlated with the current channel. For example, returning document identifiers makes no sense for the desktop channel.
Example service code (Java, OSGI/Charon component):
Feeding the document list with data from two services
For the functionality to work, the flag server.features.externalDocumentResourceProviderEnabled=true must be set in webforms.xml
We attach the first service to the component in the standard way via EXTERNAL DATA SOURCE (External Data Source). It should return (endpoint names are bolded):
fileName - the file name to download,
fileMimeType - the file type to download,
documentLabel - an optional label displayed next to the file (if absent, the file name is displayed),
fileContent - worth adding if we want to support more than 1 file - it allows us to set a file identifier and distinguish files from each other,
source - the type of source, in this case the value 'externalDocument',
documentServiceName - the name of the second service that is called to fetch the file content. If it is a script service, we add the prefix script: (without this prefix the system will look for a Charon/OSGI service),
documentServiceParams - optional parameters that we want to pass to the service fetching the file content. They take the form parameter1=value¶meter2=value...
Example script service codes:
function callService(context) {
var fileName = context.getFirstParameter('fileName');
return [{'fileName': fileName, 'fileMimeType': 'application/pdf', 'source': 'externalDocument', 'documentServiceName': 'script:document_list_example2', 'documentServiceParams': 'parameter1=value1¶meter2=value2' }];
}
function callService(context) {
var parameter1 = context.getFirstParameter('parameter1');
var parameter2 = context.getFirstParameter('parameter2');
var content = "JVBERi0xLjMNCiXi48/TDQoNCjEgMCBvYmoNCjw8DQovVHlwZSAv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wIG4NCjAwMDAwMDAyMjIgMDAwMDAgbg0KMDAwMDAwMDM5MCAwMDAwMCBuDQowMDAwMDAxNTIyIDAwMDAwIG4NCjAwMDAwMDE2OTAgMDAwMDAgbg0KMDAwMDAwMjQyMyAwMDAwMCBuDQowMDAwMDAyNDU2IDAwMDAwIG4NCjAwMDAwMDI1NzQgMDAwMDAgbg0KDQp0cmFpbGVyDQo8PA0KL1NpemUgMTENCi9Sb290IDEgMCBSDQovSW5mbyAxMCAwIFINCj4+DQoNCnN0YXJ0eHJlZg0KMjcxNA0KJSVFT0YNCg==";
return [{'output': content}];
}The file content itself must be encoded in base64 and returned under a parameter named output. Otherwise the document list will not download the attachment.
Last updated
Was this helpful?
