Show document (Event action)
Event action – Abstract
Purpose: Opens a single document identified by its ID in an additional browser tab, if read access for the document exists.
►NOTE◄ This event action is only available, if the functional extension module 'Document Management' is installed and licensed.
The event action Show document (Event action) opens a single document identified by its ID (see Documents) in the browser, provided that read access exists for the document.
If the browser used can directly display the document content type (contentType) automatically determined during upload, it will appear in a new browser tab.
Otherwise, the browser can transfer the content of the document to a predefined or interactively selectable application or provide it as a download. The details depend on the browser and the user's preferences, if any.
Error handling:
►IMPORTANT◄ In all of the following configurations, event handling is continued. The error message only affects the output in the browser tab!
Document ID |
Role permissions |
Access per ownership or permission to 'read' |
Error message in the opened browser tab |
|
negligible |
negligible |
NullPointerException
|
|
|
negligible |
Failed to read: Access denied: Can't access Document for Read ► The role does not grant read access to documents. |
|
|
||
|
Failed to read: Owner access denied: Can't access Document for Read ► Read access to the document fails due to lack of ownership/approval for 'Read'. |
||
|
Configuration
The value resolver for the Document ID parameter alternatively accepts the following return values:
A Long value that specifies the ID (id) of the document to be displayed.
A text value convertible to a Long value that specifies the ID (id) of the document to be displayed.
An entity of the 'document' type (Documents) to be displayed.
►NOTE◄ Even if a complete document is transferred as a data object instead of an ID, only the document content stored server-side is displayed and not the possibly differing content in the documentContent field of the transferred (volatile) data object.
Example
On the item level of an order, all uploaded Documents should be displayed by clicking on a 'Details' Button, which refer by 'reference' to the EAN Number (text attribute) specified for the item. On the basis of these documents (product images, PDF documents, etc.) the user should fill in further characteristics for the position (e.g. an appropriate Goods description).
Runtime example:
As soon as an EAN Number is available for a position, the 'Details' Button appears. Whether documents have actually been uploaded for the EAN Number is not important here.
Clicking the button will search for documents related to the specified 'EAN number' and – if available and accessible within the current session – display them in additionally opened browser tabs.
Configuration:
Although the search necessary for document assignment and the display of any documents 'found' requires server communication, the task can be solved by a Client workflow. The 'showDetails" behaviour is created for the Button and configured as shown to the right:
►NOTE◄ If no element is linked for the Client workflow as shown here, in the context of an input form for purchase orders, the relevant purchase order as a whole is available as an input value. Without a different specification for the Result expression, the state of this data object processed in the Client workflow is then available for the Actions on "true " and the Actions on "false ". However, no use is made of this here. |
|
A click on the 'Edit' Button in the configuration for the Client workflow behaviour opens the associated editor:
►NOTE◄ In the example, it is assumed that the relevant 'EAN number' is specified in the 'Reference' field when uploading documents for certain articles. Whether the document was actually assigned during the upload (see Assigning documents) is irrelevant for the assignment by the Search (Event action) in the Client workflow. The 'reference' is used here – completely bypassing the actual assignment logic for documents – as a search criterion to find 'matching' documents. If necessary, an additional search criterion (e.g. for the Document type) could be used to prevent random finds. |
|