Package org.imixs.workflow.office.forms
Class DMSController
- java.lang.Object
-
- org.imixs.workflow.office.forms.DMSController
-
- All Implemented Interfaces:
Serializable
@Named("dmsController") @ConversationScoped public class DMSController extends Object implements SerializableThis 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 Summary
Fields Modifier and Type Field Description protected org.imixs.workflow.engine.DocumentServicedocumentServiceprotected org.imixs.workflow.faces.util.LoginControllerloginControllerstatic StringREGEX_URL_PATTERNprotected org.imixs.workflow.faces.data.WorkflowControllerworkflowController
-
Constructor Summary
Constructors Constructor Description DMSController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLink(javax.faces.event.ActionEvent event)This Method adds a new Link (url) into the DMS list.StringdocumentType(String name)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.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.StringgetLink()voidonWorkflowEvent(org.imixs.workflow.faces.data.WorkflowEvent workflowEvent)WorkflowEvent listener to update the DMS property if a WorkItem has changed, processed or saved.voidremoveFile(String aFile)This method removes a file form the current dms list and also from the workitemvoidreset()Reset the current dms listvoidsetLink(String link)StringuserFriendlyBytes(int bytes)Computes the file size into a user friendly format
-
-
-
Field Detail
-
REGEX_URL_PATTERN
public static final String REGEX_URL_PATTERN
- See Also:
- Constant Field Values
-
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
-
-
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.AccessDeniedExceptionWorkflowEvent 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:
-
-