Document list - DocumentList
List of generated documents

Component properties
Document list
items
List of documents to display
Download all documents (section Basic properties)
allowDownloadingOfAllDocuments
An option that allows all documents to be downloaded. Default value is "false". Availability of the feature depends on the license and may not be available in all deployments.
Displaying the loader while generating a document (section Basic properties)
async
An option that displays the loader while generating a document. Default value is "false".
Availability of functionality depends on the license and may not be available in all deployments.
Collapsible document list (Other section)
GesDocumentList.foldable
The document list display 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 (regarding the list of displayed documents) should be set in the tab Source. Example configuration for the component:
The most important thing in the above configuration is to set:
fileName="my_file.pdf" - in quotes, provide the name of the document displayed on the template.
documentTemplate="my_template.xsl-*" - in quotes, provide the xsl template name 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, you need to add listening on the DocumentList component, e.g. on currentPageMid (or another element that changes on the application when moving between pages). This will avoid a situation where data changes are not reflected in the printout.
If the generated document is to be saved to DMS, on the last page before submitting the application you need to add this document to the document generator (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
Generator name
Generator name
"fop" - if the data feeding the printout comes from the application. "fopFromVariable" - if the data feeding the printout is generated from a variable xmlDocument (then the component must also listen to this variable!)
Document name
File name
the document name displayed on the template
Artifact name
Document template
component name in the format name-* where the asterisk denotes the highest version of the component (there is also the possibility of specifying a specific version)
Feeding the document list with data from a service
The component can be fed with data from the service attached either on the component or on the page.
Feeding the document list with links from a service (external links)
Availability of functionality depends on the license and may not be available in all deployments.
Demo application: demoWebview
We attach the service to the component standardly 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 name of the file to download,
documentLabel — optionally the label displayed next to the file (if there is none, the file name is displayed),
source — source type (values: "externalWeb" or "internalDoc"), a constant that tells the platform whether the source system is cms ("externalWeb") or nemo ("internalDoc").
Remember that if the document list is to be displayed 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
The service below will return two documents for us - one encoded in Base64 and one fetched from an external URL:
document_list_example1 - the script reads the input parameter fileName from the application and returns two documents:
the first document has the parameter set
sourcetoexternalDocument— the file content will be fetched from the source specified in thedocumentServiceNamescript (in this case it is the scriptdocument_list_example2.js, which returns the file contents in Base64).the second document has the parameter set
sourcetoexternalWeb— the file content will be fetched directly from the given external URL.
document_list_example2 - script defined for the purpose of being called in the document_list_example1 script - it reads parameters passed from the first script and returns the file content in Base64.
The first service is attached to the component standardly via EXTERNAL DATA SOURCE (External Data Source). It should return (endpoint names are bolded):
fileName - file name to download,
fileMimeType - file type to download,
documentLabel - optional label displayed next to the file (if there is none, the file name is displayed),
fileContent - should be added if we want to support more than 1 file - it lets us set the file identifier and distinguish files from one another,
source - type of source for the attached file. Possible values:
externalDocument— the file comes from an external data source,externalWeb— the file comes from an external URL,
documentServiceName - the name of the second service that is called to fetch the file content (filled in when source=externalDocument). If it is a script service, 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...
documentLink - external URL (filled in when source=externalWeb)

Example code of script services:
The file content itself must be encoded in base64 and returned under a parameter named output. Otherwise, the document list will not fetch the attachment.
Demo application: demoDocuments
Last updated
Was this helpful?
