com.webmethods.caf.faces.data.task
Class TaskDisplayProvider

java.lang.Object
  extended by com.webmethods.caf.faces.bean.BaseFacesBean
      extended by com.webmethods.caf.faces.bean.BaseFacesSessionBean
          extended by com.webmethods.caf.faces.data.task.TaskDisplayProvider
All Implemented Interfaces:
IPageFlowScopeAdapter

public class TaskDisplayProvider
extends BaseFacesSessionBean

Helper class which assist in displaying various task properties


Field Summary
protected  PortalItemModel m_taskDefinition
          Task Type (definition)
protected  Map m_taskTypeMap
          Cached map of all task types and their names
protected  Map priorityMap
          Cached task priorities map
protected static Map s_statusIconMap
          Cached task statuses icons map
protected static String SKIN_IMAGE_PREFIX
           
protected  Map statusMap
          Cached task statuses map
protected  SelectItem[] taskPriorityItems
          Cached list of task priorities
protected  SelectItem[] taskStatusItems
          Cached list of task statuses
protected  SelectItem[] taskStatusItemsWithBlank
          Cached list of task statuses and empty entry
 
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
fExpireWithPageFlow
 
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
DATA_BINDING_CLIENTS, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
 
Constructor Summary
TaskDisplayProvider()
           
 
Method Summary
protected static ListTableContentProvider convertListToDisplayListProvider(String[] principalIDs)
          Converts list of principal IDs into ListTableContentProvider for displaying in the table
static ListTableContentProvider createListProvider(Map aMap)
          Helper method to create a ListTableContentProvider from a string map
static ListTableContentProvider createListProvider(String[] aString)
          Helper method to create a ListTableContentProvider from a string map
 ListTableContentProvider getAcceptedPrincipalsListProvider()
          Returns task accepted principals list as ListTableContentProvider (can be displayed in the table)
 ListTableContentProvider getAssignedPrincipalsListProvider()
          Returns task assigned principals list as ListTableContentProvider (can be displayed in the table)
protected  String getBoolDisplay(boolean boolValue)
          Returns a boolean value as a localized true/false display string
 String getCreatedByDisplayName()
          Returns the display string for task createdBy property
 Date getCreatedDate()
          Returns task created datetime
 String getCustomTaskID()
          Returns customTaskID property of task
 String getDelegatedDisplayName()
          Returns true if task is delegated
 Map getDelegationDisplayMap()
          Returns task delegations map populated with user display names instead of UIDs
 ListTableContentProvider getDelegationListProvider()
          Returns task delegation data as ListTableContentProvider for display in the table
 String getDescription()
          Returns taskDescription
 String getErrorCode()
          Returns task error code
 String getErrorMsg()
          Returns task error message
protected  String getErrorString()
          Returns localized value for "error"
 Date getExirationDate()
          Returns task expireDate
 Date getLastAcceptedDate()
          Returns task lastAcceptedDate
 String getLastAcceptedDisplayName()
          Returns display name for task lastAcceptedBy user
 Date getLastModifiedDate()
          Returns task lastModifiedDate datetime
 String getLastModifiedDisplayName()
          Returns display name for task lastModifiedBy user
 String getName()
          Returns taskName
static String getPrincipalDisplayName(String principalID)
          Returns principal display name based on its ID
protected static String getPrincipalName(String principalID)
          Returns name of the principal by ID
 String getPriorityDisplayName()
          Returns Task priority as a localized display string
 Map getPriorityMap()
          Returns map of task priorities and their names (priority -> name)
 String getProcessInstanceID()
          Returns processInstanceID property of task
 String getRunningIcon()
          Returns relative path to the icon representing the current task running status
 String getStatusDisplayName()
          Returns Task status as a localized display string
 String getStatusIcon()
          Returns relative path to the icon representing the current task status
protected  Map getStatusIconMap()
          Returns task statuses icons urls map (status -> url)
 Map getStatusMap()
          Returns map of task statuses and their names (status -> name)
 String getTaskID()
          Returns current task ID
 int getTaskIDNumber()
          Returns task ID as number (for sorting in the table)
 ITaskInfo getTaskInfo()
          Returns current task info
 SelectItem[] getTaskPriorityItems()
          Returns task priorities as list of SelectItem suitable for Dropdown controls
 SelectItem[] getTaskStatusItems()
          Returns task statuses as list of SelectItem suitable for Dropdown controls
 SelectItem[] getTaskStatusItemsWithBlank()
          Returns task statuses plus empty value as list of SelectItem suitable for Dropdown controls
 String getTaskTypeDisplayName()
          Returns display name for task type
 SelectItem[] getTaskTypeItems()
          Returns task types as list of SelectItem suitable for Dropdown controls
static Map getTaskTypeMap()
          Returns map of all availablel task types
protected  String getUnknownString()
          Returns localized value for "unknown"
 String isAcceptedByCurrentUser()
          Determines if the current task accepted by the current user, as a true/false String
 boolean isActiveStatus()
          Is the task considered "active" based on it's current status
 boolean isCanOpenProcessInstance()
          Determines if current user is allowed to open BPM Process Details page
 boolean isCollaborationEnabled()
          Returns true if collaboration is enabled for current task type
 boolean isCommentingEnabled()
          Returns true if commenting is enabled for the current task type
 boolean isDelegated()
          Returns true if task is delegated
 boolean isDelegatedFromCurrentUser()
          Returns true if the task is delegated from the current user
 boolean isDelegatedToCurrentUser()
          Returns true if the task is delegated to the current user
protected static SelectItem[] mapToSelectItems(Map sourceMap, boolean switchValues)
          Converts a map to an array of SelectItems
protected  void release()
          Override this method to release any resources associated with this session.
 void reset()
          Reset state to empty values
 void setTask(ITask task)
          Sets current task info from task
 void setTaskID(String taskID)
          Sets current task ID
 void setTaskInfo(ITaskInfo taskInfo)
          Sets current task info
static List translateIdListToDisplay(List principalIdList)
          Returns list of principal display names from the list of principal IDs
 
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound
 
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
createMethodBinding, createValueBinding, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_taskDefinition

protected PortalItemModel m_taskDefinition
Task Type (definition)


m_taskTypeMap

protected Map m_taskTypeMap
Cached map of all task types and their names


taskStatusItems

protected SelectItem[] taskStatusItems
Cached list of task statuses


taskStatusItemsWithBlank

protected SelectItem[] taskStatusItemsWithBlank
Cached list of task statuses and empty entry


taskPriorityItems

protected SelectItem[] taskPriorityItems
Cached list of task priorities


statusMap

protected Map statusMap
Cached task statuses map


priorityMap

protected Map priorityMap
Cached task priorities map


s_statusIconMap

protected static Map s_statusIconMap
Cached task statuses icons map


SKIN_IMAGE_PREFIX

protected static final String SKIN_IMAGE_PREFIX
See Also:
Constant Field Values
Constructor Detail

TaskDisplayProvider

public TaskDisplayProvider()
Method Detail

setTask

public void setTask(ITask task)
Sets current task info from task


setTaskInfo

public void setTaskInfo(ITaskInfo taskInfo)
Sets current task info


setTaskID

public void setTaskID(String taskID)
Sets current task ID


reset

public void reset()
Reset state to empty values


getTaskInfo

public ITaskInfo getTaskInfo()
Returns current task info


getTaskID

public String getTaskID()
Returns current task ID


getTaskIDNumber

public int getTaskIDNumber()
Returns task ID as number (for sorting in the table)


getCustomTaskID

public String getCustomTaskID()
Returns customTaskID property of task


getProcessInstanceID

public String getProcessInstanceID()
Returns processInstanceID property of task


getName

public String getName()
Returns taskName


getDescription

public String getDescription()
Returns taskDescription


getStatusDisplayName

public String getStatusDisplayName()
Returns Task status as a localized display string


getStatusIcon

public String getStatusIcon()
Returns relative path to the icon representing the current task status


getRunningIcon

public String getRunningIcon()
Returns relative path to the icon representing the current task running status


getPriorityDisplayName

public String getPriorityDisplayName()
Returns Task priority as a localized display string


getTaskTypeDisplayName

public String getTaskTypeDisplayName()
Returns display name for task type


isCanOpenProcessInstance

public boolean isCanOpenProcessInstance()
Determines if current user is allowed to open BPM Process Details page


isAcceptedByCurrentUser

public String isAcceptedByCurrentUser()
Determines if the current task accepted by the current user, as a true/false String


getDelegatedDisplayName

public String getDelegatedDisplayName()
Returns true if task is delegated


isDelegated

public boolean isDelegated()
Returns true if task is delegated


isCommentingEnabled

public boolean isCommentingEnabled()
                            throws Exception
Returns true if commenting is enabled for the current task type

Throws:
Exception

isCollaborationEnabled

public boolean isCollaborationEnabled()
                               throws Exception
Returns true if collaboration is enabled for current task type

Throws:
Exception

isDelegatedToCurrentUser

public boolean isDelegatedToCurrentUser()
Returns true if the task is delegated to the current user


isDelegatedFromCurrentUser

public boolean isDelegatedFromCurrentUser()
Returns true if the task is delegated from the current user


getCreatedDate

public Date getCreatedDate()
Returns task created datetime


getCreatedByDisplayName

public String getCreatedByDisplayName()
Returns the display string for task createdBy property


getLastModifiedDate

public Date getLastModifiedDate()
Returns task lastModifiedDate datetime


getLastAcceptedDate

public Date getLastAcceptedDate()
Returns task lastAcceptedDate


getLastModifiedDisplayName

public String getLastModifiedDisplayName()
Returns display name for task lastModifiedBy user


getLastAcceptedDisplayName

public String getLastAcceptedDisplayName()
Returns display name for task lastAcceptedBy user


getExirationDate

public Date getExirationDate()
Returns task expireDate


getAcceptedPrincipalsListProvider

public ListTableContentProvider getAcceptedPrincipalsListProvider()
Returns task accepted principals list as ListTableContentProvider (can be displayed in the table)


getAssignedPrincipalsListProvider

public ListTableContentProvider getAssignedPrincipalsListProvider()
Returns task assigned principals list as ListTableContentProvider (can be displayed in the table)


getPrincipalName

protected static String getPrincipalName(String principalID)
Returns name of the principal by ID


getBoolDisplay

protected String getBoolDisplay(boolean boolValue)
Returns a boolean value as a localized true/false display string


getUnknownString

protected String getUnknownString()
Returns localized value for "unknown"


getErrorString

protected String getErrorString()
Returns localized value for "error"


release

protected void release()
Override this method to release any resources associated with this session. Please note, the FacesContext is not valid for this function

Specified by:
release in class BaseFacesSessionBean

getStatusIconMap

protected Map getStatusIconMap()
Returns task statuses icons urls map (status -> url)


getStatusMap

public Map getStatusMap()
Returns map of task statuses and their names (status -> name)


getPriorityMap

public Map getPriorityMap()
Returns map of task priorities and their names (priority -> name)


getTaskTypeMap

public static Map getTaskTypeMap()
Returns map of all availablel task types


mapToSelectItems

protected static SelectItem[] mapToSelectItems(Map sourceMap,
                                               boolean switchValues)
Converts a map to an array of SelectItems

Parameters:
sourceMap - - the map to convert
switchValues - - true switch the key/value values in the created SelectItem
Returns:
- an array of SelectItems

convertListToDisplayListProvider

protected static ListTableContentProvider convertListToDisplayListProvider(String[] principalIDs)
Converts list of principal IDs into ListTableContentProvider for displaying in the table

Parameters:
principalIDs - list of principal IDs (names)

getTaskStatusItems

public SelectItem[] getTaskStatusItems()
Returns task statuses as list of SelectItem suitable for Dropdown controls


getTaskStatusItemsWithBlank

public SelectItem[] getTaskStatusItemsWithBlank()
Returns task statuses plus empty value as list of SelectItem suitable for Dropdown controls


getTaskPriorityItems

public SelectItem[] getTaskPriorityItems()
Returns task priorities as list of SelectItem suitable for Dropdown controls


getTaskTypeItems

public SelectItem[] getTaskTypeItems()
Returns task types as list of SelectItem suitable for Dropdown controls


isActiveStatus

public boolean isActiveStatus()
Is the task considered "active" based on it's current status


getErrorCode

public String getErrorCode()
Returns task error code


getErrorMsg

public String getErrorMsg()
Returns task error message


getDelegationDisplayMap

public Map getDelegationDisplayMap()
Returns task delegations map populated with user display names instead of UIDs


getDelegationListProvider

public ListTableContentProvider getDelegationListProvider()
Returns task delegation data as ListTableContentProvider for display in the table


createListProvider

public static ListTableContentProvider createListProvider(Map aMap)
Helper method to create a ListTableContentProvider from a string map


createListProvider

public static ListTableContentProvider createListProvider(String[] aString)
Helper method to create a ListTableContentProvider from a string map


getPrincipalDisplayName

public static String getPrincipalDisplayName(String principalID)
Returns principal display name based on its ID

Parameters:
principalID - principal ID
Returns:
display name (full name)

translateIdListToDisplay

public static List translateIdListToDisplay(List principalIdList)
Returns list of principal display names from the list of principal IDs

Parameters:
principalIdList - list of principal IDs
Returns:
list of principal display names