|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.platform.query.api.AbstractPageProvider<T>
public abstract class AbstractPageProvider<T>
Basic implementation for a PageProvider
Field Summary |
---|
Fields inherited from interface org.nuxeo.ecm.platform.query.api.PageProvider |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
AbstractPageProvider()
|
Method Summary | |
---|---|
void |
addSortInfo(java.lang.String sortColumn,
boolean sortAscending)
Add the given sort info to the list of sorting infos. |
void |
firstPage()
Go to the first page |
T |
getCurrentEntry()
Returns the current entry. |
abstract java.util.List<T> |
getCurrentPage()
Returns the current page of results. |
long |
getCurrentPageIndex()
Returns the current page index as a zero-based integer. |
long |
getCurrentPageOffset()
Returns the offset (starting from 0) of the first element in the current page or UNKNOWN_SIZE . |
long |
getCurrentPageSize()
Returns the number of elements in current page. |
java.lang.String |
getCurrentPageStatus()
Returns a simple formatted string for current pagination status. |
PageSelections<T> |
getCurrentSelectPage()
Returns the current page of results wrapped in a PageSelection
item. |
PageProviderDefinition |
getDefinition()
|
java.lang.Throwable |
getError()
|
java.lang.String |
getErrorMessage()
|
java.lang.String |
getName()
Returns the provider identifier |
long |
getNumberOfPages()
Returns the total number of pages |
long |
getPageSize()
Returns the number of results per page. 0 means no pagination. |
java.lang.Object[] |
getParameters()
|
java.util.Map<java.lang.String,java.io.Serializable> |
getProperties()
Gets properties set on the provider. |
long |
getResultsCount()
Returns the number of result elements if available or UNKNOWN_SIZE if it is unknown. |
DocumentModel |
getSearchDocumentModel()
|
SortInfo |
getSortInfo()
Returns the first sorting info for this provider Also kept for compatibility with existing code. |
int |
getSortInfoIndex(java.lang.String sortColumn,
boolean sortAscending)
Returns a positive 0-based integer if given sort information is found on the set sort infos, indicating the sort index, or -1 if this sort information is not found. |
java.util.List<SortInfo> |
getSortInfos()
Returns the complete list of sorting info for this provider |
boolean |
hasError()
|
boolean |
isNextEntryAvailable()
Tells if there is a next entry. |
boolean |
isNextPageAvailable()
Returns a boolean expressing if there are further pages. |
boolean |
isPreviousEntryAvailable()
Tells if there is a previous entry. |
boolean |
isPreviousPageAvailable()
Returns a boolean expressing if there is a previous page. |
boolean |
isSortable()
Returns if this provider is sortable |
void |
last()
|
void |
lastPage()
Go to the last page |
void |
next()
|
void |
nextEntry()
Move the current entry to the next one, if applicable If needed and possible, the provider will forward to next page. |
void |
nextPage()
Go to the next page |
void |
previous()
|
void |
previousEntry()
Move the current entry to the previous one, if applicable No exception: this method is intended to be plugged directly at the UI layer. |
void |
previousPage()
Go to the previous page |
void |
refresh()
Forces refresh of the current page. |
void |
rewind()
|
void |
setCurrentEntry(T entry)
Sets the current entry. |
void |
setCurrentEntryIndex(long index)
Sets the current entry index. |
java.util.List<T> |
setCurrentPage(long page)
Sets the current page of results to the required one and return it. |
void |
setDefinition(PageProviderDefinition providerDefinition)
|
void |
setName(java.lang.String name)
Sets the provider identifier |
void |
setPageSize(long pageSize)
Sets the number results per page. 0 means no pagination. |
void |
setParameters(java.lang.Object[] parameters)
|
void |
setProperties(java.util.Map<java.lang.String,java.io.Serializable> properties)
Sets properties set on the provider. |
void |
setResultsCount(long resultsCount)
|
void |
setSearchDocumentModel(DocumentModel searchDocumentModel)
|
void |
setSelectedEntries(java.util.List<T> entries)
Sets the list of selected entries to take into account in PageProvider.getCurrentSelectPage() . |
void |
setSortable(boolean sortable)
|
void |
setSortInfo(SortInfo sortInfo)
Sets the first and only sorting info for this provider. |
void |
setSortInfo(java.lang.String sortColumn,
boolean sortAscending,
boolean removeOtherSortInfos)
Sets the first and only sorting info for this provider if parameter removeOtherSortInfos is true. |
void |
setSortInfos(java.util.List<SortInfo> sortInfo)
Sets the complete list of sorting info for this provider |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractPageProvider()
Method Detail |
---|
public abstract java.util.List<T> getCurrentPage()
PageProvider
This method is designed to be called from higher levels. It therefore ensures cheapness of repeated calls, rather than data consistency. There is a refresh() method for that.
getCurrentPage
in interface PageProvider<T>
public void firstPage()
PageProvider
firstPage
in interface PageProvider<T>
public void rewind()
public long getCurrentPageIndex()
PageProvider
getCurrentPageIndex
in interface PageProvider<T>
public long getCurrentPageOffset()
PageProvider
UNKNOWN_SIZE
.
getCurrentPageOffset
in interface PageProvider<T>
public long getCurrentPageSize()
PageProvider
getCurrentPageSize
in interface PageProvider<T>
public java.lang.String getName()
PageProvider
getName
in interface PageProvider<T>
public long getNumberOfPages()
PageProvider
getNumberOfPages
in interface PageProvider<T>
public java.util.List<T> setCurrentPage(long page)
PageProvider
setCurrentPage
in interface PageProvider<T>
page
- the page index, starting from 0public long getPageSize()
PageProvider
getPageSize
in interface PageProvider<T>
public void setPageSize(long pageSize)
PageProvider
setPageSize
in interface PageProvider<T>
public java.util.List<SortInfo> getSortInfos()
PageProvider
getSortInfos
in interface PageProvider<T>
public SortInfo getSortInfo()
PageProvider
Also kept for compatibility with existing code.
getSortInfo
in interface PageProvider<T>
public void setSortInfos(java.util.List<SortInfo> sortInfo)
PageProvider
setSortInfos
in interface PageProvider<T>
public void setSortInfo(SortInfo sortInfo)
PageProvider
Also kept for compatibility with existing code.
setSortInfo
in interface PageProvider<T>
public void setSortInfo(java.lang.String sortColumn, boolean sortAscending, boolean removeOtherSortInfos)
PageProvider
setSortInfo
in interface PageProvider<T>
public void addSortInfo(java.lang.String sortColumn, boolean sortAscending)
PageProvider
addSortInfo
in interface PageProvider<T>
public int getSortInfoIndex(java.lang.String sortColumn, boolean sortAscending)
PageProvider
getSortInfoIndex
in interface PageProvider<T>
public boolean isNextPageAvailable()
PageProvider
isNextPageAvailable
in interface PageProvider<T>
public boolean isPreviousPageAvailable()
PageProvider
isPreviousPageAvailable
in interface PageProvider<T>
public void lastPage()
PageProvider
lastPage
in interface PageProvider<T>
public void last()
public void nextPage()
PageProvider
nextPage
in interface PageProvider<T>
public void next()
public void previousPage()
PageProvider
previousPage
in interface PageProvider<T>
public void previous()
public void refresh()
PageProvider
refresh
in interface PageProvider<T>
public void setName(java.lang.String name)
PageProvider
setName
in interface PageProvider<T>
public java.lang.String getCurrentPageStatus()
PageProvider
getCurrentPageStatus
in interface PageProvider<T>
public boolean isNextEntryAvailable()
PageProvider
The next entry might be in next page. If no current entry is set, this returns false.
isNextEntryAvailable
in interface PageProvider<T>
public boolean isPreviousEntryAvailable()
PageProvider
The next entry might be in next page. If no current entry is set, this returns false.
isPreviousEntryAvailable
in interface PageProvider<T>
public void nextEntry()
PageProvider
If needed and possible, the provider will forward to next page. No special exceptions: this method is intended to be plugged directly at the UI layer. In case there's no next entry, nothing happens.
nextEntry
in interface PageProvider<T>
public void previousEntry()
PageProvider
No exception: this method is intended to be plugged directly at the UI layer. In case there's no previous entry, nothing will happen.
previousEntry
in interface PageProvider<T>
public T getCurrentEntry()
PageProvider
getCurrentEntry
in interface PageProvider<T>
public void setCurrentEntry(T entry) throws ClientException
PageProvider
setCurrentEntry
in interface PageProvider<T>
ClientException
- if entry is not found within current page.public void setCurrentEntryIndex(long index) throws ClientException
PageProvider
setCurrentEntryIndex
in interface PageProvider<T>
ClientException
- if index is not found within current page.public long getResultsCount()
PageProvider
UNKNOWN_SIZE
if it is unknown.
getResultsCount
in interface PageProvider<T>
public java.util.Map<java.lang.String,java.io.Serializable> getProperties()
PageProvider
Useful to retrieve a provider specific field attributes after instantiation. Other contextual parameters can be passed through API constructing the result provider.
getProperties
in interface PageProvider<T>
public void setProperties(java.util.Map<java.lang.String,java.io.Serializable> properties)
PageProvider
Useful to initialize a provider specific field attributes after instantiation. Other contextual parameters can be passed through API constructing the result provider.
setProperties
in interface PageProvider<T>
public void setResultsCount(long resultsCount)
setResultsCount
in interface PageProvider<T>
public void setSortable(boolean sortable)
setSortable
in interface PageProvider<T>
public boolean isSortable()
PageProvider
isSortable
in interface PageProvider<T>
public PageSelections<T> getCurrentSelectPage()
PageProvider
PageSelection
item.
By default, no entry is selected, unless
PageProvider.setSelectedEntries(List)
has been called before.
getCurrentSelectPage
in interface PageProvider<T>
public void setSelectedEntries(java.util.List<T> entries)
PageProvider
PageProvider.getCurrentSelectPage()
.
setSelectedEntries
in interface PageProvider<T>
public java.lang.Object[] getParameters()
getParameters
in interface PageProvider<T>
public void setParameters(java.lang.Object[] parameters)
setParameters
in interface PageProvider<T>
public DocumentModel getSearchDocumentModel()
getSearchDocumentModel
in interface PageProvider<T>
public void setSearchDocumentModel(DocumentModel searchDocumentModel)
setSearchDocumentModel
in interface PageProvider<T>
public java.lang.String getErrorMessage()
getErrorMessage
in interface PageProvider<T>
public java.lang.Throwable getError()
getError
in interface PageProvider<T>
public boolean hasError()
hasError
in interface PageProvider<T>
public PageProviderDefinition getDefinition()
getDefinition
in interface PageProvider<T>
public void setDefinition(PageProviderDefinition providerDefinition)
setDefinition
in interface PageProvider<T>
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |