Class TaskIndexedSearchContentProvider
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.object.PageableTableContentProvider
com.webmethods.caf.faces.data.task.impl.TaskIndexedSearchContentProvider
- All Implemented Interfaces:
IPageFlowScopeAdapter
,IAddressableTableContentProvider
,IContentProvider
,IPageableTableContentProvider
,IRefreshable
,IRefreshableContentProvider
,IReorderableTableContentProvider
,ISelectableTableContentProvider
,ISortableTableContentProvider
,ITableContentProvider
,IUpdateableContentProvider
,IUpdateableTableContentProvider
,ITaskSearchContentProvider
,ITaskSearchPagingContentProvider
,Serializable
- Direct Known Subclasses:
TaskInboxIndexedSearchContentProvider
public class TaskIndexedSearchContentProvider
extends PageableTableContentProvider
implements ITaskSearchPagingContentProvider
Content provider which implements Indexed 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 ClassesModifier and TypeClassDescriptionclass
class
class
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 List<ITaskSearchRecord>
Stored current page results as listprotected int
Paging sizeprotected ITask[]
Current page resultsprotected boolean
Flag to indicate if provider should search for current user's inbox tasks onlyprotected TaskSearchQueryV2
Task Search Query objectInstance of back end service which implement task searchstatic final String
protected String
Stores task business data class nameFields inherited from class com.webmethods.caf.faces.data.object.PageableTableContentProvider
array, arraySet, list, listSet, pageRowIndex, refreshPageBinding, rowCache, rowCount, table, tableSet
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
ConstructorsConstructorDescriptionTaskIndexedSearchContentProvider
(TaskSearchQueryV2 searchQuery) Constructor from task 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.Returns results (task list) for the current pageint
Returns page size used for searchObject[]
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 (task list) for the current pageboolean
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 business data class nameReturnsITaskInfo
task info for the current rowgetTaskList
(List<ITaskSearchRecord> searchRecords) Helper method to convert task search records into list of ITask objectsClass<?>
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 providerprotected boolean
Checks if provider is refreshed from the Search button invoke on the custom inbox pageboolean
Returns falseboolean
Returns flag if search results should include indexed task business datavoid
refresh()
Resets internal cache, rowCount and pageRowIndex.void
refresh
(boolean forSort) Refresh the content of the provider.void
This refreshes data for current provider page.void
setAutoRefresh
(boolean autoRefresh) Sets auto refresh mode on.void
setIncludeTaskData
(boolean taskData) Sets flag if search results should include indexed task business datavoid
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
setPagingSize
(int count) Sets page size for searchvoid
setSearchInbox
(boolean value) Setting whether to search current user inbox or full task listvoid
Sets new sort info, re-sorting the table (if necessary).void
setTaskDataClassName
(String className) Sets task business data class nameprotected void
sort()
(Re-)sorts list according to sort info.boolean
Returnsfalse
Methods inherited from class com.webmethods.caf.faces.data.object.PageableTableContentProvider
getArray, getList, getPageRowIndex, getRefreshPageBinding, getRefreshPageExpression, getRowCount, getTable, isRowAvailable, loadPageData, setArray, setList, setPageRowIndex, setRefreshPageBinding, setRefreshPageExpression, setRowCount, setTable
Methods inherited from class com.webmethods.caf.faces.data.object.SelectableListTableContentProvider
createRow, deleteRow, getCurrentRow, getRowId, getRowSelectedCount, getRowSelectedIds, getRowUnselectedIds, getSelectedRows, getUseUnselectedModel, isAddressable, isRowSelected, moveTo, setCurrentRow, setRowById, setRowSelected, setRowSelectedIds, setRowUnselectedIds, setRowVariable, setTemplateRow, updateOriginalList
Methods inherited from class com.webmethods.caf.faces.data.object.ListTableContentProvider
calculateRowId, getCanTemplateRow, getOnCreateRow, getOnCreateRowExpression, getOnDeleteRow, getOnDeleteRowExpression, getRowIdBinding, getRowIdExpression, getRowIndex, getRowType, getRowVariable, getSort, isReadOnly, isReorderable, isTemplateRow, newRow, setCanTemplateRow, setOnCreateRow, setOnCreateRowExpression, setOnDeleteRow, setOnDeleteRowExpression, setRowId, setRowIdBinding, setRowIdExpression, setRowIndex, setRowType, 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.IPageableTableContentProvider
getPageRowIndex, setPageRowIndex
Methods inherited from interface com.webmethods.caf.faces.data.ISortableTableContentProvider
getSort
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_pageSizing
protected int m_pageSizingPaging size -
pagingService
Instance of back end service which implement task search -
m_NextResults
Stored current page results as list -
m_results
Current page results -
taskDataClassName
Stores task business data class name
-
-
Constructor Details
-
TaskIndexedSearchContentProvider
public TaskIndexedSearchContentProvider() -
TaskIndexedSearchContentProvider
Constructor from task search query
-
-
Method Details
-
getSearchQuery
Returns task search query -
isIncludeTaskData
public boolean isIncludeTaskData()Returns flag if search results should include indexed task business data -
setIncludeTaskData
public void setIncludeTaskData(boolean taskData) Sets flag if search results should include indexed task business data -
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 (task list) for the current page- Specified by:
getResults
in interfaceITaskSearchContentProvider
- Returns:
- array of task objects
- Throws:
Exception
-
getNextResults
Returns results (task list) for the current page- Returns:
- List of task objects
- Throws:
Exception
-
getTaskInfo
ReturnsITaskInfo
task info for the current row- Returns:
- TaskInfo
-
refresh
Description copied from class:PageableTableContentProvider
Resets internal cache, rowCount and pageRowIndex. This will force the provider to call the paging service again when the client control requests first row.- Specified by:
refresh
in interfaceIRefreshable
- Overrides:
refresh
in classPageableTableContentProvider
- Throws:
ContentProviderException
- if error loading data from the data source
-
hasSearchInvocation
protected boolean hasSearchInvocation()Checks if provider is refreshed from the Search button invoke on the custom inbox page- Returns:
- true if a search invocation has been triggered, false otherwise
-
refresh
Refresh the content of the provider. This will search for tasks matching current search query.- Parameters:
forSort
- true if this just resorting the previous data, false otherwise- Throws:
ContentProviderException
-
refreshPage
public void refreshPage()This refreshes data for current provider page. This will search for tasks matching current search query- Overrides:
refreshPage
in classPageableTableContentProvider
-
getTaskList
Helper method to convert task search records into list of ITask objects- Parameters:
searchRecords
- list of task search records- Returns:
- list of task objects
-
setPagingSize
public void setPagingSize(int count) Sets page size for search- Specified by:
setPagingSize
in interfaceITaskSearchPagingContentProvider
- Parameters:
page
- size
-
getPagingSize
public int getPagingSize()Returns page size used for search- Specified by:
getPagingSize
in interfaceITaskSearchPagingContentProvider
- Returns:
- page size
-
setTaskDataClassName
Sets task business data class name- Parameters:
className
-
-
getTaskDataClassName
Returns task business data class name- Returns:
- task business data class name
-
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
-
setSort
Description copied from interface:ISortableTableContentProvider
Sets new sort info, re-sorting the table (if necessary). This does not change the model's rowIndex property, even though it will probably now point to a different row.- Specified by:
setSort
in interfaceISortableTableContentProvider
- Overrides:
setSort
in classListTableContentProvider
- Parameters:
sort
- Sort info, must not be null.
-
sort
protected void sort()(Re-)sorts list according to sort info.- Overrides:
sort
in classSelectableListTableContentProvider
- See Also:
-