org.imixs.workflow.jee.jsf.util
Class BLOBWorkitemController

java.lang.Object
  extended by org.imixs.workflow.jee.jsf.util.BLOBWorkitemController

public class BLOBWorkitemController
extends java.lang.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 into a Workitem (called BlobWorkitems). The BlobWorkitem is always bounded to a parent workitem by its referrer id ($uniqueidRef). So 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.

Version:
0.0.1
Author:
rsoika

Field Summary
protected  org.imixs.workflow.util.ItemCollectionAdapter workitemAdapter
           
 
Constructor Summary
BLOBWorkitemController()
           
 
Method Summary
 void addFile(byte[] data, java.lang.String fileName, java.lang.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
 java.lang.String[] getFiles()
          Returns a list of file names attached to the current BlobWorkitem.
 java.util.Map getItem()
          returns a workitemAdapter Item field
 java.util.Map getItemList()
          returns a workitemAdapter ItemList
 java.util.Map getItemListArray()
          returns a workitemAdapter ItemList Array
 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(java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workitemAdapter

protected org.imixs.workflow.util.ItemCollectionAdapter workitemAdapter
Constructor Detail

BLOBWorkitemController

public BLOBWorkitemController()
Method Detail

getWorkitem

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

Returns:

getFiles

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

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 java.lang.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

Throws:
java.lang.Exception

addFile

public void addFile(byte[] data,
                    java.lang.String fileName,
                    java.lang.String contentType)
             throws java.lang.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:
java.lang.Exception

removeFile

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

Throws:
java.lang.Exception

load

public void load(org.imixs.workflow.ItemCollection itemCol)
          throws java.lang.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:
java.lang.Exception

getItem

public java.util.Map getItem()
                      throws java.lang.Exception
returns a workitemAdapter Item field

Returns:
Throws:
java.lang.Exception

getItemList

public java.util.Map getItemList()
                          throws java.lang.Exception
returns a workitemAdapter ItemList

Returns:
Throws:
java.lang.Exception

getItemListArray

public java.util.Map getItemListArray()
                               throws java.lang.Exception
returns a workitemAdapter ItemList Array

Returns:
Throws:
java.lang.Exception


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