com.ibm.ccd.ui.mediator
Class WPCMediator

java.lang.Object
  extended by com.ibm.ccd.ui.mediator.WPCMediator
All Implemented Interfaces:
IWPCMediator

public class WPCMediator
extends java.lang.Object
implements IWPCMediator

Implementation for the interface IWPCMediator and provides the functional integration with WPC by exchaning and transforming the Business object from UI to xml for WPC and vice-versa. This is made as singleton class and do not support conversational instance information.


Field Summary
static java.lang.String COMP_NAME
           
 
Method Summary
 java.lang.String cloneItem(ICatalogItem item, WPSContext context)
          Creates the Item in WPC and returns the itemID(primary key)
 java.lang.String createItem(ICatalogItem item, WPSContext context)
          Creates the Item in WPC and returns the itemID(primary key)
 void deleteItem(ICatalogItem item, WPSContext context)
          Deletes the Item in WPC.
 void deleteItem(java.lang.String parentCgy, java.lang.String catalogID, java.lang.String itemID, WPSContext context)
          Deletes the Item in WPC.
 java.lang.String downloadItemDetails(CategoryHierarchy hierarchy, ICatalogItem catalogItem, java.lang.String[] headerInfor, java.lang.String[] itemPrimaryKey, WPSContext context)
          This Method is for downloading Item(s) from SingleItem or from Search results
 java.util.List getBusinessProcess(WPSContext context)
           
 java.util.List getBusinessProcess(WPSContext context, java.lang.String roleName)
           
 Node[] getCatalogChildren(java.lang.String parentCategory, java.lang.String catalogName, java.lang.String hierarchyName, java.lang.String heirarchyType, java.lang.String childrenSize, WPSContext context)
          returns the children of the catalog node,
 Node[] getCatalogChildren(java.lang.String parentID, WPSContext context)
          returns the children of the catalog node,
 ICatalogItem getCatalogItem(java.lang.String parentCgyID, java.lang.String catalogID, java.lang.String itemID, WPSContext context)
          Returns the CatalogItem for the given itemID,catalogID and parentCategory
 ICatalogItem getCatalogItem(java.lang.String parentCgyID, java.lang.String catalogID, WPSContext context)
          Returns the CatalogItem Spec.
 ICatalogItem getCatalogItemClone(ICatalogItem item, WPSContext context)
          Returns Clone of the CatalogItem for the given item
 ICatalogItem getCatalogItemClone(java.lang.String parentCgyID, java.lang.String catalogID, java.lang.String itemID, WPSContext context)
          Returns Clone of the CatalogItem for the given itemID,catalogID and parentCategory
 java.util.Map getCatalogItems(java.util.List idlist, java.lang.String catalogId, WPSContext context)
          Returns the List of CatalogItem Spec.
 CategoryHierarchy[] getCatalogs(WPSContext context)
          returns the first level of Hierarychy for the Catalogs
 CatalogViewMaster getCatalogView(java.lang.String catalogName, java.lang.String catalogViewName, WPSContext context)
           
 java.util.List getCatalogViewList(java.lang.String catalogName, WPSContext context)
          returs a list of CatalogViews for a given CatalogName
 java.lang.String getDefaultCatalog()
          This utility method has to be retained in the WPC Mediator.
 java.lang.Object getImageObject(FileDownloadResource resourceObj, WPSContext context)
          This method fetches Image stream from wpc for specific Item (GTNID) and attribute.
static WPCMediator getInstance()
          Returns the singleton instance of the Mediator.
 Attribute[] getLookupTableAttributes(java.lang.String lookupID, WPSContext context)
          Deprecated. same operationis done by getSearchAttributes() method. Returns the CatalogItem Spec. for the given catalogID and parentCategory
 Attribute[] getSearchAttributes(java.lang.String catalogId, WPSContext context)
           
 Attribute[] getSearchResultAttributes(java.lang.String catalogId, WPSContext context)
           
 java.util.Map getStepItems(WPSContext context, java.lang.String roleName, java.lang.String collabName, java.lang.String workflowName, java.lang.String stepName, PageNavigation pageNav, java.util.List attributeList)
           
 java.util.Map getStepItems(WPSContext context, java.lang.String roleName, java.lang.String collabName, java.lang.String workflowName, java.lang.String stepName, java.lang.String categoryFilter, PageNavigation pageNav, java.util.List attributeList)
           
 Workflow getSteps(WPSContext context, java.lang.String roleName, java.lang.String workflowName)
           
 java.util.List getTransactionsDetails(java.lang.String transactionId, WPCUser wpcUser)
          Used for fetching Transaction details and attachment
 java.util.Map getTransactionsStatus(java.lang.String[] transkeyArray, WPSContext context)
          Fetching the Transactions status from WPC
 java.util.List getUserRoles(WPSContext context)
           
 CatalogViewMaster getWorkFlowView(java.lang.String catalogName, java.lang.String workFlowName, java.lang.String stepName, WPSContext context)
           
 void init()
          Initializes the Mediator
 void performLookupTableSearch(SearchBean searchBean, WPSContext context)
           
 void performSearch(SearchBean searchBean, WPSContext context)
          Request WPC to perform the search
 void performSearchForMultiEdit(SearchBean searchBean, WPSContext context)
           
 void processAction(WPSContext context, WorkFlowTO workflowTo)
          For initiating the process Actions
 java.lang.String processUploadedFile(java.lang.String documentPath, java.lang.String collabName, WPSContext context)
          Request WPC to trigger uploaded file for an update.
 void updateItem(ICatalogItem item, WPSContext context)
          Updates the Item in WPC.
 java.lang.String uploadFile(Attachment attachment, WPSContext context)
          Uploads the file into WPC, and returns with the document path where the file has been uploaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMP_NAME

public static final java.lang.String COMP_NAME
See Also:
Constant Field Values
Method Detail

init

public void init()
Initializes the Mediator


getInstance

public static WPCMediator getInstance()
Returns the singleton instance of the Mediator.


getCatalogs

public CategoryHierarchy[] getCatalogs(WPSContext context)
                                throws WPCMediatorException
Description copied from interface: IWPCMediator
returns the first level of Hierarychy for the Catalogs

Specified by:
getCatalogs in interface IWPCMediator
Returns:
CategoryHeirarychy - array of hierarychy names and which catalog it belongs
Throws:
WPCMediatorException - in case of retrieval

getCatalogChildren

public Node[] getCatalogChildren(java.lang.String parentID,
                                 WPSContext context)
                          throws WPCMediatorException
returns the children of the catalog node,

Specified by:
getCatalogChildren in interface IWPCMediator
Parameters:
parentID - - parentNode ID of type String
Returns:
Node[] - representing the catalog node's first level children.
Throws:
WPCMediatorException - in case of retrieval errors
See Also:
IWPCMediator

getCatalogChildren

public Node[] getCatalogChildren(java.lang.String parentCategory,
                                 java.lang.String catalogName,
                                 java.lang.String hierarchyName,
                                 java.lang.String heirarchyType,
                                 java.lang.String childrenSize,
                                 WPSContext context)
                          throws WPCMediatorException
returns the children of the catalog node,

Specified by:
getCatalogChildren in interface IWPCMediator
Returns:
Node[] - representing the catalog node's first level children
Throws:
WPCMediatorException
See Also:
IWPCMediator

getCatalogItem

public ICatalogItem getCatalogItem(java.lang.String parentCgyID,
                                   java.lang.String catalogID,
                                   WPSContext context)
                            throws WPCMediatorException
Returns the CatalogItem Spec. for the given catalogID and parentCategory

Specified by:
getCatalogItem in interface IWPCMediator
Parameters:
parentCgyID - - Parent CategoryID of the catalog
catalogID - - category ID of the catalog
Returns:
ICatalogItem - representing the catalogSpec.
Throws:
WPCMediatorException - in case of retrieval errors
See Also:
IWPCMediator.getCatalogItem(String parentCgyID,String catalogID, WPSContext context)

getCatalogItem

public ICatalogItem getCatalogItem(java.lang.String parentCgyID,
                                   java.lang.String catalogID,
                                   java.lang.String itemID,
                                   WPSContext context)
                            throws WPCMediatorException
Returns the CatalogItem for the given itemID,catalogID and parentCategory

Specified by:
getCatalogItem in interface IWPCMediator
Parameters:
parentCgyID - - Parent CategoryID of the catalog
catalogID - - category ID of the catalog
itemID - - itemID (primaryKey)
Returns:
ICatalogItem
Throws:
WPCMediatorException - in case of retrieval errors
See Also:
IWPCMediator.getCatalogItem(String parentCgyID,String catalogID, String itemID, WPSContext context)

getCatalogViewList

public java.util.List getCatalogViewList(java.lang.String catalogName,
                                         WPSContext context)
                                  throws WPCMediatorException
returs a list of CatalogViews for a given CatalogName

Specified by:
getCatalogViewList in interface IWPCMediator
Parameters:
catalogName -
context -
Returns:
list
Throws:
WPCMediatorException

getCatalogView

public CatalogViewMaster getCatalogView(java.lang.String catalogName,
                                        java.lang.String catalogViewName,
                                        WPSContext context)
                                 throws WPCMediatorException
Specified by:
getCatalogView in interface IWPCMediator
Parameters:
catalogName -
catalogViewName -
context -
Returns:
catalogViewMaster
Throws:
WPCMediatorException

getWorkFlowView

public CatalogViewMaster getWorkFlowView(java.lang.String catalogName,
                                         java.lang.String workFlowName,
                                         java.lang.String stepName,
                                         WPSContext context)
                                  throws WPCMediatorException
Parameters:
workFlowName -
stepName -
context -
Returns:
catalogViewMaster
Throws:
WPCMediatorException

createItem

public java.lang.String createItem(ICatalogItem item,
                                   WPSContext context)
                            throws WPCMediatorException
Creates the Item in WPC and returns the itemID(primary key)

Specified by:
createItem in interface IWPCMediator
Parameters:
item - - of type ICatalogItem representing the item to create
Returns:
ItemID created(primarykey)
Throws:
WPCMediatorException - in case of creation errors/async. process
See Also:
IWPCMediator.createItem(ICatalogItem item, WPSContext context)

cloneItem

public java.lang.String cloneItem(ICatalogItem item,
                                  WPSContext context)
                           throws WPCMediatorException
Creates the Item in WPC and returns the itemID(primary key)

Throws:
WPCMediatorException

updateItem

public void updateItem(ICatalogItem item,
                       WPSContext context)
                throws WPCMediatorException
Updates the Item in WPC.

Specified by:
updateItem in interface IWPCMediator
Parameters:
item - - of type ICatalogItem representing the item to create
Throws:
WPCMediatorException - in case of updation errors/ async. process.
See Also:
IWPCMediator.updateItem(ICatalogItem item, WPSContext context)

deleteItem

public void deleteItem(ICatalogItem item,
                       WPSContext context)
                throws WPCMediatorException
Deletes the Item in WPC.

Specified by:
deleteItem in interface IWPCMediator
Parameters:
item - - of type ICatalogItem representing the item to create
Throws:
WPCMediatorException - in case of updation errors/ async. process.
See Also:
IWPCMediator.deleteItem(ICatalogItem item, WPSContext context)

deleteItem

public void deleteItem(java.lang.String parentCgy,
                       java.lang.String catalogID,
                       java.lang.String itemID,
                       WPSContext context)
                throws WPCMediatorException
Deletes the Item in WPC.

Specified by:
deleteItem in interface IWPCMediator
catalogID - - category ID of the catalog
itemID - - itemID (primaryKey)
Throws:
WPCMediatorException - in case of updation errors/ async. process.
See Also:
IWPCMediator.deleteItem(String parentCgy, String catalogID,String itemID, WPSContext context)

getCatalogItemClone

public ICatalogItem getCatalogItemClone(ICatalogItem item,
                                        WPSContext context)
                                 throws WPCMediatorException
Returns Clone of the CatalogItem for the given item

Specified by:
getCatalogItemClone in interface IWPCMediator
Throws:
WPCMediatorException
See Also:
IWPCMediator.getCatalogItemClone(ICatalogItem item,WPSContext context)

getCatalogItemClone

public ICatalogItem getCatalogItemClone(java.lang.String parentCgyID,
                                        java.lang.String catalogID,
                                        java.lang.String itemID,
                                        WPSContext context)
                                 throws WPCMediatorException
Returns Clone of the CatalogItem for the given itemID,catalogID and parentCategory

Specified by:
getCatalogItemClone in interface IWPCMediator
Throws:
WPCMediatorException
See Also:
IWPCMediator.getCatalogItemClone(String parentCgyID,String catalogID, String itemID, WPSContext context)

uploadFile

public java.lang.String uploadFile(Attachment attachment,
                                   WPSContext context)
                            throws WPCMediatorException
Uploads the file into WPC, and returns with the document path where the file has been uploaded.

Specified by:
uploadFile in interface IWPCMediator
Parameters:
attachment - - file to upload as an Attachment type
Returns:
document path where the file has been uploaded. of type String
Throws:
WPCMediatorException - in case of updation errors/ async. process.
See Also:
IWPCMediator.uploadFile(Attachment attachment, WPSContext context)

processUploadedFile

public java.lang.String processUploadedFile(java.lang.String documentPath,
                                            java.lang.String collabName,
                                            WPSContext context)
                                     throws WPCMediatorException
Request WPC to trigger uploaded file for an update.

Specified by:
processUploadedFile in interface IWPCMediator
Parameters:
documentPath - - path to the file to be updated in the WPC
Returns:
transaction ID.
Throws:
WPCMediatorException - in case of updation errors/ async. process.
See Also:
IWPCMediator.processUploadedFile(String documentPath,String collabName, WPSContext context)

performSearch

public void performSearch(SearchBean searchBean,
                          WPSContext context)
                   throws WPCMediatorException
Request WPC to perform the search

Specified by:
performSearch in interface IWPCMediator
Parameters:
searchBean - - provides the searchcritera and filled with the search results
Throws:
WPCMediatorException - in case of updation errors/ async. process.
See Also:
IWPCMediator.performSearch(SearchBean searchBean, WPSContext context)

performSearchForMultiEdit

public void performSearchForMultiEdit(SearchBean searchBean,
                                      WPSContext context)
                               throws WPCMediatorException
Parameters:
searchBean -
context -
Throws:
WPCMediatorException

performLookupTableSearch

public void performLookupTableSearch(SearchBean searchBean,
                                     WPSContext context)
                              throws WPCMediatorException
Throws:
WPCMediatorException

getTransactionsStatus

public java.util.Map getTransactionsStatus(java.lang.String[] transkeyArray,
                                           WPSContext context)
                                    throws WPCMediatorException
Fetching the Transactions status from WPC

Specified by:
getTransactionsStatus in interface IWPCMediator
Parameters:
transkeyArray -
context -
Returns:
map
Throws:
WPCMediatorException

getTransactionsDetails

public java.util.List getTransactionsDetails(java.lang.String transactionId,
                                             WPCUser wpcUser)
                                      throws WPCMediatorException
Used for fetching Transaction details and attachment

Specified by:
getTransactionsDetails in interface IWPCMediator
Parameters:
transactionId -
wpcUser -
Returns:
list
Throws:
WPCMediatorException

getCatalogItems

public java.util.Map getCatalogItems(java.util.List idlist,
                                     java.lang.String catalogId,
                                     WPSContext context)
                              throws WPCMediatorException
Returns the List of CatalogItem Spec. for the given array of comman separated catalogID

Parameters:
idlist -
catalogId -
context -
Returns:
map
Throws:
WPCMediatorException

getDefaultCatalog

public java.lang.String getDefaultCatalog()
Description copied from interface: IWPCMediator
This utility method has to be retained in the WPC Mediator. Currently there is only one catalog which needs to be pre-configured for deployment at a client-site. This method and a whole slew of functionality can be created in the Mediator to return the current catalog that a user needs to work with, in the case that there are multiple catalogs to be deployed at a client-site

Specified by:
getDefaultCatalog in interface IWPCMediator
Returns:
String representing the Catalog ID. For example, "CTG_PORTAL_MASTER"
See Also:
IWPCMediator

getImageObject

public java.lang.Object getImageObject(FileDownloadResource resourceObj,
                                       WPSContext context)
                                throws WPCMediatorException
Description copied from interface: IWPCMediator
This method fetches Image stream from wpc for specific Item (GTNID) and attribute.

Specified by:
getImageObject in interface IWPCMediator
Parameters:
resourceObj -
context -
Returns:
object
Throws:
WPCMediatorException

downloadItemDetails

public java.lang.String downloadItemDetails(CategoryHierarchy hierarchy,
                                            ICatalogItem catalogItem,
                                            java.lang.String[] headerInfor,
                                            java.lang.String[] itemPrimaryKey,
                                            WPSContext context)
                                     throws WPCMediatorException
Description copied from interface: IWPCMediator
This Method is for downloading Item(s) from SingleItem or from Search results

Specified by:
downloadItemDetails in interface IWPCMediator
Returns:
string
Throws:
WPCMediatorException
See Also:
IWPCMediator.downloadItemDetails(CategoryHierarchy hierarchy,ICatalogItem catalogItem, String[] headerInfor,String[] itemPrimaryKey, WPSContext context)

getUserRoles

public java.util.List getUserRoles(WPSContext context)
                            throws WPCMediatorException
Specified by:
getUserRoles in interface IWPCMediator
Parameters:
context -
Returns:
list
Throws:
WPCMediatorException

getBusinessProcess

public java.util.List getBusinessProcess(WPSContext context,
                                         java.lang.String roleName)
                                  throws WPCMediatorException
Specified by:
getBusinessProcess in interface IWPCMediator
Parameters:
context -
roleName -
Returns:
list
Throws:
WPCMediatorException

getBusinessProcess

public java.util.List getBusinessProcess(WPSContext context)
                                  throws WPCMediatorException
Specified by:
getBusinessProcess in interface IWPCMediator
Parameters:
context -
Returns:
list
Throws:
WPCMediatorException

getSteps

public Workflow getSteps(WPSContext context,
                         java.lang.String roleName,
                         java.lang.String workflowName)
                  throws WPCMediatorException
Specified by:
getSteps in interface IWPCMediator
Parameters:
context -
roleName -
workflowName -
Returns:
workflow
Throws:
WPCMediatorException

getStepItems

public java.util.Map getStepItems(WPSContext context,
                                  java.lang.String roleName,
                                  java.lang.String collabName,
                                  java.lang.String workflowName,
                                  java.lang.String stepName,
                                  java.lang.String categoryFilter,
                                  PageNavigation pageNav,
                                  java.util.List attributeList)
                           throws WPCMediatorException
Parameters:
context -
roleName -
collabName -
workflowName -
stepName -
categoryFilter -
pageNav -
Returns:
map
Throws:
WPCMediatorException

getStepItems

public java.util.Map getStepItems(WPSContext context,
                                  java.lang.String roleName,
                                  java.lang.String collabName,
                                  java.lang.String workflowName,
                                  java.lang.String stepName,
                                  PageNavigation pageNav,
                                  java.util.List attributeList)
                           throws WPCMediatorException
Parameters:
context -
roleName -
collabName -
workflowName -
stepName -
pageNav -
Returns:
map
Throws:
WPCMediatorException

processAction

public void processAction(WPSContext context,
                          WorkFlowTO workflowTo)
                   throws WPCMediatorException
For initiating the process Actions

Specified by:
processAction in interface IWPCMediator
Parameters:
context -
workflowTo -
Throws:
WPCMediatorException

getSearchAttributes

public Attribute[] getSearchAttributes(java.lang.String catalogId,
                                       WPSContext context)
                                throws WPCMediatorException
Throws:
WPCMediatorException

getLookupTableAttributes

public Attribute[] getLookupTableAttributes(java.lang.String lookupID,
                                            WPSContext context)
                                     throws WPCMediatorException
Deprecated. same operationis done by getSearchAttributes() method. Returns the CatalogItem Spec. for the given catalogID and parentCategory

Throws:
WPCMediatorException

getSearchResultAttributes

public Attribute[] getSearchResultAttributes(java.lang.String catalogId,
                                             WPSContext context)
                                      throws WPCMediatorException
Throws:
WPCMediatorException