org.imixs.workflow.jee.faces
Class BLOBWorkitemController

java.lang.Object
  extended by org.imixs.workflow.jee.faces.BLOBWorkitemController

public class BLOBWorkitemController
extends Object

This BLOBWorkitemController is used to store large objects into a single ItemCollection mapped to a EntityBean. The BLOBWorkitemController supports also the management of file attachment inside an ItemCollection. So the BLOBWorkitemController can be used to save large data objects or files into a Workitem (called BlobWorkitems). The BlobWorkitem is always bounded to a parent workitem by its referrer id ($uniqueidRef). An application can implement a lazy loading for BLOBWorkitems. The read- and write access settings of BLOBWorkitems are always synchronized to the settings of the parent workitem. Before the BlobWorkitem can be accessed the workitem needs to be loaded by the load() method. The Data can be accessed by the embedded Itemcollection through the method getWorkitem(). The BlobWorkitem can be saved by calling the save() method. Both - the load() and the save() method expect the Parent ItemCollection where the BlobWorkitem should be bound to.

Version:
0.0.1
Author:
rsoika

Constructor Summary
BLOBWorkitemController()
           
 
Method Summary
 void addFile(byte[] data, String fileName, String contentType)
          This method adds a single file to the ItemCollection. files will be stored into the property $file.
 void clear()
          Removes the connection to the parend workitem and clear the itemCollection
 Vector<String> getFileList()
          Returns a Vector of file names attached to the current BlobWorkitem.
 String[] getFiles()
          Returns a list of file names attached to the current BlobWorkitem.
 org.imixs.workflow.ItemCollection getWorkitem()
          returns the ItemCollection for the curren BlobWorkitem object.
 void load(org.imixs.workflow.ItemCollection itemCol)
          Loads the BlobWorkitem of a given parent Workitem.
 void removeFile(String aFilename)
          This method removes a single file attachment from the BlobWorkitem
 void save(org.imixs.workflow.ItemCollection parentWorkitem)
          This method saves the current BlobWorkitem.
 void setWorkitem(org.imixs.workflow.ItemCollection aItemcol)
          update the workitemAdapter and the blobworkitem reference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BLOBWorkitemController

public BLOBWorkitemController()
Method Detail

setWorkitem

public void setWorkitem(org.imixs.workflow.ItemCollection aItemcol)
update the workitemAdapter and the blobworkitem reference

Parameters:
aItemcol -

getWorkitem

public org.imixs.workflow.ItemCollection getWorkitem()
returns the ItemCollection for the curren BlobWorkitem object.

Returns:

getFiles

public String[] getFiles()
Returns a list of file names attached to the current BlobWorkitem. File Attachments can be added using the method addFile().

Returns:

getFileList

public Vector<String> getFileList()
Returns a Vector of file names attached to the current BlobWorkitem.

Returns:

clear

public void clear()
Removes the connection to the parend workitem and clear the itemCollection


save

public void save(org.imixs.workflow.ItemCollection parentWorkitem)
          throws Exception
This method saves the current BlobWorkitem. Therefore the method copies the read- and write access list from the given parent workitem into the BlobWorkitem before save. So this method should be called after a WorkflowProcessing step to update the read- and write access identically to the parentWorkitem

The method did not save the blobWorkitem if the parent workitem has no $unqiueID!

Throws:
Exception

addFile

public void addFile(byte[] data,
                    String fileName,
                    String contentType)
             throws Exception
This method adds a single file to the ItemCollection. files will be stored into the property $file.

Parameters:
data - - byte array with file data
fileName - - name of the file attachment
contentType - - the contenttype (e.g. 'Text/HTML')
Throws:
Exception

removeFile

public void removeFile(String aFilename)
                throws Exception
This method removes a single file attachment from the BlobWorkitem

Throws:
Exception

load

public void load(org.imixs.workflow.ItemCollection itemCol)
          throws Exception
Loads the BlobWorkitem of a given parent Workitem. The BlobWorkitem is identified by the $unqiueidRef. If no BlobWorkitem still exists the method creates a new empty BlobWorkitem which can be saved later.

Parameters:
itemCol - - parent workitem where the BlobWorkitem will be attached to
Throws:
Exception


Copyright © 2006-2011 Imixs Software Solutions GmbH. All Rights Reserved.