|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.beehive.netui.pageflow.PageFlowManagedObject
org.apache.beehive.netui.pageflow.FlowController
org.apache.beehive.netui.pageflow.PageFlowController
com.bea.wli.worklist.portal.TaskUIPageFlowController
public abstract class TaskUIPageFlowController
Base class for custom task UI page flows. This controller maintains a 'context' task and information about that task. This makes it easier for custom task UI controllers to focus on their value-added logic and not just maintaining context information about the task they are editing.
This base class defines a number of 'action helper' methods that are intended to be called from action methods on a custom task UI controller. These methods are named according to the convention '<action name>ActionHelper'. You should call these methods early in the action method for which they are named. These helpers keep the state for the 'context' task in sync.
In particular, this controller defines a number of action helpers for taking
actions on the context task. These actions simplify the process of displaying
a page to accept action property values, and then to actually take the action
on the context task.
Additionally, this controller defines a number of action helpers for
editing user-define properties on a task using the Worklist property editor
tag and the built-in property editors for JavaBean/XMLBean/Text properties.
These helpers greatly simplify the editing of these types of user-defined
properties.
Field Summary | |
---|---|
protected SimpleDateFormat |
_dateFormat
SimpleDateFormat instance to be used as the format for obtaining date/time instances as values for system properties. |
protected TakeStepActionActionForm |
_takeStepActionActionForm
The TakeStepActionActionForm instance representing the properties and other data needed to take an action on the context task. |
protected TaskData |
_taskDataHistory
TaskData for the 'context' task at some date in the past. |
protected TaskEventHistory[] |
_taskHistoryRecords
Current Task's History. |
protected UpdateActionForm |
_updateActionForm
The UpdateActionForm containing the up-to-date and editable form of the data for the 'context' task. |
Fields inherited from class org.apache.beehive.netui.pageflow.FlowController |
---|
defaultLocale |
Fields inherited from interface org.apache.beehive.netui.pageflow.internal.InternalConstants |
---|
ACTION_EXTENSION_LEN, ACTION_OVERRIDE_PREFIX, ANNOTATION_QUALIFIER, ATTR_PREFIX, BACKING_CLASS_IMPLICIT_OBJECT, BEGIN_ACTION_PATH, CURRENT_JPF_ATTR, CURRENT_LONGLIVED_ATTR, FACES_BACKING_ATTR, FACES_BACKING_EXTENSION, FACES_EXTENSION, FACES_EXTENSION_DOT, GLOBALAPP_CLASSNAME, GLOBALAPP_MEMBER_NAME, GLOBALAPP_MODULE_CONTEXT_PATH, INTERNAL_VAR_PREFIX, JSF_EXTENSION, JSF_EXTENSION_DOT, MESSAGE_IS_EXPRESSION_PREFIX, MESSAGE_IS_EXPRESSION_PREFIX_LENGTH, NETUI_CONFIG_PATH, RETURN_ACTION_VIEW_RENDERER_PARAM, RETURNING_FORM_ATTR, RETURNING_FROM_NESTING_ATTR, SHARED_FLOW_ATTR_PREFIX, SHARED_FLOW_EXTENSION, SHARED_FLOW_MODULE_PREFIX, SHARED_FLOW_MODULE_PREFIX_LEN, SHARED_FLOW_ROOT_MODULE, WEBINF_DIR |
Constructor Summary | |
---|---|
protected |
TaskUIPageFlowController()
|
Method Summary | |
---|---|
String |
assigneeListToString(Assignee assignee)
Get a formatted string value for the given Assignee object. |
protected abstract Forward |
begin()
The begin action for this controller. |
protected void |
beginActionHelper()
Initializes the TaskUIContextInfo maintained by this controller (and is accessed via several of the getters and helpers on this controller). |
protected void |
cancelPropActionHelper()
Cancels the editing session for the 'active' property set in a call to editPropActionHelper, and discards an value that may have existed in the stand-alone editor. |
protected void |
cancelStepActionActionHelper()
Cancel any pending step action you prepared for with a call to showStepActionActionHelper(). |
protected void |
cancelUpdateActionHelper()
Helper method used to step down from a proposed update to a task started with updateActionHelper. |
boolean |
canClaimTask(TaskData data)
Returns true if the current user is not the current claimant of the task and is an assignee. |
boolean |
canUpdate(TaskData data,
com.bea.wli.worklist.userportal.TaskField name)
Check low-level (specific) rights to update a particular field based on current users affinity. |
boolean |
canUserUpdateTask(TaskData data)
Check at high-level if the task is update-able and the current user can update it. |
boolean |
canWorkOnTask(TaskData data)
Returns true if the current user is allowed to work on the task. |
protected TakeStepActionActionForm |
createTakeStepActionActionForm()
Factory method that can be overridden to create a subclass of TakeStepActionActionForm. |
protected UpdateActionForm |
createUpdateActionForm()
Factory method that can be overridden to create a subclass of UpdateActionForm. |
protected void |
doPostPrepareRequestAttributes()
Set any final attributes required in the HttpRequest to properly render the task and/or step pages for this task. |
protected void |
doPostRefreshTask()
Extensibility method that is called at the end of refreshTask, allowing subclasses to do any work needed on the newly refreshed task state. |
protected void |
doPostShowTakeStepActionAction()
Utility method called at the end of showTakeStepActionActionHelper. |
protected Forward |
editPropActionHelper(PropertyInstanceHolder[] properties)
This method is used to begin a session of editing property values using a PropertyEditorHelper embedded in this controller. |
protected TaskUIContextInfo |
getContextInfo()
Get the context this task UI is operating in. |
protected Step |
getCurrentStep()
Get the current step for the context task. |
StepDisplayInfo |
getCurrentStepDisplayInfo()
Get the StepDisplayInfo for the 'context' task. |
DateFormat |
getDateFormat()
Get the DateFormat that defines the format for date/time values used in system properties for the context task. |
String |
getDateFormatLocalizedPattern()
Get a localized date example using the DateFormat given by getDateFormat(). |
String |
getDoneActionContext()
|
String |
getDoneActionLabel()
|
Map<String,PropertyInstance> |
getMandatoryTaskProperties(Step step,
StepAction stepAction)
Get a map of the required properties for the given action on the context task. |
protected PropertyEditorHelper |
getPropertyEditorHelper()
Get a PropertyEditorHelper to assist you in editing task properties in a web UI. |
protected PropertyInstanceHolder |
getPropertyInstanceHolder(PropertyRef ref,
PropertyInstanceHolder[] props)
Get a PropertyInstanceHolder instance, from the given array, that matches the property indicated in the given PropertyRef. |
protected PropertyInstanceHolder |
getPropertyInstanceHolder(String name)
Gets a named PropertyInstanceHolder from the update action form populated on the last call to refreshTask. |
StepActionDisplayInfo[] |
getStepActions()
Get the StepActionDisplayInfo objects for all actions available on the current step for the 'context' task. |
protected TakeStepActionActionForm |
getTakeStepActionActionForm()
|
String |
getTaskAdminStateStr()
Get a string representation of the admin state for the 'context' task. |
TaskData |
getTaskData()
Get the TaskData instance for the 'context' task. |
TaskData |
getTaskDataHistory()
Get the TaskData for the 'context' task at a pre-determined time in the past. |
Map<String,PropertyInstanceHolder> |
getTaskEditablePropertiesMap()
Return a map of all the editable properties on the context task (keyed by the property name). |
TaskEventHistory[] |
getTaskHistory()
Get an array of TaskEventHistory objects representing the historical events that have been tracked for the 'context' task on this controller. |
String |
getTaskHistoryAssigneeListAsString()
Get the assignee list on the 'context' task at a pre-determined date in the past. |
StepDisplayInfo |
getTaskHistoryStepDisplayInfo()
Get the StepDisplayInfo for the current step as indicated by the getTaskDataHistory() method. |
List<PropertyInstance> |
getTaskHistoryUserPropertiesList()
Return a list of user-defined properties for the context task at a pre-determined date in the past. |
TaskListViewInfo[] |
getTaskListViews()
|
protected TaskPlan |
getTaskPlan()
Get the TaskPlan for the 'context' task for this controller. |
TaskPlanDisplayInfo |
getTaskPlanDisplayInfo()
Get the TaskPlanDisplayInfo for the 'context' task. |
Map<String,PropertyInstance> |
getTaskPropertiesMap()
Return a map of all the properties on the context task (keyed by the property name). |
List<PropertyInstance> |
getTaskUserPropertiesList()
Return a list of user-defined properties for the context task. |
String |
getTaskWorkingStateStr()
Get a string representation of the working state for the 'context' task. |
protected WorklistUIContextHelper |
getUIContextHelper()
Get a helper object for fetching properties out of the session context. |
protected UpdateActionForm |
getUpdateActionForm()
|
String |
getUserName()
|
protected WorklistTaskAdmin |
getWorklistTaskAdmin()
Get a WorklistTaskAdmin instance that can be used to perform admin-level actions against the 'context' task for this controller. |
protected WorklistTaskUser |
getWorklistTaskUser()
Get a WorklistTaskUser instance that can be used to perform user-level actions against the 'context' task for this controller. |
protected boolean |
isPostActionInteractiveAssignment(String actionName)
Called before taking an action on a task to determine if interactive assignment should be invoked based on the target step for the action. |
boolean |
isTaskClaimed(TaskData data)
Is the given task in the claimed working state. |
boolean |
isTaskClaimedByCurrentUser(TaskData data)
Is the given task claimed by the user given by the getUserName() method? |
boolean |
isTaskEditable(TaskData data)
Is the given task in an editable admin state?. |
boolean |
isTaskHistoryEnabled(TaskData taskData)
Indicates whether there is a TaskHistoryProvider available for the current Worklist system instance. |
boolean |
isTaskPlan81x(TaskData taskData)
Deprecated. Will be removed when other 8.1.x compatibility features are removed. |
boolean |
isUserAdmin(TaskData data)
Returns true if the current user is an assignee for the task. |
boolean |
isUserAssignee(TaskData data)
Returns true if the current user is an assignee for the task. |
boolean |
isUserOwner(TaskData data)
Returns true if the current user is an assignee for the task. |
protected void |
okPropActionHelper(EditorValueHolder value)
Completes the editing session for the 'active' property set in a call to editPropActionHelper, and applies the given EditorValueHolder's value back to the active property. |
protected void |
prepareRequestAttributes()
Loads the request with a number of state attributes indicating what general-purpose actions are allowed. |
protected Forward |
refreshAction()
Called to verify the state of the task UI matches the requested task id. |
protected void |
refreshTask()
Refreshes the information for the context task, and load it into the UpdateActionForm property for this controller. |
protected void |
setTakeStepActionActionForm(TakeStepActionActionForm form)
|
protected void |
setUpdateActionForm(UpdateActionForm form)
|
protected void |
showStepActionActionHelper(StepAction action)
Helper method that can be called from an action that is used to show a page for collecting properties needed to take an action. |
protected Forward |
showTaskListAction()
Optional exit point that will branch the UI flow back to the calling page flow and display the task list view indicated by the view HTTP request parameter. |
protected void |
takeStepAction(String stepName,
String actionName,
Map<String,String> propMap)
A simple method to take an action on a task, given the step, action name, and properties for the action. |
protected void |
takeStepActionActionHelper(TakeStepActionActionForm form)
Helper that takes an action at the current step given the information in a TakeStepActionActionForm instance. |
protected void |
takeStepActionAndClaim(String stepName,
String actionName,
Map<String,String> propMap,
String postActionClaimant)
A simple method to take an action on a task, given the step, action name, properties for the action, and the name of the user that should be made the claimant of this task after the action has been performed. |
protected void |
takeStepActionAndClaimActionHelper(TakeStepActionActionForm form,
String postActionClaimant)
Helper that takes an action at the current step given the information in a TakeStepActionActionForm instance and the name of the user that should be made the claimant of the task following the action. |
protected void |
updateActionHelper(UpdateActionForm form)
Helper method to assist subclasses in updating a task based on information collected in the UpdateActionForm. |
Methods inherited from class org.apache.beehive.netui.pageflow.PageFlowManagedObject |
---|
fieldIsUninitialized, getCreateTime, getServletContext, initializeField, valueBound |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SimpleDateFormat _dateFormat
getDateFormat()
protected UpdateActionForm _updateActionForm
getUpdateActionForm()
protected TakeStepActionActionForm _takeStepActionActionForm
showStepActionActionHelper(com.bea.wli.worklist.api.taskplan.StepAction)
,
getTakeStepActionActionForm()
protected TaskEventHistory[] _taskHistoryRecords
getTaskHistory()
protected TaskData _taskDataHistory
getTaskDataHistory()
Constructor Detail |
---|
protected TaskUIPageFlowController()
Method Detail |
---|
protected UpdateActionForm getUpdateActionForm()
protected void setUpdateActionForm(UpdateActionForm form)
protected TakeStepActionActionForm getTakeStepActionActionForm()
protected void setTakeStepActionActionForm(TakeStepActionActionForm form)
public String getDoneActionContext()
public String getDoneActionLabel()
public String getUserName()
public TaskListViewInfo[] getTaskListViews()
public DateFormat getDateFormat()
public String getDateFormatLocalizedPattern()
getDateFormat()
public TaskData getTaskData()
public String getTaskAdminStateStr()
public String getTaskWorkingStateStr()
public TaskPlanDisplayInfo getTaskPlanDisplayInfo() throws ManagementException
ManagementException
- If any error occurs retrieving the task plan
for the context task.public StepDisplayInfo getCurrentStepDisplayInfo() throws ManagementException
ManagementException
- If any error occurs retrieving the task plan
for the context task.public StepActionDisplayInfo[] getStepActions() throws ManagementException
ManagementException
- If any error occurs retrieving the task plan
for the context task.public Map<String,PropertyInstance> getTaskPropertiesMap() throws ManagementException
ManagementException
public Map<String,PropertyInstanceHolder> getTaskEditablePropertiesMap()
public List<PropertyInstance> getTaskUserPropertiesList() throws ManagementException
ManagementException
public Map<String,PropertyInstance> getMandatoryTaskProperties(Step step, StepAction stepAction) throws ManagementException
step
- The step for which the action appliesstepAction
- The action for which required properties are being
requested.
ManagementException
public String assigneeListToString(Assignee assignee)
public boolean isTaskEditable(TaskData data)
public boolean isTaskClaimed(TaskData data)
public boolean isTaskClaimedByCurrentUser(TaskData data)
public boolean canWorkOnTask(TaskData data) throws ManagementException
ManagementException
public boolean canClaimTask(TaskData data) throws ManagementException
ManagementException
public boolean isUserAssignee(TaskData data) throws ManagementException
ManagementException
public boolean isUserOwner(TaskData data) throws ManagementException
ManagementException
public boolean isUserAdmin(TaskData data) throws ManagementException
ManagementException
public boolean canUserUpdateTask(TaskData data) throws ManagementException
data
-
ManagementException
public boolean canUpdate(TaskData data, com.bea.wli.worklist.userportal.TaskField name) throws ManagementException
data
- name
-
ManagementException
public boolean isTaskHistoryEnabled(TaskData taskData) throws ManagementException, RemoteException
taskData
- The TaskData from a task that will be used to identify
the Worklist system instance to be checked for task history
providers.
ManagementException
- If any error occurs accessing the task plan
for the task or provider information.
RemoteException
- If a communication error occurs.@Deprecated public boolean isTaskPlan81x(TaskData taskData) throws ManagementException, RemoteException
taskData
- The TaskData for the task that is being checked.
ManagementException
RemoteException
public TaskEventHistory[] getTaskHistory()
public TaskData getTaskDataHistory()
public StepDisplayInfo getTaskHistoryStepDisplayInfo() throws ManagementException
ManagementException
- If any error occurs retrieving the task
plan for this task.public List<PropertyInstance> getTaskHistoryUserPropertiesList() throws ManagementException
ManagementException
- If any error occurs retrieving the task
plan for this task.public String getTaskHistoryAssigneeListAsString()
protected WorklistUIContextHelper getUIContextHelper()
protected TaskUIContextInfo getContextInfo()
protected WorklistTaskUser getWorklistTaskUser() throws ManagementException, RemoteException
ManagementException
RemoteException
protected WorklistTaskAdmin getWorklistTaskAdmin() throws ManagementException, RemoteException
ManagementException
RemoteException
protected TaskPlan getTaskPlan() throws ManagementException
ManagementException
protected UpdateActionForm createUpdateActionForm()
refreshTask()
protected void refreshTask() throws ManagementException
ManagementException
doPostPrepareRequestAttributes()
,
doPostRefreshTask()
protected void doPostRefreshTask() throws ManagementException
ManagementException
protected PropertyInstanceHolder getPropertyInstanceHolder(PropertyRef ref, PropertyInstanceHolder[] props)
protected PropertyInstanceHolder getPropertyInstanceHolder(String name)
name
- Name of the property to return.
IllegalStateException
- if the property is not found.protected void prepareRequestAttributes()
protected void doPostPrepareRequestAttributes()
protected Step getCurrentStep() throws ManagementException
ManagementException
- If any error occurs retrieving the task plan
for the context task.protected PropertyEditorHelper getPropertyEditorHelper()
protected abstract Forward begin() throws Exception
Exception
protected void beginActionHelper() throws ManagementException
ManagementException
protected Forward refreshAction()
protected Forward editPropActionHelper(PropertyInstanceHolder[] properties) throws ManagementException, DataTypeException
properties
- The PropertyInstanceHolders the current operation is
managing. This can be all the properties on the task, or just the
properties needed for an action.
ManagementException
DataTypeException
UpdateActionForm.getProperties()
,
TakeStepActionActionForm.getProperties()
protected void okPropActionHelper(EditorValueHolder value) throws DataTypeException
value
- The newly edited/accepted value
DataTypeException
protected void cancelPropActionHelper()
protected TakeStepActionActionForm createTakeStepActionActionForm()
showStepActionActionHelper(com.bea.wli.worklist.api.taskplan.StepAction)
protected void showStepActionActionHelper(StepAction action) throws ManagementException, DataTypeException
This method calls doPostShowTakeStepActionAction() at its end to allow subclasses to do extra work in this method without overriding it.
ManagementException
DataTypeException
takeStepActionActionHelper(TakeStepActionActionForm)
,
getTakeStepActionActionForm()
protected void doPostShowTakeStepActionAction() throws ManagementException
ManagementException
protected void takeStepActionActionHelper(TakeStepActionActionForm form) throws ManagementException, AssignmentException
ManagementException
AssignmentException
takeStepAction(java.lang.String, java.lang.String, java.util.Map)
protected void takeStepActionAndClaimActionHelper(TakeStepActionActionForm form, String postActionClaimant) throws ManagementException, AssignmentException
ManagementException
AssignmentException
protected void takeStepAction(String stepName, String actionName, Map<String,String> propMap) throws DataTypeException, ManagementException, AssignmentException
DataTypeException
ManagementException
AssignmentException
protected void takeStepActionAndClaim(String stepName, String actionName, Map<String,String> propMap, String postActionClaimant) throws DataTypeException, ManagementException, AssignmentException
DataTypeException
ManagementException
AssignmentException
protected boolean isPostActionInteractiveAssignment(String actionName) throws ManagementException
ManagementException
protected void cancelStepActionActionHelper() throws ManagementException
ManagementException
protected void updateActionHelper(UpdateActionForm form) throws ParseException, ManagementException, DataTypeException
ParseException
ManagementException
DataTypeException
protected void cancelUpdateActionHelper()
protected Forward showTaskListAction()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |