Package org.opencms.jsp.search.config
Interface I_CmsSearchConfigurationPagination
-
- All Known Implementing Classes:
CmsSearchConfigurationPagination
public interface I_CmsSearchConfigurationPagination
The interface a pagination configuration must implement.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description 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.use eithergetSizeOfPage(int)
to get the size for a specific page orI_CmsSearchControllerPagination.getCurrentPageSize()
to get the size of the current page.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.
-
-
-
Method Detail
-
getNumPages
int getNumPages(long numFound)
Calculates the number of pages for the provided number of results.- Parameters:
numFound
- the number of results- Returns:
- the number of result pages for the provided number of results.
-
getPageNavLength
int getPageNavLength()
Returns the length of a "Google"-like navigation. Should typically be an odd number.- Returns:
- The length of a "Google"-like navigation.
-
getPageParam
java.lang.String getPageParam()
Returns the request parameter that should be used to send the current page.- Returns:
- The request parameter that should be used to send the current page.
-
getPageSize
@Deprecated int getPageSize()
Deprecated.use eithergetSizeOfPage(int)
to get the size for a specific page orI_CmsSearchControllerPagination.getCurrentPageSize()
to get the size of the current page.Returns the page size of pages that have not explicitely a size set. That means, if you specify the sizes [5,8], meaning the first page should have 5 entries, all others 8, the size 8 is returned by the method. To get the size of a specific page usegetSizeOfPage(int)
.- Returns:
- The page size of pages that have not explicitely a size set.
-
getPageSizes
java.util.List<java.lang.Integer> getPageSizes()
Returns the page sizes as configured for the first pages of the search. The last provided size is the size of all following pages.- Returns:
- the configured page sizes for the first pages.
-
getSizeOfPage
int getSizeOfPage(int pageNum)
Returns the page size for the provided page.- Parameters:
pageNum
- the number of the page (starting with 1) for which the size should be returned.- Returns:
- The page size for the provided page.
-
getStartOfPage
int getStartOfPage(int pageNum)
Returns the index of the first item to show on the given page.- Parameters:
pageNum
- the number of the page, for which the index of the first item to show on is requested.- Returns:
- the index of the first item to show on the provided page.
-
-