|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.4) E14255-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICMPagedResult<T>
An ICMPagedResult represents a collection of query results in a page-based structure.
An ICMPagedResult can be constructed from an IPagedList via CMPagedResultFactory
.
An overview of capabilities, including sorting and filtering, is provided
in the package documentation at com.bea.content.paging
.
The number of items per page may be configured via the PAGE_SIZE_KEY
context key.
The number of items to load at a time may be configured via the ContentListKeys.BATCH_LOADING_SIZE_KEY
context key and the getBatchLoadingSize() and setBatchLoadingSize() methods.
For optimal performance, configure the page size and batch loading size ContentContext keys before calling the CM APIs to retrieve the IPagedList.
ICMPagedResult instances may support extra capabilities, such as determining the total number of items,
if the batch size is set to ContentListKeys.ALL_ITEMS
. You should set this in the ContentContext before
calling the CM APIs to retrieve the IPagedList. For memory consumption reasons, this should generally
only be used if you expect there to be a limited number of items in the PagedList, or you are using other
mechanisms to limit the total number of items retrieved, such as a search max results parameter.
Field Summary | |
---|---|
static ContextKey |
PAGE_SIZE_KEY
optional CONTEXT KEY which can be placed in the ContentContext -- see ContentContext
Specifies the pagesize to use. |
Fields inherited from interface com.bea.p13n.pagination.PagedResult |
---|
COUNT_UNKNOWN |
Fields inherited from interface com.bea.p13n.pagination.PagedResult |
---|
COUNT_UNKNOWN |
Method Summary | |
---|---|
void |
close()
Close the result and release any resources which it holds. |
Iterator<T> |
currentPage()
Retrieves the current page of items. |
int |
getBatchLoadingSize()
Returns the current batch loading size. |
int |
getCurrentPageNumber()
Get the current page number. |
Set<String> |
getFilterableProperties()
An implementation must report which of its properties can be legaly filtered. |
Locale |
getFilterLocale()
Retrieve the current locale used for filtering. |
FilterMethod |
getFilterMethod()
Retrieve the current state of the filter method (what way the result is currently filtered). |
String |
getFilterProperty()
Retrieve the current state of the property used to filter the result. |
String |
getFilterString()
Retrieve the current state of the string used to filter the result. |
int |
getFullSize()
Finds query results size, regardless of the cost. |
Set<String> |
getNativeFilterableProperties()
|
Set<FilterMethod> |
getNativeFilterMethods()
|
Set<String> |
getNativeSortableProperties()
|
Iterator<T> |
getPage(int pageNumber)
Get the specified page. |
int |
getPageCount()
If the CMPagedResult can efficiently identify the total # of pages in the collection, this method returns the total number of pages in the collection. |
int |
getPageSize()
Get the size of the pages. |
Set<String> |
getSortableProperties()
An implementation must report which of its properties can be legaly sorted. |
Locale |
getSortLocale()
Retrieve the current locale used for sorting. |
SortOrder |
getSortOrder()
Retrieve the current state of the sort order (what order the result is sorted by). |
String |
getSortProperty()
Retrieve the current state of the property used to sort the result. |
Set<FilterMethod> |
getSupportedFilterMethods()
An implementation must report which FilterMethods it supports. |
int |
getTotalItemCount()
If the CMPagedResult can efficiently identify the total # of items in the collection, this method returns the total number of items in the collection. |
boolean |
hasNextPage()
Is there a next page? Will a call to nextPage() succeed? |
boolean |
hasPage(int pageNumber)
Does the given page exist? ICMPagedResult instances currently do not support direct page access, as reported by isGetPageSupported(), so this method always returns false. |
boolean |
hasPreviousPage()
Is there a previous page? Will a call to previousPage() succeed? |
boolean |
isCompleteResults()
Does this result represent a complete set of results? If not, then probably the maximum number of query results was reached and this iterator only represents a subset of the actual query. |
boolean |
isGetPageSupported()
Does this iterator allow random access to pages? This method (vs. |
Iterator<T> |
nextPage()
Get an iterator of the next page full of things. |
Iterator<T> |
previousPage()
Get an iterator of the previous page full of things. |
void |
reFilter(FilterMethod filterMethod,
String filterString,
String filterByProperty,
Locale filterLocale)
Refilter the results. |
void |
reset()
|
void |
resize(int requestedSize)
Set a new page size. |
void |
reSort(SortOrder sortOrder,
String sortByProperty,
Locale sortLocale)
Resort the results. |
void |
setBatchLoadingSize(int requestedSize)
Updates the batch loading size, and sets the page iterator position to its start position before the first page (just like creating a new PagedResult) The batch loading size specifies how many items are loaded at a time from the backing store when items are retrieved. |
Field Detail |
---|
static final ContextKey PAGE_SIZE_KEY
ContentContext
Specifies the pagesize to use. Page size must be positive.
Method Detail |
---|
int getPageSize()
PagedResult
getPageSize
in interface PagedResult<T>
int getTotalItemCount() throws RepositoryRuntimeException
getTotalItemCount
in interface PagedResult<T>
RepositoryRuntimeException
int getFullSize() throws RepositoryRuntimeException
RepositoryRuntimeException
int getPageCount() throws RepositoryRuntimeException
getPageCount
in interface PagedResult<T>
RepositoryRuntimeException
boolean isCompleteResults() throws RepositoryRuntimeException
PagedResult
isCompleteResults
in interface PagedResult<T>
RepositoryRuntimeException
int getCurrentPageNumber() throws RepositoryRuntimeException
PagedResult
getCurrentPageNumber
in interface PagedResult<T>
RepositoryRuntimeException
boolean hasPreviousPage() throws RepositoryRuntimeException
PagedResult
hasPreviousPage
in interface PagedResult<T>
RepositoryRuntimeException
boolean hasNextPage() throws RepositoryRuntimeException
PagedResult
hasNextPage
in interface PagedResult<T>
RepositoryRuntimeException
boolean isGetPageSupported() throws RepositoryRuntimeException
PagedResult
isGetPageSupported
in interface PagedResult<T>
RepositoryRuntimeException
boolean hasPage(int pageNumber) throws RepositoryRuntimeException
hasPage
in interface PagedResult<T>
RepositoryRuntimeException
Iterator<T> previousPage() throws NoSuchElementException, RepositoryRuntimeException
PagedResult
previousPage
in interface PagedResult<T>
NoSuchElementException
- if there is no previous page.
RepositoryRuntimeException
Iterator<T> currentPage() throws NoSuchElementException, RepositoryRuntimeException
NoSuchElementException
RepositoryRuntimeException
Iterator<T> nextPage() throws NoSuchElementException, RepositoryRuntimeException
PagedResult
nextPage
in interface PagedResult<T>
NoSuchElementException
- if there is no next page.
RepositoryRuntimeException
Iterator<T> getPage(int pageNumber)
getPage
in interface PagedResult<T>
void close()
PagedResult
close
in interface PagedResult<T>
void reset() throws RepositoryRuntimeException
RepositoryRuntimeException
void resize(int requestedSize) throws RepositoryRuntimeException
PagedResult
resize
in interface PagedResult<T>
RepositoryRuntimeException
SortOrder getSortOrder()
SortablePagedResult
getSortOrder
in interface SortablePagedResult<T>
String getSortProperty()
SortablePagedResult
getSortProperty
in interface SortablePagedResult<T>
Locale getSortLocale()
SortablePagedResult
getSortLocale
in interface SortablePagedResult<T>
void reSort(SortOrder sortOrder, String sortByProperty, Locale sortLocale) throws UnsupportedOperationException, RepositoryRuntimeException
SortablePagedResult
Most implementations should not simply reorder the current data, but should rather reissue page queries to retrieve sorted results.
reSort
in interface SortablePagedResult<T>
sortOrder
- the new order to use for sorting. Null is not allowed.sortByProperty
- the property of the result to use for sorting.
If sortOrder is UNSORTED, this property is probably ignored (and reSort is
not actually required to do anything at all). Must not be null or empty,
unless sortOrder is UNSORTED or the implementation chooses to ignore it.
Otherwise this must be one of the properties reported by getSortableProperties.sortLocale
- locale used to sort. Null implies that sorting should not
be based on Locale. Might be ignored if the bean or property being sorted
does not support locale-based sorting (i.e. the property is an Integer).
UnsupportedOperationException
- if the sort can not be performed on
the given property.
RepositoryRuntimeException
FilterMethod getFilterMethod() throws RepositoryRuntimeException
FilterablePagedResult
getFilterMethod
in interface FilterablePagedResult<T>
RepositoryRuntimeException
String getFilterString() throws RepositoryRuntimeException
FilterablePagedResult
getFilterString
in interface FilterablePagedResult<T>
RepositoryRuntimeException
String getFilterProperty() throws RepositoryRuntimeException
FilterablePagedResult
getFilterProperty
in interface FilterablePagedResult<T>
RepositoryRuntimeException
Locale getFilterLocale() throws RepositoryRuntimeException
FilterablePagedResult
getFilterLocale
in interface FilterablePagedResult<T>
RepositoryRuntimeException
void reFilter(FilterMethod filterMethod, String filterString, String filterByProperty, Locale filterLocale) throws UnsupportedOperationException, IllegalArgumentException, RepositoryRuntimeException
FilterablePagedResult
reFilter
in interface FilterablePagedResult<T>
filterMethod
- the new method to use for filtering. Null is not allowed.filterString
- the string to use for filtering.
If filterMethod is UNFILTERED, this is probably ignored,
but reFilter should then reissue the query to return a full unfiltered set
of results. May not be null or empty, unlesss filterMethod is UNFILTERED.filterByProperty
- the property of the result to use for filtering.
If filterMethod is UNFILTERED, this property is probably ignored (and
reFilter simply resets to the full result set). Must not be null or empty,
unless filterMethod is UNFILTERED or the implementation chooses to ignore it.
Oherwise this should match one of the names returned by getFilterableProperties.filterLocale
- locale used to filter. Null implies that filtering should not
be based on Locale. Might be ignored if the bean or property being filtered
does not support locale-based filtering (i.e. the property is an Integer or
has no associated localized content).
UnsupportedOperationException
- if filtering can not be performed for
the given property or method.
IllegalArgumentException
- if filterMethod is null, or if the filterExpression
or filterPropery are null or empty string when filterMethod is anything
other than UNFILTERED.
RepositoryRuntimeException
Set<String> getNativeSortableProperties() throws RepositoryRuntimeException
RepositoryRuntimeException
Set<FilterMethod> getNativeFilterMethods() throws RepositoryRuntimeException
RepositoryRuntimeException
Set<String> getNativeFilterableProperties() throws RepositoryRuntimeException
RepositoryRuntimeException
Set<String> getSortableProperties() throws RepositoryRuntimeException
SortablePagedResult
getSortableProperties
in interface SortablePagedResult<T>
RepositoryRuntimeException
Set<FilterMethod> getSupportedFilterMethods() throws RepositoryRuntimeException
FilterablePagedResult
getSupportedFilterMethods
in interface FilterablePagedResult<T>
RepositoryRuntimeException
Set<String> getFilterableProperties() throws RepositoryRuntimeException
FilterablePagedResult
getFilterableProperties
in interface FilterablePagedResult<T>
RepositoryRuntimeException
int getBatchLoadingSize() throws RepositoryRuntimeException
RepositoryRuntimeException
void setBatchLoadingSize(int requestedSize) throws RepositoryRuntimeException
The batch loading size must be either equal to the page size, or the special ContentListKeys.ALL_ITEMS size
NOTE: This method should only be called before calling nextPage(). If this method is called after calling nextPage(), a RepositoryRuntimeException will be thrown
NOTE: For performance reasons, rather than calling this method, it is preferable to configure the
batch size in the ContentContext (using ContentListKeys.BATCH_LOADING_SIZE_KEY
) before calling
the CM API to retrieve a PagedList.
RepositoryRuntimeException
|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.4) E14255-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |