public abstract class CustomTaskSearchContentProvider extends PageableTableContentProvider implements ITaskSearchPagingContentProvider
Modifier and Type | Class and Description |
---|---|
class |
CustomTaskSearchContentProvider.TaskSearchPagingService |
SelectableListTableContentProvider.Row, SelectableListTableContentProvider.RowComparator
Modifier and Type | Field and Description |
---|---|
protected boolean |
m_includeTaskData
Flag that indicates if search result should include task business data
|
protected boolean |
m_isAutoRefresh
Flag if provider is auto-refreshable
|
protected boolean |
m_needRefresh
Flag to indicate if provider should be refreshed
|
protected List<ITask> |
m_NextResults
Stored current page results as list
|
protected int |
m_pageSizing
Paging size
|
protected ITask[] |
m_results
Current page results
|
protected boolean |
m_searchInbox
Flag to indicate if provider should search for current user's inbox tasks only
|
protected ITaskSearchQueryBase |
m_searchQuery
Task Search Query object
|
protected CustomTaskSearchContentProvider.TaskSearchPagingService |
pagingService
Instance of back end service which implement task search
|
static String |
PROPERTY_TASKDATA |
protected String |
taskDataClassName
Stores task business data class name
|
array, arraySet, list, listSet, pageRowIndex, refreshPageBinding, rowCache, rowCount, table, tableSet
m_autoIdCounter, m_map, m_originalList, m_selectableHelper
m_array, m_canTemplateRow, m_index, m_list, m_onCreateRow, m_onDeleteRow, m_rowId, m_rowType, m_sort, m_templateRow, m_var
fExpireWithPageFlow
Constructor and Description |
---|
CustomTaskSearchContentProvider() |
CustomTaskSearchContentProvider(ITaskSearchQueryBase searchQuery)
Constructor from task search query
|
Modifier and Type | Method and Description |
---|---|
protected String |
calculateRowId(int index,
Object data)
Return
data.getTaskInfo().getTaskID() as RowId |
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. |
List<ITask> |
getNextResults()
Returns results (task list) for the current page
|
int |
getPagingSize()
Returns page size used for search
|
Object[] |
getPropertyKeys()
Returns property keys for the current row object which is an element of the wrapped array or the list
by
ListTableContentProvider.getRowIndex() index. |
ITask[] |
getResults()
Returns results (task list) for the current page
|
boolean |
getSearchInbox()
Returns boolean value indicates whether to search current user inbox or full task list
return true if search current user inbox only
|
ITaskSearchQueryBase |
getSearchQuery()
Returns task search query
|
String |
getTaskDataClassName()
Returns task business data class name
|
ITaskInfo |
getTaskInfo()
Returns
ITaskInfo task info for the current row |
protected abstract int |
getTotalCount(boolean isInbox)
The total number of rows in search results are returned here.
|
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
|
protected abstract void |
initializeSearch(boolean isInbox)
First step in search execution.
|
boolean |
isAutoRefresh()
Returns false
|
boolean |
isIncludeTaskData()
Returns flag if search results should include indexed task business data
|
void |
refresh()
Resets internal cache, rowCount and pageRowIndex.
|
void |
refresh(boolean forSort)
Refresh the content of the provider.
|
void |
refreshPage()
This refreshes data for current provider page.
|
protected abstract List<ITask> |
refreshPage(boolean isInbox,
boolean includeTaskData,
int fromIndex,
int toIndex)
Returns a List of ITask objects for the requested range.
|
void |
setAutoRefresh(boolean autoRefresh)
Sets auto refresh mode on.
|
void |
setIncludeTaskData(boolean taskData)
Sets flag if search results should include indexed task business data
|
void |
setList(List list)
Sets a list to wrap
|
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 |
setPagingSize(int count)
Sets page size for search
|
void |
setSearchInbox(boolean value)
Setting whether to search current user inbox or full task list
|
void |
setSort(ISortInfo sort)
Sets new sort info, re-sorting the table (if necessary).
|
void |
setTaskDataClassName(String className)
Sets task business data class name
|
protected abstract boolean |
shouldSearchExecute()
Return true if search must be executed, this is used for generating empty
initial page.
|
protected void |
sort()
(Re-)sorts list according to sort info.
|
boolean |
supportsAutoRefresh()
Returns
false |
getArray, getList, getPageRowIndex, getRefreshPageBinding, getRowCount, getTable, isRowAvailable, loadPageData, setArray, setPageRowIndex, setRefreshPageBinding, setRowCount, setTable
createRow, deleteRow, getCurrentRow, getRowId, getRowSelectedCount, getRowSelectedIds, getRowUnselectedIds, getSelectedRows, getUseUnselectedModel, isAddressable, isRowSelected, moveTo, setCurrentRow, setRowById, setRowSelected, setRowSelectedIds, setRowUnselectedIds, setRowVariable, setTemplateRow, updateOriginalList
calculateRowId, getCanTemplateRow, getOnCreateRow, getOnDeleteRow, getRowIdBinding, getRowIndex, getRowType, getRowVariable, getSort, isReadOnly, isReorderable, isTemplateRow, newRow, setCanTemplateRow, setOnCreateRow, setOnDeleteRow, setRowId, setRowIdBinding, setRowIndex, setRowType, setValue, toString
getExpireWithPageFlow, setExpireWithPageFlow
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getSort
getPageRowIndex, setPageRowIndex
getCurrentRow, getRowCount, getRowIndex, getRowVariable, isRowAvailable, setRowIndex, setRowVariable
toString
public static final String PROPERTY_TASKDATA
protected boolean m_isAutoRefresh
protected boolean m_needRefresh
protected boolean m_searchInbox
protected boolean m_includeTaskData
protected ITaskSearchQueryBase m_searchQuery
protected int m_pageSizing
protected CustomTaskSearchContentProvider.TaskSearchPagingService pagingService
protected ITask[] m_results
protected String taskDataClassName
public CustomTaskSearchContentProvider()
public CustomTaskSearchContentProvider(ITaskSearchQueryBase searchQuery)
public ITaskSearchQueryBase getSearchQuery()
public boolean isIncludeTaskData()
public void setIncludeTaskData(boolean taskData)
protected String calculateRowId(int index, Object data)
data.getTaskInfo().getTaskID()
as RowIdcalculateRowId
in class ListTableContentProvider
index
- row indexdata
- row data objectpublic boolean getSearchInbox()
ITaskSearchContentProvider
getSearchInbox
in interface ITaskSearchContentProvider
public void setSearchInbox(boolean value)
ITaskSearchContentProvider
setSearchInbox
in interface ITaskSearchContentProvider
public ITask[] getResults() throws Exception
getResults
in interface ITaskSearchContentProvider
Exception
public List<ITask> getNextResults() throws Exception
Exception
public ITaskInfo getTaskInfo()
ITaskInfo
task info for the current rowpublic void refresh() throws ContentProviderException
PageableTableContentProvider
refresh
in interface IRefreshable
refresh
in class PageableTableContentProvider
ContentProviderException
- if error loading data from the data sourcepublic void refresh(boolean forSort) throws ContentProviderException
forSort
- true if this just resorting the previous data, false otherwiseContentProviderException
protected abstract boolean shouldSearchExecute()
protected abstract void initializeSearch(boolean isInbox)
isInbox
- true if the search is for current user's inbox tasks onlyprotected abstract int getTotalCount(boolean isInbox)
isInbox
- true if the search is for current user's inbox tasks onlyprotected abstract List<ITask> refreshPage(boolean isInbox, boolean includeTaskData, int fromIndex, int toIndex)
isInbox
- true if the search is for current user's inbox tasks onlyincludeTaskData
- true if Business Data (TaskData) must be includedfromIndex
- int starting index of requested page.toIndex
- int ending index of requested page.public void refreshPage()
refreshPage
in class PageableTableContentProvider
public void setPagingSize(int count)
setPagingSize
in interface ITaskSearchPagingContentProvider
page
- sizepublic int getPagingSize()
getPagingSize
in interface ITaskSearchPagingContentProvider
public void setTaskDataClassName(String className)
className
- public String getTaskDataClassName()
public boolean supportsAutoRefresh()
SelectableListTableContentProvider
false
supportsAutoRefresh
in interface IRefreshable
supportsAutoRefresh
in class SelectableListTableContentProvider
IRefreshable.setAutoRefresh(boolean)
public void setAutoRefresh(boolean autoRefresh) throws ContentProviderException
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 returns
true
, the provider calls IRefreshable.refresh()
method to updated the result properties.
setAutoRefresh
in interface IRefreshable
setAutoRefresh
in class SelectableListTableContentProvider
autoRefresh
- true to turn it onContentProviderException
- if autorefresh is trueIRefreshable.supportsAutoRefresh()
,
IRefreshable.getNeedRefresh()
,
IRefreshable.setNeedRefresh(boolean)
public boolean isAutoRefresh()
SelectableListTableContentProvider
isAutoRefresh
in interface IRefreshable
isAutoRefresh
in class SelectableListTableContentProvider
public boolean getNeedRefresh()
IRefreshable
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
getNeedRefresh
in class SelectableListTableContentProvider
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 void setNeedRefresh(boolean needRefresh)
IRefreshable
IContentProvider.getValue(Object)
.setNeedRefresh
in interface IRefreshable
setNeedRefresh
in class SelectableListTableContentProvider
needRefresh
- true
if the input parameters have changedpublic Object[] getPropertyKeys()
ListTableContentProvider
ListTableContentProvider.getRowIndex()
index.getPropertyKeys
in interface IContentProvider
getPropertyKeys
in class ListTableContentProvider
String
or Integer
property keyspublic boolean hasProperty(Object propertyKey)
IContentProvider
hasProperty
in interface IContentProvider
hasProperty
in class ListTableContentProvider
propertyKey
- property key of type String
or Integer
true
if property is supportedpublic Object getValue(Object propertyKey) throws ELException, PropertyNotFoundException
IContentProvider
getValue
in interface IContentProvider
getValue
in class ListTableContentProvider
propertyKey
- the property key of type String
or Integer
null
PropertyNotFoundException
- if property is not supportedELException
PropertyNotFoundException
public Class getType(Object propertyKey) throws PropertyNotFoundException
IContentProvider
getType
in interface IContentProvider
getType
in class ListTableContentProvider
propertyKey
- the property key of type String
or Integer
Class
PropertyNotFoundException
- if property is not supportedPropertyNotFoundException
public void setSort(ISortInfo sort)
ISortableTableContentProvider
setSort
in interface ISortableTableContentProvider
setSort
in class ListTableContentProvider
sort
- Sort info, must not be null.protected void sort()
sort
in class SelectableListTableContentProvider
setSort(ISortInfo)
public void setList(List list)
SelectableListTableContentProvider
setList
in class PageableTableContentProvider
list
- a list