public class CmsSearchConfigurationPagination extends java.lang.Object implements I_CmsSearchConfigurationPagination
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PAGE_NAV_LENGTH
The default "Google"-like page navigation length.
|
static java.lang.String |
DEFAULT_PAGE_PARAM
The default request parameter to read the current page from.
|
static java.util.List<java.lang.Integer> |
DEFAULT_PAGE_SIZE
The default page size.
|
| Constructor and Description |
|---|
CmsSearchConfigurationPagination(java.lang.String pageParam,
java.lang.Integer pageSize,
java.lang.Integer pageNavLength)
Constructor setting all configuration options for the pagination.
|
CmsSearchConfigurationPagination(java.lang.String pageParam,
java.util.List<java.lang.Integer> pageSizes,
java.lang.Integer pageNavLength)
Constructor setting all configuration options for the pagination.
|
| Modifier and Type | Method and Description |
|---|---|
static I_CmsSearchConfigurationPagination |
create(java.lang.String pageParam,
java.util.List<java.lang.Integer> pageSizes,
java.lang.Integer pageNavLength)
Creates a new pagination configuration if at least one of the provided parameters is not null.
|
int |
getNumPages(long numFound)
Calculates the number of pages for the provided number of results.
|
int |
getPageNavLength()
Returns the length of a "Google"-like navigation.
|
java.lang.String |
getPageParam()
Returns the request parameter that should be used to send the current page.
|
int |
getPageSize()
Deprecated.
|
java.util.List<java.lang.Integer> |
getPageSizes()
Returns the page sizes as configured for the first pages of the search.
|
int |
getSizeOfPage(int pageNum)
Returns the page size for the provided page.
|
int |
getStartOfPage(int pageNum)
Returns the index of the first item to show on the given page.
|
public static final java.util.List<java.lang.Integer> DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_NAV_LENGTH
public static final java.lang.String DEFAULT_PAGE_PARAM
public CmsSearchConfigurationPagination(java.lang.String pageParam, java.lang.Integer pageSize, java.lang.Integer pageNavLength)
pageParam - The request parameter used to send the current page number.pageSize - The page size.pageNavLength - The length of the "Google"-like page navigation. Should be an odd number.public CmsSearchConfigurationPagination(java.lang.String pageParam, java.util.List<java.lang.Integer> pageSizes, java.lang.Integer pageNavLength)
pageParam - The request parameter used to send the current page number.pageSizes - The page sizes for the first pages. The last provided size is the size of all following pages.pageNavLength - The length of the "Google"-like page navigation. Should be an odd number.public static I_CmsSearchConfigurationPagination create(java.lang.String pageParam, java.util.List<java.lang.Integer> pageSizes, java.lang.Integer pageNavLength)
pageParam - The request parameter used to send the current page number.pageSizes - The page sizes for the first pages. The last provided size is the size of all following pages.pageNavLength - The length of the "Google"-like page navigation. Should be an odd number.null if none of the provided parameters is not null.public int getNumPages(long numFound)
I_CmsSearchConfigurationPaginationgetNumPages in interface I_CmsSearchConfigurationPaginationnumFound - the number of resultsI_CmsSearchConfigurationPagination.getNumPages(long)public int getPageNavLength()
I_CmsSearchConfigurationPaginationgetPageNavLength in interface I_CmsSearchConfigurationPaginationI_CmsSearchConfigurationPagination.getPageNavLength()public java.lang.String getPageParam()
I_CmsSearchConfigurationPaginationgetPageParam in interface I_CmsSearchConfigurationPaginationI_CmsSearchConfigurationPagination.getPageParam()@Deprecated public int getPageSize()
I_CmsSearchConfigurationPagination.getPageSize()I_CmsSearchConfigurationPaginationI_CmsSearchConfigurationPagination.getSizeOfPage(int).getPageSize in interface I_CmsSearchConfigurationPaginationI_CmsSearchConfigurationPagination.getPageSize()public java.util.List<java.lang.Integer> getPageSizes()
I_CmsSearchConfigurationPaginationgetPageSizes in interface I_CmsSearchConfigurationPaginationI_CmsSearchConfigurationPagination.getPageSizes()public int getSizeOfPage(int pageNum)
I_CmsSearchConfigurationPaginationgetSizeOfPage in interface I_CmsSearchConfigurationPaginationpageNum - the number of the page (starting with 1) for which the size should be returned.I_CmsSearchConfigurationPagination.getSizeOfPage(int)public int getStartOfPage(int pageNum)
I_CmsSearchConfigurationPaginationgetStartOfPage in interface I_CmsSearchConfigurationPaginationpageNum - the number of the page, for which the index of the first item to show on is requested.I_CmsSearchConfigurationPagination.getStartOfPage(int)