Class TaskSearchContentProvider
java.lang.Object
com.webmethods.caf.faces.bean.PageFlowScopeAdapter
com.webmethods.caf.faces.data.object.ListTableContentProvider
com.webmethods.caf.faces.data.object.SelectableListTableContentProvider
com.webmethods.caf.faces.data.task.impl.TaskSearchContentProvider
- All Implemented Interfaces:
IPageFlowScopeAdapter
,IAddressableTableContentProvider
,IContentProvider
,IRefreshable
,IRefreshableContentProvider
,IReorderableTableContentProvider
,ISelectableTableContentProvider
,ISortableTableContentProvider
,ITableContentProvider
,IUpdateableContentProvider
,IUpdateableTableContentProvider
,ITaskSearchContentProvider
,Serializable
- Direct Known Subclasses:
TaskInboxSearchContentProvider
,TaskSavedSearchContentProvider
public class TaskSearchContentProvider
extends SelectableListTableContentProvider
implements ITaskSearchContentProvider
Content provider which implements Task searches and intended to be used as value for table controls in
custom task inbox portlets
When using this provider class you need to configure its search query
When using this provider class you need to configure its search query
getSearchQuery()
terms and call refresh()
method. Most of the time this provider
is extended when implementing custom task inbox by adding new search terms.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.webmethods.caf.faces.data.object.SelectableListTableContentProvider
SelectableListTableContentProvider.Row, SelectableListTableContentProvider.RowComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Flag that indicates if search result should include task business dataprotected boolean
Flag if provider is auto-refreshableprotected boolean
Flag to indicate if provider should be refreshedprotected ITask[]
Search resultsprotected int
protected boolean
Flag to indicate if provider should search for current user's inbox tasks onlyprotected TaskSearchQuery
Task Search Query objectstatic final String
Fields inherited from class com.webmethods.caf.faces.data.object.SelectableListTableContentProvider
m_autoIdCounter, m_map, m_originalList, m_selectableHelper
Fields inherited from class com.webmethods.caf.faces.data.object.ListTableContentProvider
m_array, m_canTemplateRow, m_index, m_list, m_onCreateRow, m_onDeleteRow, m_rowId, m_rowType, m_sort, m_templateRow, m_var
Fields inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter
fExpireWithPageFlow
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorTaskSearchContentProvider
(TaskSearchQuery searchQuery) Default constructor from search query -
Method Summary
Modifier and TypeMethodDescriptionprotected String
calculateRowId
(int index, Object data) Returndata.getTaskInfo().getTaskID()
as RowIdboolean
Returnstrue
whenIRefreshable.isAutoRefresh()
is on and the result properties need to be refreshed from the data source by executingIRefreshable.refresh()
method.Object[]
Returns property keys for the current row object which is an element of the wrapped array or the list byListTableContentProvider.getRowIndex()
index.ITask[]
Returns results of the searchprotected int
boolean
Returns boolean value indicates whether to search current user inbox or full task list return true if search current user inbox onlyReturns task search queryReturns task info for the current row of the providerprotected TaskSearchQueryV2
int
Class<?>
Returns java type of the given propertyReturns value of the given propertyboolean
hasProperty
(Object propertyKey) Checks if the given property is supported by this content providerboolean
Returns falsevoid
refresh()
Should be called by the clients when the wrapped list objects gets changed outside this provider.void
void
refreshTotalCount
(boolean businessDataField) void
setAutoRefresh
(boolean autoRefresh) Sets auto refresh mode on.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 viaIContentProvider.getValue(Object)
.void
setSearchInbox
(boolean value) Setting whether to search current user inbox or full task listboolean
Returnsfalse
Methods inherited from class com.webmethods.caf.faces.data.object.SelectableListTableContentProvider
createRow, deleteRow, getCurrentRow, getList, getRowId, getRowSelectedCount, getRowSelectedIds, getRowUnselectedIds, getSelectedRows, getUseUnselectedModel, isAddressable, isRowSelected, moveTo, setCurrentRow, setList, setRowById, setRowSelected, setRowSelectedIds, setRowUnselectedIds, setRowVariable, setTemplateRow, sort, updateOriginalList
Methods inherited from class com.webmethods.caf.faces.data.object.ListTableContentProvider
calculateRowId, getArray, getCanTemplateRow, getOnCreateRow, getOnCreateRowExpression, getOnDeleteRow, getOnDeleteRowExpression, getRowCount, getRowIdBinding, getRowIdExpression, getRowIndex, getRowType, getRowVariable, getSort, isReadOnly, isReorderable, isRowAvailable, isTemplateRow, newRow, setArray, setCanTemplateRow, setOnCreateRow, setOnCreateRowExpression, setOnDeleteRow, setOnDeleteRowExpression, setRowId, setRowIdBinding, setRowIdExpression, setRowIndex, setRowType, setSort, setValue, toString
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, wait, wait, wait
Methods inherited from interface com.webmethods.caf.faces.data.IContentProvider
toString
Methods inherited from interface com.webmethods.caf.faces.data.ITableContentProvider
getCurrentRow, getRowCount, getRowIndex, getRowVariable, isRowAvailable, setRowIndex, setRowVariable
-
Field Details
-
PROPERTY_TASKDATA
- See Also:
-
m_isAutoRefresh
protected boolean m_isAutoRefreshFlag if provider is auto-refreshable -
m_needRefresh
protected boolean m_needRefreshFlag to indicate if provider should be refreshed -
m_searchInbox
protected boolean m_searchInboxFlag to indicate if provider should search for current user's inbox tasks only -
m_includeTaskData
protected boolean m_includeTaskDataFlag that indicates if search result should include task business data -
m_searchQuery
Task Search Query object -
m_results
Search results -
m_resultsTotalCount
protected int m_resultsTotalCount
-
-
Constructor Details
-
TaskSearchContentProvider
public TaskSearchContentProvider()Default constructor -
TaskSearchContentProvider
Default constructor from search query- Parameters:
searchQuery
- task search query
-
-
Method Details
-
getSearchQuery
Returns task search query -
calculateRowId
Returndata.getTaskInfo().getTaskID()
as RowId- Overrides:
calculateRowId
in classListTableContentProvider
- Parameters:
index
- row indexdata
- row data object- Returns:
- row id
-
getSearchInbox
public boolean getSearchInbox()Description copied from interface:ITaskSearchContentProvider
Returns boolean value indicates whether to search current user inbox or full task list return true if search current user inbox only- Specified by:
getSearchInbox
in interfaceITaskSearchContentProvider
-
setSearchInbox
public void setSearchInbox(boolean value) Description copied from interface:ITaskSearchContentProvider
Setting whether to search current user inbox or full task list- Specified by:
setSearchInbox
in interfaceITaskSearchContentProvider
-
getResults
Returns results of the search- Specified by:
getResults
in interfaceITaskSearchContentProvider
- Returns:
- task objects array
- Throws:
Exception
-
getTaskInfo
Returns task info for the current row of the provider- Returns:
- task info object
-
refresh
public void refresh()Description copied from class:SelectableListTableContentProvider
Should be called by the clients when the wrapped list objects gets changed outside this provider.- Specified by:
refresh
in interfaceIRefreshable
- Overrides:
refresh
in classSelectableListTableContentProvider
-
getResultsTotalCount
- Throws:
Exception
-
getTotalCount
- Throws:
Exception
-
refreshTotalCount
public void refreshTotalCount() -
refreshTotalCount
public void refreshTotalCount(boolean businessDataField) -
getTaskSearchQueryV2
-
supportsAutoRefresh
public boolean supportsAutoRefresh()Description copied from class:SelectableListTableContentProvider
Returnsfalse
- Specified by:
supportsAutoRefresh
in interfaceIRefreshable
- Overrides:
supportsAutoRefresh
in classSelectableListTableContentProvider
- Returns:
- true when auto refresh is supported
- See Also:
-
setAutoRefresh
Description copied from interface:IRefreshable
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 returnstrue
, the provider callsIRefreshable.refresh()
method to updated the result properties.- Specified by:
setAutoRefresh
in interfaceIRefreshable
- Overrides:
setAutoRefresh
in classSelectableListTableContentProvider
- Parameters:
autoRefresh
- true to turn it on- Throws:
ContentProviderException
- if autorefresh is true- See Also:
-
isAutoRefresh
public boolean isAutoRefresh()Description copied from class:SelectableListTableContentProvider
Returns false- Specified by:
isAutoRefresh
in interfaceIRefreshable
- Overrides:
isAutoRefresh
in classSelectableListTableContentProvider
- Returns:
- false if auto-refresh mode is off or not supported
-
getNeedRefresh
public boolean getNeedRefresh()Description copied from interface:IRefreshable
Returns
true
whenIRefreshable.isAutoRefresh()
is on and the result properties need to be refreshed from the data source by executingIRefreshable.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.- Specified by:
getNeedRefresh
in interfaceIRefreshable
- Overrides:
getNeedRefresh
in classSelectableListTableContentProvider
- Returns:
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.
-
setNeedRefresh
public void setNeedRefresh(boolean needRefresh) Description copied from interface:IRefreshable
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 viaIContentProvider.getValue(Object)
.- Specified by:
setNeedRefresh
in interfaceIRefreshable
- Overrides:
setNeedRefresh
in classSelectableListTableContentProvider
- Parameters:
needRefresh
-true
if the input parameters have changed
-
getPropertyKeys
Description copied from class:ListTableContentProvider
Returns property keys for the current row object which is an element of the wrapped array or the list byListTableContentProvider.getRowIndex()
index.- Specified by:
getPropertyKeys
in interfaceIContentProvider
- Overrides:
getPropertyKeys
in classListTableContentProvider
- Returns:
- array of
String
orInteger
property keys
-
hasProperty
Description copied from interface:IContentProvider
Checks if the given property is supported by this content provider- Specified by:
hasProperty
in interfaceIContentProvider
- Overrides:
hasProperty
in classListTableContentProvider
- Parameters:
propertyKey
- property key of typeString
orInteger
- Returns:
true
if property is supported
-
getValue
Description copied from interface:IContentProvider
Returns value of the given property- Specified by:
getValue
in interfaceIContentProvider
- Overrides:
getValue
in classListTableContentProvider
- Parameters:
propertyKey
- the property key of typeString
orInteger
- Returns:
- value of the property, can be
null
- Throws:
PropertyNotFoundException
- if property is not supportedELException
-
getType
Description copied from interface:IContentProvider
Returns java type of the given property- Specified by:
getType
in interfaceIContentProvider
- Overrides:
getType
in classListTableContentProvider
- Parameters:
propertyKey
- the property key of typeString
orInteger
- Returns:
- property java
Class
- Throws:
PropertyNotFoundException
- if property is not supported
-