Document Table
This component is a case document table with functions display, upload, preview, download and delete document entries.
Attributes
Name |
Default |
Type |
Description |
---|---|---|---|
nameColumnRendered |
TRUE |
Boolean |
Boolean value to specify the rendering of the name column, when set to false name column will not be rendered. |
sizeColumnRendered |
TRUE |
Boolean |
Boolean value to specify the rendering of the size column, when set to false size column will not be rendered. |
typeColumnRendered |
TRUE |
Boolean |
Boolean value to specify the rendering of the type column, when set to false type column will not be rendered. |
functionColumnRendered |
TRUE |
Boolean |
Boolean value to specify the rendering of the function column, when set to false function column will not be rendered. |
previewRendered |
TRUE |
Boolean |
Boolean value to specify the rendering of the preview icon, when set to false preview icon will not be rendered. |
uploadRendered |
TRUE |
Boolean |
Boolean value to specify the rendering of the upload icon, when set to false upload icon will not be rendered. |
downloadRendered |
TRUE |
Boolean |
Boolean value to specify the rendering of the download icon, when set to false download icon will not be rendered. |
deleteRendered |
TRUE |
Boolean |
Boolean value to specify the rendering of the delete icon, when set to false delete icon will not be rendered. |
messageRendered |
TRUE |
Boolean |
Boolean value to specify the rendering of the message, when set to false message will not be rendered. |
fileLimit |
-1 |
Integer |
Number of files are in the given ICase. |
sizeLimit |
null |
Long |
Individual uploading file size limit in bytes. |
updatedComponentAfterUploaded |
null |
String |
Component will be triggered the update after document is uploaded. |
previewIcon |
fa-eye |
String |
Icon class will be displayed in preview dialog. |
previewStyleClass |
null |
String |
Styles for preview link. |
previewpreviewDialogStyleClass |
null |
String |
Styles for preview dialog. |
previewPDFStyleClass |
null |
String |
Styles for PDF preview dialog. |
previewImageStyleClass |
null |
String |
Styles for image preview dialog. |
downloadIcon |
fa-download |
String |
Icon class will be displayed in download link. |
downloadStyleClass |
null |
String |
Styles for download link. |
deleteIcon |
fa-trash-o |
String |
Icon class will be displayed in delete link. |
deleteStyleClass |
null |
String |
Styles for delete link. |
updatedComponentAfterDeleted |
null |
String |
Component will be triggered the update after document is deleted. |
selectedType |
String |
String value to specify the selected document types, by default it will be first element in |
|
typeSelectionItems |
DOCUMENTATION,CONTRACT,INFORMATION,EMAIL,OTHERS |
String |
String value to specify the list of document type. |
enableScriptCheckingForUploadedDocument |
Boolean |
Boolean value to specify script checking. Set to
true to enable script checking.The setting will detect Portal setting
Portal.Document.EnableScriptChecking as its default value, refer to HowTo: Update Portal Settings for more details.If the Portal setting is not available, defaults to
false . |
|
enableVirusScannerForUploadedDocument |
Boolean |
Boolean value to specify virus scanning. Set to
true to enable virus scanning. Refer to Virus Scanning Setting for more details.The setting will detect Portal setting
Portal.Document.EnableVirusScanner as its default value, refer to HowTo: Update Portal Settings for more details.If Portal setting is not available, default value is
false . |
|
allowedUploadFileTypes |
String |
String value to specify the list of file extension that can be uploaded.
The setting will detect Portal setting
Portal.Document.WhitelistExtension as its default value, refer to HowTo: Update Portal Settings for more details.If Portal setting is not available, default value is
doc,docx,xls,xlsx,xlsm,csv,pdf,ppt,pptx,txt,zip,jpg,jpeg,bmp,png . |
Virus scanning
The Document Table has options to check for harmful scripts and viruses inside the file before uploading it to the system.
Set
enableScriptCheckingForUploadedDocument
totrue
to check for harmful scripts.Set
enableVirusScannerForUploadedDocument
totrue
to enable virus scanning.
Code example:
<ic:com.axonivy.portal.components.DocumentTable id="document-table-component"
enableScriptCheckingForUploadedDocument="true"
enableVirusScannerForUploadedDocument="true" />
Please refer to Virus Scanning Settings for more details about virus scanning.
Customize
In your project, create four callable subprocesses with the information below to customize the functions of the Document Table.
Tip
You can refer to process CustomDocumentFeatures
in project portal-component-examples
to examnine how to customize.
Get document list
To customize how Document Table gets documents, create a callable subprocess with:
Signature: portalGetDocumentItems
Name |
Type |
Note |
---|---|---|
Parameter |
||
businessCase |
ch.ivyteam.ivy.workflow.ICase |
|
Result |
||
documents |
java.util.List<com.axonivy.portal.components.ivydata.bo.IvyDocument> |
|
message |
java.lang.String |
|
status |
java.lang.String |
OK or SKIP |
Portal will call subprocesses with the above details in the same security context and then
get the first result where status
is "OK"
.
Note
After you get the document list from DMS, convert it into List<ch.ivy.addon.portal.component.ivydata.bo.IvyDocument>
These fields are mandatory when mapping: id
, name
, contentType
Upload document
To customize what Document Table should do when a user uploads a document, create a callable subprocess with:
Signature: portalUploadDocumentItem
Name |
Type |
Note |
---|---|---|
Parameter |
||
businessCase |
ch.ivyteam.ivy.workflow.ICase |
|
uploadedFile |
org.primefaces.model.file.UploadedFile |
|
enableScriptCheckingForUploadedDocument |
java.lang.Boolean |
|
enableVirusScannerForUploadedDocument |
java.lang.Boolean |
|
allowedUploadFileTypes |
java.lang.String |
|
Result |
||
uploadedDocument |
ch.ivyteam.ivy.workflow.document.IDocument |
|
message |
java.lang.String |
|
status |
java.lang.String |
OK or SKIP |
The parameters of the callable subprocess data contain the file you want to upload uploadedFile
and other variables to validate the file before uploading it.
Portal will call subprocesses with the above details in the same security context and then
get the first result where status
is "OK"
.
Download document
To customize behavior when a user downloads a document from Document Table, create a callable subprocess with:
Signature: portalDownloadDocumentItem
Name |
Type |
Note |
---|---|---|
Parameter |
||
businessCase |
ch.ivyteam.ivy.workflow.ICase |
|
document |
com.axonivy.portal.components.ivydata.bo.IvyDocument |
|
Result |
||
streamedContent |
org.primefaces.model.StreamedContent |
|
status |
java.lang.String |
OK or SKIP |
The parameters of the callable subprocess data contain the Ivy document
you want to download.
Portal will call subprocesses with the above details in the same security context and then
get the first result where status
is "OK"
.
Delete document
To customize behavior when a user deletes a document from Document Table, create a callable subprocess with:
Signature: portalDeleteDocumentItem
Name |
Type |
Note |
---|---|---|
Parameter |
||
businessCase |
ch.ivyteam.ivy.workflow.ICase |
|
document |
com.axonivy.portal.components.ivydata.bo.IvyDocument |
|
Result |
||
message |
java.lang.String |
|
status |
java.lang.String |
OK or SKIP |
The parameters of the callable subprocess data contain the Ivy document
to delete.
Portal will call subprocesses with the above details in the same security context and then
get the first result where status
is "OK"
.
User interface
Not only the functions, but you can also customize the UI of the Document Table such as adding a new column or removing default columns.
Code Example:
<h:form id="form">
<ic:com.axonivy.portal.components.DocumentTable id="document-table-component"
allowedUploadFileTypes="doc,docx,xls,xlsx,xlsm,csv,pdf,ppt,pptx,txt,png"
typeSelectionItems="#{documentTableExampleBean.documentTypes}">
<f:facet name="componentHeader">
<h2>This is the customized document table component header</h2>
</f:facet>
<p:column headerText="Creator" styleClass="document-creator-column">
<h:outputText id="creator" value="#{document.creation.userName}" title="#{document.creation.userName}" />
</p:column>
<p:column headerText="Created time" styleClass="document-created-column">
<h:outputText id="created-time" value="#{document.creation.timestamp}" title="#{document.creation.timestamp}" />
</p:column>
<p:column headerText="Customer" styleClass="document-customer-column">
<h:outputText id="customer" value="#{document.customer}" title="#{document.customer}" />
</p:column>
<f:facet name="componentFooter">
<h2>This is the customized document table component footer</h2>
</f:facet>
</ic:com.axonivy.portal.components.DocumentTable>
</h:form>
Tip
Refer to process DocumentTableExample
in project portal-components-examples
for more details.
Migration Notes
Migrate 10.0.x to 10.0.12
Since this version, we no longer support the override process approach for functions of Document Table. Please follow our guidelines below to migrate your override subprocesses.
Remove Subprocess Override of
GetDocumentItems
,UploadDocumentItem
,DeleteDocumentItem
, andDownloadDocumentItem
from your project.Change the signature of your callable starts as described below.
Subprocess
New signature
GetDocumentItems
portalGetDocumentItems
UploadDocumentItem
portalUploadDocumentItem
DeleteDocumentItem
portalDownloadDocumentItem
DownloadDocumentItem
portalDeleteDocumentItem
Please read the Customize section for more details.
Migrate to 10.0.0
Replace code in HTML files: replace
ic:ch.ivy.addon.portalkit.component.document.DocumentTable
withic:com.axonivy.portal.components.DocumentTable
.Consider updating value of the new attributes
enableScriptCheckingForUploadedDocument
,enableVirusScannerForUploadedDocument
andallowedUploadFileTypes
as required.Override subprocesses if you want and adapt your business accordingly.
New subprocess
Deprecated subprocess
GetDocumentItems
GetDocumentList
UploadDocumentItem
UploadDocument
DeleteDocumentItem
DeleteDocument
DownloadDocumentItem
DownloadDocument
If you have customized IvyDocument make sure to extend it from class
com.axonivy.portal.components.ivydata.bo.IvyDocument
.Attributes
typeSelectionItems
andselectedType
now usecom.axonivy.portal.components.enums.DocumentType
. Please replacech.ivy.addon.portalkit.enums.DocumentType
withcom.axonivy.portal.components.enums.DocumentType
.Note
Please remove redundant overridden configurations, subprocesses, and data classes such as GetDocumentListOverride, UploadDocumentOverride, etc.