|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ICMSQuery
Represents a CMS query that can be reused and passed to the InfoStore. The CMS query represents
a page of objects. By default, each page is quite large, at 1000 objects. This coincides with
regular CMS query syntax, the amount of objects returned from CMS is defined by its TOP N
parameter. If TOP N is not specified it defaults to 1000 objects.
By using ICMSQuery you can determine the size of each page and which page you want to view. One
thing to be aware of is if you adjust the page size, by default the ICMSQuery will query for the
objects at its original page number. For example, if you have 100 objects, your page size is 10
and you're on page 2, objects 11 - 20 are represented by this ICMSQuery. If you call
setPageSize(5), and you query again, objects 5 - 10 will be returned. If you want
objects 11-15, you'll need to change the page number to page 3 by calling
ICMSQuery.setCurrentPageNumber(int).
ICMSQuery also exposes some configurable options (ICMSQuery.getQueryConfig()) that can be passed
to the CMS, such as object caching.
| Method Summary | |
|---|---|
int |
getCurrentPageNumber()
Returns the page number (base 1 index) this ICMSQuery represents. |
int |
getPageAlignment()
Returns the number of objects which are not included in the first page. |
int |
getPageSize()
Returns the number of objects to be queried for |
IQueryConfiguration |
getQueryConfig()
Returns the configuration for this ICMSQuery |
boolean |
hasNextPage()
Determines whether a page exists after the current page. |
void |
nextPage()
Increments to the next page |
int |
queryForLastPageNumber()
Queries the CMS and traverses through all the InfoObjects up to the last page to return its page number (pages start at 1). |
void |
setCurrentPageNumber(int pageNumber)
Set a different page number (base 1 index) to query for. |
void |
setPageSize(int n)
Sets the number of objects to be queried for. |
void |
setQueryConfig(IQueryConfiguration config)
Sets the configuration for this ICMSQuery |
| Method Detail |
|---|
int getPageAlignment()
int getPageSize()
void setPageSize(int n)
Sets the number of objects to be queried for. Defaults to 1000 if not set. The page number is
maintained; the current object index is not. For example if you're on page 2 with a page size
of 10 this ICMSQuery represents objects 11-20. If you call ICMSQuery.setPageSize(int),
changing the page size to 5, the page number is maintained, and this ICMSQuery represents
objects 6-10.
The TOP M-N specification in the original query will be respected if the query
is created with maintainTopN set to true in IInfoStore.createCMSQuery.
For example if you are querying for "top 4-10" with a page size of 3, then the first page will
contain top 4-6 and second page top 7-9 and third page top 10-10. Now suppose you are on page
2. If you call #setPageSize(int, boolean) with maintainTopN = true, and change the page
size to 5, the page number is maintained, and this ICMSQuery represents objects top 9-10.
n - The new page size. A positive number.int getCurrentPageNumber()
void setCurrentPageNumber(int pageNumber)
pageNumber - IQueryConfiguration getQueryConfig()
void setQueryConfig(IQueryConfiguration config)
int queryForLastPageNumber()
throws SDKException
SDKException
boolean hasNextPage()
throws SDKException
ICMSQuery.setCurrentPageNumber(int). This hasNextPage version maintains/ignores the topN specification
in the original query depending on how the maintainTopN flag is set in IInfoStore.createCMSQuery.
SDKException - Can be thrown if this ICMSQuery represents a malformed queryvoid nextPage()
SDKException - Can be thrown if this ICMSQuery represents a malformed queryICMSQuery.setCurrentPageNumber(int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||