|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.faces.bean.PageFlowScopeAdapter
com.webmethods.caf.faces.data.task.impl.AbstractTaskContentProvider
public abstract class AbstractTaskContentProvider
AbstractTaskContentProvider is the abstract base implementation class of ITaskContentProvider
.
This class contains all base implementation for queuing, reading and updating a single task instance
ITaskContentProvider
,
Serialized FormField Summary | |
---|---|
protected boolean |
m_adhocRouting
Flag to enable ad-hoc routing (assignment) of the task |
protected boolean |
m_autoAccept
Flag whether task should be automatically accepted before any edits take place. |
protected ITaskData |
m_currentTaskData
Stores current task data being edited |
protected ITaskInfo |
m_currentTaskInfo
Stores current task info bein edited |
protected int |
m_maxAllowedToAccept
How many users are allowed to accept a task. |
protected boolean |
m_needAcceptToUpdate
Flag whether task must be accepted before any edits take place. |
protected boolean |
m_needRefresh
Flag whether task state needs to be refreshed |
protected ITaskData |
m_previousTaskData
Stores task info before any edits took place |
protected ITaskInfo |
m_previousTaskInfo
Stores task data before any edits took place |
protected String |
m_taskID
Stores ID of the task |
protected String |
m_taskTypeID
Stores task type ID. |
Fields inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter |
---|
fExpireWithPageFlow |
Constructor Summary | |
---|---|
AbstractTaskContentProvider()
Default empty constructor |
Method Summary | |
---|---|
void |
acceptTask()
Accepts a task for the current user |
void |
applyChanges()
Commits changes done to task info and business data. |
void |
applyChangesNoAccept()
Commits changes done to task info and business data without requiring user to accept a task |
void |
cancelChanges()
Reverts back all un-committed changes to the task |
void |
cancelTask()
Cancels current task. |
void |
completeTask()
Completes a task |
void |
deleteTask()
Deletes a task |
boolean |
getAdhocRouting()
Returns ad-hoc routing flag |
boolean |
getAutoAccept()
Returns autoAccept flag |
String |
getCurrentUserID()
Returns ID of the current user |
int |
getMaxAllowedToAccept()
Returns max number of users allowed to accept a task. |
boolean |
getNeedAcceptToUpdate()
Returns needAcceptToUpdate flag |
boolean |
getNeedInfoRefresh()
Check whether the task info needs refresh. |
boolean |
getNeedRefresh()
Returns true when IRefreshable.isAutoRefresh() is on and the result properties need to be refreshed from
the data source by executing IRefreshable.refresh() method. |
Object[] |
getPropertyKeys()
Returns list of properties supported by this content provider. |
String |
getTaskID()
Returns task ID |
ITaskInfo |
getTaskInfo()
Returns task info for current task ID. |
String |
getTaskTypeID()
Returns task type ID |
String |
getTaskTypeName()
Returns task type name |
Class |
getType(Object propertyKey)
Returns java type of the given property |
Object |
getValue(Object propertyKey)
Returns value of the given property |
boolean |
hasProperty(Object propertyKey)
Checks if the given property is supported by this content provider |
void |
init(String taskID,
ITaskInfo taskInfo,
ITaskData taskData,
boolean autoAccept)
Initializes this content provider with given task. |
boolean |
isAutoRefresh()
Returns true if the provider is currenlty in auto-refresh mode |
boolean |
isCurrentUserAccepted()
Check whether current user accepted the task. |
boolean |
isReadOnly(Object propertyKey)
Returns true if the given property is readonly. |
boolean |
isUpdateable()
Checks if current user can apply changes to this task |
protected abstract ITaskData |
newTaskData()
Creates new instance of task business data. |
void |
queueNewTask()
Queues a new task with task info and data set. |
void |
refresh()
Reloads current task state from taskID |
void |
reset()
Resets all un-committed back to un-initialized state |
void |
resumeTask()
Resumes a task |
void |
setAdhocRouting(boolean allowAdhocRouting)
Sets ad-hoc routing flag |
void |
setAutoAccept(boolean autoAccept)
Sets autoAccept flag |
void |
setAutoRefresh(boolean autorefresh)
Sets auto refresh mode on. |
void |
setMaxAllowedToAccept(int maxAllowedToAccept)
Sets max number of users allowed to accept a task |
void |
setNeedAcceptToUpdate(boolean needAcceptToUpdate)
Sets needAcceptToUpdate flag |
void |
setNeedRefresh(boolean needRefresh)
Tells the provider that the input parameters have changed and the output results need to be refreshed the next time any output property is requested via IContentProvider.getValue(Object) . |
void |
setTaskID(String taskID)
Sets new task ID to load. |
void |
setTaskTypeID(String taskTypeID)
Set the task Type ID when queuing a new task |
void |
setValue(Object propertyKey,
Object value)
Sets new value of the given property |
boolean |
supportsAutoRefresh()
Returns true if this content provider supports auto refresh feature. |
void |
suspendTask()
Suspends a task |
void |
unacceptTask()
Un-accepts a task from the current user |
Methods inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter |
---|
getExpireWithPageFlow, setExpireWithPageFlow |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.webmethods.caf.faces.data.IContentProvider |
---|
toString |
Field Detail |
---|
protected ITaskData m_currentTaskData
protected ITaskInfo m_previousTaskInfo
protected ITaskInfo m_currentTaskInfo
protected ITaskData m_previousTaskData
protected String m_taskID
protected String m_taskTypeID
protected boolean m_autoAccept
protected boolean m_needAcceptToUpdate
protected int m_maxAllowedToAccept
protected boolean m_needRefresh
protected boolean m_adhocRouting
Constructor Detail |
---|
public AbstractTaskContentProvider()
Method Detail |
---|
public void init(String taskID, ITaskInfo taskInfo, ITaskData taskData, boolean autoAccept)
taskID
- task IDtaskInfo
- ITaskInfo
taskData
- ITaskData
autoAccept
- auto accept or notpublic String getTaskID()
getTaskID
in interface ITaskContentProvider
public String getTaskTypeID()
getTaskTypeID
in interface ITaskContentProvider
public String getTaskTypeName()
getTaskTypeName
in interface ITaskContentProvider
public boolean getAutoAccept()
getAutoAccept
in interface ITaskContentProvider
public void setAutoAccept(boolean autoAccept)
setAutoAccept
in interface ITaskContentProvider
public boolean getAdhocRouting()
getAdhocRouting
in interface ITaskContentProvider
public void setAdhocRouting(boolean allowAdhocRouting)
setAdhocRouting
in interface ITaskContentProvider
public void setTaskID(String taskID)
setTaskID
in interface ITaskContentProvider
taskID
- task ID to setpublic void setTaskTypeID(String taskTypeID)
taskTypeID
- task type ID to setpublic ITaskInfo getTaskInfo()
getTaskInfo
in interface ITaskContentProvider
public void completeTask() throws ContentProviderException
completeTask
in interface ITaskContentProvider
ContentProviderException
public void resumeTask() throws ContentProviderException
resumeTask
in interface ITaskContentProvider
ContentProviderException
public void suspendTask() throws ContentProviderException
suspendTask
in interface ITaskContentProvider
ContentProviderException
public void acceptTask() throws ContentProviderException
acceptTask
in interface ITaskContentProvider
ContentProviderException
public void unacceptTask() throws ContentProviderException
unacceptTask
in interface ITaskContentProvider
ContentProviderException
public void applyChangesNoAccept() throws ContentProviderException
ContentProviderException
public void applyChanges() throws ContentProviderException
applyChanges
in interface ITransactionalContentProvider
ContentProviderException
- if error happens during commitpublic void cancelChanges() throws ContentProviderException
cancelChanges
in interface ITransactionalContentProvider
ContentProviderException
public boolean isUpdateable() throws Exception
Exception
public void reset() throws Exception
Exception
public void refresh() throws ContentProviderException
refresh
in interface IRefreshable
ContentProviderException
- if error loading data from the data sourcepublic void queueNewTask() throws ContentProviderException
queueNewTask
in interface ITaskContentProvider
ContentProviderException
public boolean getNeedInfoRefresh()
public boolean getNeedRefresh()
Returns true
when IRefreshable.isAutoRefresh()
is on and the result properties need to be refreshed from
the data source by executing IRefreshable.refresh()
method.
Implementations may return an accurate value from this method if they can track the changes to the input parameter
properties or they may require the clients to call IRefreshable.setNeedRefresh(boolean)
explicitely.
getNeedRefresh
in interface IRefreshable
true
when the output properties are not up-to-date with the current input parameters, i.e. IRefreshable.refresh()
needs to be executed manually or automatically.public boolean isReadOnly(Object propertyKey) throws EvaluationException, PropertyNotFoundException
Returns true if the given property is readonly. If it is readonly, IUpdateableContentProvider.setValue(Object, Object)
will
definitely fail.
isReadOnly
in interface IUpdateableContentProvider
propertyKey
- property key of type String
or Integer
EvaluationException
PropertyNotFoundException
public void setValue(Object propertyKey, Object value) throws EvaluationException, PropertyNotFoundException
Sets new value of the given property
setValue
in interface IUpdateableContentProvider
propertyKey
- property key of type String
or Integer
value
- new property value
EvaluationException
- if error happens during property assigment
PropertyNotFoundException
- if property is not foundpublic Object[] getPropertyKeys()
Object[0]
,
never null.
getPropertyKeys
in interface IContentProvider
String
or Integer
public Class getType(Object propertyKey) throws PropertyNotFoundException
getType
in interface IContentProvider
propertyKey
- the property key of type String
or Integer
Class
PropertyNotFoundException
- if property is not supportedpublic Object getValue(Object propertyKey) throws EvaluationException, PropertyNotFoundException
getValue
in interface IContentProvider
propertyKey
- the property key of type String
or Integer
null
EvaluationException
- if error during property evaluation
PropertyNotFoundException
- if property is not supportedpublic boolean hasProperty(Object propertyKey)
hasProperty
in interface IContentProvider
propertyKey
- property key of type String
or Integer
true
if property is supportedpublic boolean isAutoRefresh()
true
if the provider is currenlty in auto-refresh mode
isAutoRefresh
in interface IRefreshable
public void setAutoRefresh(boolean autorefresh) throws ContentProviderException
Sets auto refresh mode on. When auto refresh mode is on, the provider calls IRefreshable.getNeedRefresh()
to determine whether the refresh needs to be done before returning any result properties. If it returns
true
, the provider calls IRefreshable.refresh()
method to updated the result properties.
setAutoRefresh
in interface IRefreshable
autorefresh
- true to turn it on
ContentProviderException
- if auto refresh mode is not supportedIRefreshable.supportsAutoRefresh()
,
IRefreshable.getNeedRefresh()
,
IRefreshable.setNeedRefresh(boolean)
public void setNeedRefresh(boolean needRefresh)
IContentProvider.getValue(Object)
.
setNeedRefresh
in interface IRefreshable
needRefresh
- true
if the input parameters have changedpublic boolean supportsAutoRefresh()
supportsAutoRefresh
in interface IRefreshable
IRefreshable.setAutoRefresh(boolean)
public int getMaxAllowedToAccept()
getMaxAllowedToAccept
in interface ITaskContentProvider
public void setMaxAllowedToAccept(int maxAllowedToAccept)
setMaxAllowedToAccept
in interface ITaskContentProvider
public boolean getNeedAcceptToUpdate()
getNeedAcceptToUpdate
in interface ITaskContentProvider
public void setNeedAcceptToUpdate(boolean needAcceptToUpdate)
setNeedAcceptToUpdate
in interface ITaskContentProvider
needAcceptToUpdate
- true means user must first accept a task before updating itpublic void cancelTask() throws ContentProviderException
cancelTask
in interface ITaskContentProvider
ContentProviderException
public void deleteTask() throws ContentProviderException
deleteTask
in interface ITaskContentProvider
ContentProviderException
public String getCurrentUserID() throws ContentProviderException
getCurrentUserID
in interface ITaskContentProvider
ContentProviderException
protected abstract ITaskData newTaskData() throws ContentProviderException
ContentProviderException
public boolean isCurrentUserAccepted() throws Exception
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |