Document Table

This component is a case document table with the features display, upload, download and delete document entries.

document-table

To extend features of this component, please override these subprocesses: GetDocumentItems, UploadDocumentItem, DeleteDocumentItem, and DownloadDocumentItem. You can also add a new column or remove default columns of the document table.

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"
      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>

Refer to process DocumentTableExample in project portal-components-examples for more details.

Attributes of this component:

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.

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.

updatedComponentAfterUploaded

null

String

Component will be triggered the update after document is uploaded.

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.

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.

Script checking and 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 to true to check for harmful scripts.

  • Set enableVirusScannerForUploadedDocument to true 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.

Migrate from Deprecated Document Table

  1. Replace code in HTML files: replace ic:ch.ivy.addon.portalkit.component.document.DocumentTable with ic:com.axonivy.portal.components.DocumentTable.

  2. Consider updating value of the new attributes enableScriptCheckingForUploadedDocument, enableVirusScannerForUploadedDocument and allowedUploadFileTypes as required.

  3. Override subprocesses if you want and adapt your business accordingly.

    New sub process

    Deprecated sub process

    GetDocumentItems

    GetDocumentList

    UploadDocumentItem

    UploadDocument

    DeleteDocumentItem

    DeleteDocument

    DownloadDocumentItem

    DownloadDocument

  4. If you have customized IvyDocument make sure to extend it from class com.axonivy.portal.components.ivydata.bo.IvyDocument.

  5. Attributes typeSelectionItems and selectedType now use com.axonivy.portal.components.enums.DocumentType. Please replace ch.ivy.addon.portalkit.enums.DocumentType with com.axonivy.portal.components.enums.DocumentType.

Note

Please remove redundant overridden configurations, subprocesses, and data classes such as GetDocumentListOverride, UploadDocumentOverride, etc.