Class DMSController

  • All Implemented Interfaces:
    Serializable

    @Named("dmsController")
    @ConversationScoped
    public class DMSController
    extends Object
    implements Serializable
    This Bean acts a a front controller for the DMS feature. The Bean provides additional properties for attached files and can also manage information about file references to external file servers
    Author:
    rsoika
    See Also:
    org.imixs.workflow.jee.faces.fileupload.FileUploadController, Serialized Form
    • Field Detail

      • loginController

        @Inject
        protected org.imixs.workflow.faces.util.LoginController loginController
      • workflowController

        @Inject
        protected org.imixs.workflow.faces.data.WorkflowController workflowController
      • documentService

        @Inject
        protected org.imixs.workflow.engine.DocumentService documentService
    • Constructor Detail

      • DMSController

        public DMSController()
    • Method Detail

      • getLink

        public String getLink()
      • setLink

        public void setLink​(String link)
      • onWorkflowEvent

        public void onWorkflowEvent​(@Observes
                                    org.imixs.workflow.faces.data.WorkflowEvent workflowEvent)
                             throws org.imixs.workflow.exceptions.AccessDeniedException
        WorkflowEvent listener to update the DMS property if a WorkItem has changed, processed or saved. The read and write access for a BlobWorkitem will be updated by the org.imixs.marty.plugins.BlobPlugin. The DMSController also updates the file Properties after a workItem was processed. This is because a plug-in can add a new file (like the reportPlugIn), and so the plug-in also updates the $file information of the parent WorkItem. For that reason the DMS property will be updated by the DmsController on the WorkflowEvent WORKITEM_AFTER_PROCESS
        Parameters:
        workflowEvent -
        Throws:
        org.imixs.workflow.exceptions.AccessDeniedException
      • getDmsList

        public List<org.imixs.workflow.ItemCollection> getDmsList()
        this method returns a list of all attached files and the file meta data provided in a list of ItemCollection.
        Returns:
        - list of file meta data objects
      • getDmsListByWorkitem

        public List<org.imixs.workflow.ItemCollection> getDmsListByWorkitem​(org.imixs.workflow.ItemCollection workitem)
        This method returns a list of ItemCollections for all custom attributes of attached files.

        The method is used by the DmsController to display the dms meta data.

        The method caches the data result internally to avoid multiple calls because of JSF behavior (https://stackoverflow.com/questions/2090033/why-jsf-calls-getters-multiple-times/2090062)

        Parameters:
        workitem - - source of meta data, sorted by $creation
      • removeFile

        public void removeFile​(String aFile)
        This method removes a file form the current dms list and also from the workitem
        Parameters:
        aFile -
      • reset

        public void reset()
        Reset the current dms list
      • addLink

        public void addLink​(javax.faces.event.ActionEvent event)
        This Method adds a new Link (url) into the DMS list.
        Parameters:
        event -
      • userFriendlyBytes

        public String userFriendlyBytes​(int bytes)
        Computes the file size into a user friendly format
        Parameters:
        size -
        Returns:
      • documentType

        public String documentType​(String name)