Class FileUploadController
java.lang.Object
org.imixs.workflow.faces.fileupload.FileUploadController
- All Implemented Interfaces:
Serializable
The FileUploadController is a conversation scoped bean and used to hold the
upladed files and transfere the to the accoicated workitem. The
AjaxFileUploadServlet injects this bean to provide new file data.
- Author:
- rsoika
- See Also:
-
AjaxFileUploadServlet.doPost
- Serialized Form
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttachedFile
(FileData filedata) This method is called by the AjaxFileUpload Servlet.returns the list of currently new attached files.getCID()
Returns the current conversation id.getFileSize
(String aFilename) get the file size for a given filename in human readable formatreturns the list of already persisted files.Setter method to get an instance of the current workitem the FileData should be stored.void
onWorkflowEvent
(WorkflowEvent workflowEvent) WorkflowEvent listenervoid
removeAttachedFile
(String aFilename) Removes a attached file object from the tmp list of uploaded files.void
removePersistedFile
(String aFilename) Removes a file object from a given workitem.void
reset()
reset the temp and persisted file variables.static double
round
(double value) helper method to round for 2 digits.void
setWorkitem
(ItemCollection workitem) This method set the current workitem and starts a new conversation.
-
Constructor Details
-
FileUploadController
public FileUploadController()
-
-
Method Details
-
getWorkitem
Setter method to get an instance of the current workitem the FileData should be stored.- Returns:
-
setWorkitem
This method set the current workitem and starts a new conversation. With this mechanism the fileUploadController bean can be used in multiple browser tabs or browser sessions.- Parameters:
workitem
-
-
getCID
Returns the current conversation id. This id is passed to the AjaxFileUploadServelt URIs so make sure that the correct FileUploadController is injected.- Returns:
-
onWorkflowEvent
WorkflowEvent listenerIf a new WorkItem was created the file upload will be reset.
- Parameters:
workflowEvent
-
-
addAttachedFile
This method is called by the AjaxFileUpload Servlet. The method adds the file to the workitem but also updates the list of temporary files, which are not yet persisted.- Parameters:
document
-aFilename
-
-
removeAttachedFile
Removes a attached file object from the tmp list of uploaded files.- Parameters:
sFilename
- - filename to be removed
-
removePersistedFile
Removes a file object from a given workitem. Here we operate on a given workitem as the imixsFileUpload.xhtml has no idea of he current conversation scoped controller.- Parameters:
sFilename
- - filename to be removed
-
getAttachedFiles
returns the list of currently new attached files. This list is not equal the $file item!- Returns:
-
getPersistedFiles
returns the list of already persisted files. This list is not equal the $file item!- Returns:
-
reset
public void reset()reset the temp and persisted file variables. -
getFileSize
get the file size for a given filename in human readable formatIn case the Imixs-Archive API is connected, the file size is stored in the attriubte 'size'
- Parameters:
sFilename
- - filename to be removed- Returns:
- - filsize in human readable string
-
round
public static double round(double value) helper method to round for 2 digits.- Parameters:
value
-places
-- Returns:
-