Package com.jalios.jcms.handler
Class PagerHandler
java.lang.Object
com.jalios.jcms.context.JcmsContext
com.jalios.jcms.handler.PagerHandler
- All Implemented Interfaces:
JcmsConstants,JaliosConstants
This form handler process pager properties.
It provides methods to retrieve common URLs needed to navigate using the pager.
Unless really needed, you should prefer the use of the PagerTag inside your jsp rather than
directly use this class.
We use a compute method in order to be able for the PagerTag to provide the handler first even
when the size/itemsNbr is not known yet.
- Author:
- Olivier Jaquemet
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final Stringstatic final StringPrefix of request attributes name to force values of : "pageSize", "sort", "reverse" (before pager creation) and "pagerAll", "start" (before computation).static final StringRequest attribute name to retrieve the PagerHandler instance in a pager template.static final int[]static final intstatic final StringRequest attribute name to retrieve the name of the pager template being processed.Fields inherited from class com.jalios.jcms.context.JcmsContext
browser, caddy, channel, inFO, initDone, initWorkspace, isAdmin, isAjaxRequest, isDBMember, isDebug, isDebugTemplatePath, isLogged, loggedMember, request, response, userCountry, userLang, userLocale, userZoneId, workspaceFields inherited from interface com.jalios.util.JaliosConstants
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEARFields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, CLASS_PROPERTY, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, CS_TYPOLOGY_ROOT_CAT_VID, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DATA_DIRECTORY, DEFAULT_PHOTO_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, GENERATIONAL_STORE_DIRECTORY, GLYPH_ICON_PREFIX, ICON_ARCHIVE, ICON_ICON_PREFIX, ICON_LOCK, ICON_LOCK_STRONG, ICON_PREFIX_PROP, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, IS_IN_FRONT_OFFICE, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JCMS_TOASTR_COLLECTION, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LANG_SPRITE, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, ORGANIZATION_ROOT_GROUP_PROP, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_PROP_PREFIX, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_PROP_PREFIX, PHOTO_LARGE_WIDTH, PHOTO_MINI, PHOTO_MINI_HEIGHT, PHOTO_MINI_PROP_PREFIX, PHOTO_MINI_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_PROP_PREFIX, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_PROP_PREFIX, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_PROP_PREFIX, PHOTO_TINY_WIDTH, PHOTO_XLARGE, PHOTO_XLARGE_HEIGHT, PHOTO_XLARGE_PROP_PREFIX, PHOTO_XLARGE_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, RAW_CONTENT_ICON_PREFIX, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SECURITY_LOG_FILE, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, SUCCESS_MSG, SVG_ICON_PREFIX, SVGINLINE_ICON_PREFIX, SVGSPRITE_ICON_PREFIX, TEMPLATE_TAB, THEME_DIR, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TTCARD_MEDIA_HEIGHT, TTCARD_MEDIA_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, TYPES_UNKNOWN_CLASS_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, UPLOAD_PERMISSION_COUNT_PROP_PREFIX, UPLOAD_PERMISSION_SIZE_PROP_PREFIX, URL_REGEXP, VID_LOGGED_MEMBER, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML -
Constructor Summary
ConstructorsConstructorDescriptionPagerHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String pParamPrefix, int pDefaultPageSize, String pDefaultSort, boolean pDefaultReverse, int[] pPageSizes, int pPagerAllLimit, Map<String, String> pParameterMap, int[] pPagesDisplayed, boolean pIsSizeAccurate) Build a new PagerHandler. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the pager all link can be displayed.
This method CANNOT be called as long as the computation is not done.voidClear all session parameters of this pager, if the paramPrefix specified is a portlet action param (starts withPortalManager.PORTAL_ACTION).voidcompute(int pItemsNbr) Do the computation for this Pager HandlervoidDisplay the pager using the specified template.
This method CANNOT be called as long as the computation is not done.Gets the accessible name of the pagination navigation landmark.intThis method CANNOT be called as long as the computation is not done.This method CANNOT be called as long as the computation is not done.intRetrieves the number of items managed by this pager.
This method CANNOT be called as long as the computation is not done.getLabel()Gets the label displayed next to the items-per-page selector.This method CANNOT be called as long as the computation is not done.Sets the css to use in links (default is empty).This method CANNOT be called as long as the computation is not done.intRetrieves the number of items displayed in current page.
This method CANNOT be called as long as the computation is not done.getPageLinkURL(int pageIdx) This method CANNOT be called as long as the computation is not done.This method CANNOT be called as long as the computation is not done.intThis method CANNOT be called as long as the computation is not done.int[]Retrieves the page sizes to be displayed for this pager.
This method CANNOT be called as long as the computation is not done.intRetrieves the number of the last page link to be displayed.
This method CANNOT be called as long as the computation is not done.int[]Retrieves the page link numbers to be displayed.
This method CANNOT be called as long as the computation is not done.intRetrieves the number of the first page link to be displayed.
This method CANNOT be called as long as the computation is not done.intRetrieves the total number of pages of this pager .
This method CANNOT be called as long as the computation is not done.This method CANNOT be called as long as the computation is not done.booleanbooleanThis method CANNOT be called as long as the computation is not done.getShowPageSizeURL(int pPageSize) This method CANNOT be called as long as the computation is not done.getSort()This method can be called when the computation has not yet been done.getSortURL(String pSort) Return an URL to sort with given sort order.getSortURL(String pSort, boolean pReverse) This method CANNOT be called as long as the computation is not done.intgetStart()Retrieves the start item idx of the pager.
This method CANNOT be called as long as the computation is not done.booleanbooleanThis method CANNOT be called as long as the computation is not done.booleanThis method CANNOT be called as long as the computation is not done.booleanChecks if this pager is in pager all mode.
This method CANNOT be called as long as the computation is not done.booleanThis method can be called when the computation has not yet been done.booleanvoidprintAllPager(javax.servlet.jsp.JspWriter out) Print a complete pager to the given output.voidprintFirstLink(javax.servlet.jsp.JspWriter out) Print on the given JspWriter a link to show the First page.voidprintLastLink(javax.servlet.jsp.JspWriter out) Print a link to navigate to the Last Page.voidprintNextLink(javax.servlet.jsp.JspWriter out) Print a link to navigate to the next page.voidprintPagerAllLink(javax.servlet.jsp.JspWriter out) Print a "Pager All" link to the given output (only if items nbr is allowed by property pager.show-all-limit).voidprintPagesLinks(javax.servlet.jsp.JspWriter out) Print a list of links for current accessible pages to the given output.voidprintPreviousLink(javax.servlet.jsp.JspWriter out) Print a link to navigate to the previous page.voidprintShowPagerLink(javax.servlet.jsp.JspWriter out) Print a "Show Pager" link to the given output.booleanprintShowPageSizesLink(javax.servlet.jsp.JspWriter out) Print a list of links for changing the current page size (must be a valid page size as specified in property pager.page-sizes).voidprintSortLink(javax.servlet.jsp.JspWriter out, String pSort, String pTitleProp) Print a link to sort with given sort order.voidsetAriaLabel(String ariaLabel) Sets the accessible name of the pagination navigation landmark.voidSets the label displayed next to the page size selector in the pager.voidsetLinkCss(String css) Sets the css to use in links (default is empty).voidsetResourcePath(String resourcePath) Sets the resourcePath to use in the url instead of using the current request resource path (default is null).voidsetShowFirstLink(boolean showFirstLink) voidsetShowLastLink(boolean showLastLink) voidsetSizeAccurate(boolean isSizeAccurate) toString()Methods inherited from class com.jalios.jcms.context.JcmsContext
addMsg, addMsg, addMsgSession, addMsgSession, addToastr, addToastr, addToastrSession, addToastrSession, applySelector, canAccessAdminArea, copyMsgListToMsgSessionList, forceUpdate, forceWorkspaceUpdate, getBaseUrl, getBrowser, getCaddy, getContextPath, getErrorMsg, getErrorMsgList, getErrorMsgSession, getErrorMsgSessionList, getInfoMsg, getInfoMsgList, getInfoMsgSession, getInfoMsgSessionList, getLoggedMember, getMsgList, getMsgSessionList, getRequest, getResponse, getSession, getSuccessMsg, getSuccessMsgList, getSuccessMsgSession, getSuccessMsgSessionList, getToastrCollection, getToastrSessionCollection, getUploadedFiles, getUploadedFiles, getUrlWithCommonUpdatedParams, getUserCountry, getUserLang, getUserLocale, getUserZoneId, getWarningMsg, getWarningMsgList, getWarningMsgSession, getWarningMsgSessionList, getWorkspace, glp, isAdmin, isAdminZone, isAjaxRequest, isDBMember, isDebug, isDebugTemplate, isInFrontOffice, isLogged, isWorkZone, removeMessage, removeMessage, removeMsg, select, sendError, sendError, sendForbidden, sendForbidden, sendRedirect, sendRedirect, sendRedirect, sendRedirect, setErrorMsg, setErrorMsg, setErrorMsgSession, setErrorMsgSession, setInfoMsg, setInfoMsg, setInfoMsgSession, setInfoMsgSession, setLoggedMember, setRequest, setResponse, setSuccessMsg, setSuccessMsg, setSuccessMsgSession, setSuccessMsgSession, setWarningMsg, setWarningMsg, setWarningMsgSession, setWarningMsgSession, updateWorkspace, validateRegexp, validateSchedule
-
Field Details
-
PAGE_SIZES
public static final int[] PAGE_SIZES -
PAGER_ALL_LIMIT
public static final int PAGER_ALL_LIMIT -
DEFAULT_PAGE_SIZE
public static final int DEFAULT_PAGE_SIZE -
DEFAULT_SORT
-
FORCED_PARAM_PREFIX
Prefix of request attributes name to force values of : "pageSize", "sort", "reverse" (before pager creation) and "pagerAll", "start" (before computation).
For example, before a call to the pager tag, you could force the start value to be at the index of a specific item (do not forget the paramPrefix).request.setAttribute(FORCED_PARAM_PREFIX + myPagerParamPrefix + "start", String.valueOf(myItemIdx));- See Also:
-
HANDLER_ATTRIBUTE
Request attribute name to retrieve the PagerHandler instance in a pager template.PagerHandler handler = (PagerHandler) request.getAttribute(PagerHandler.HANDLER_ATTRIBUTE);- See Also:
-
TEMPLATE_NAME_ATTRIBUTE
Request attribute name to retrieve the name of the pager template being processed.String template = (String) request.getAttribute(PagerHandler.TEMPLATE_NAME_ATTRIBUTE);- See Also:
-
-
Constructor Details
-
PagerHandler
public PagerHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String pParamPrefix, int pDefaultPageSize, String pDefaultSort, boolean pDefaultReverse, int[] pPageSizes, int pPagerAllLimit, Map<String, String> pParameterMap, int[] pPagesDisplayed, boolean pIsSizeAccurate) Build a new PagerHandler.
Mainly used by the PagerTag.- Parameters:
request- the HttpServletRequest as needed by super class JcmsContextresponse- the HttpServletResponse as needed by super class JcmsContextpParamPrefix- an optional prefix to use for all pager parameterspDefaultPageSize- the default page size to use for this pager. Leave below 0 to use default value specified in "pager.default-page-size", 10.pDefaultSort- the default sort order to use, possible values are defined by all the comparator available throughComparatorManager. Leave empty to use default value specified in "pager.default-sort", "".pDefaultReverse- whether to reverse the sort (true) order or not (false).pPageSizes- the page sizes allowed for this pager, if null, the values specified in the property "pager.page-sizes" are used, {10, 20, 50}. If the default page size is not one of those, it is automatically added to possible page size.pPagerAllLimit- the maximum number of items above which the pager all link won't be displayed. Leave below 0 to use default value specified in "pager.pager-all-limit", 500.pParameterMap- an optional Map of parameters (String name/ String value) to be added/modified/removed to every URLs generated by this pager. For example, { "openTab" ==> "2", "highlight" ==> "hello world" }.pPagesDisplayed- maximum number of page links to display :
- before current page, pPagesDisplayed[0] (default is 2)
- after current page, pPagesDisplayed[1] (default is 2)
pIsSizeAccurate- indicates if the size is accurate.
-
-
Method Details
-
compute
public void compute(int pItemsNbr) Do the computation for this Pager Handler- Parameters:
pItemsNbr- the number of items in the pager
-
isComputed
public boolean isComputed()- Returns:
- true if the computation for this PagerHandler has been done
- See Also:
-
setResourcePath
Sets the resourcePath to use in the url instead of using the current request resource path (default is null).- Parameters:
resourcePath- the resource path that will be used in all url, can be empty, but if null, the resourcePath of current request will be used.- Throws:
IllegalStateException- if this method is called AFTER all parameters have been set
-
setLinkCss
Sets the css to use in links (default is empty).- Parameters:
css- a string of classnames to be used in pager links, e.g."pager-link"
-
getLinkCss
Sets the css to use in links (default is empty).- Returns:
- the string of classnames to be used in pager links, e.g.
"pager-link"
-
setLabel
Sets the label displayed next to the page size selector in the pager.- Parameters:
label- the text to display (e.g."Items per page")
-
getLabel
Gets the label displayed next to the items-per-page selector.- Returns:
- the label text (e.g.
"Items per page") - Since:
- jplatform-11.0.0
-
setAriaLabel
Sets the accessible name of the pagination navigation landmark.- Parameters:
ariaLabel- the accessible name as plain text- Since:
- jplatform-11.0.1
-
getAriaLabel
Gets the accessible name of the pagination navigation landmark.- Returns:
- the custom name or the localized default pagination label
- Since:
- jplatform-11.0.1
-
getSortURL
Return an URL to sort with given sort order. If given sort order is the one currently used, the link will be the opposite order of the current one, otherwise we use the default sort order- Parameters:
pSort- the sort order to use (usually a comparator name as available throughComparatorManager).- Returns:
- a relative URL to sort with given sort order.
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
getSortURL
This method CANNOT be called as long as the computation is not done.- Parameters:
pSort- the sort order to use (usually a comparator name as available throughComparatorManager).pReverse- whether the sort order should be ascending or descending- Returns:
- an URL to sort with given sort and reverse order.
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
printSortLink
public void printSortLink(javax.servlet.jsp.JspWriter out, String pSort, String pTitleProp) throws IOException Print a link to sort with given sort order. If given sort order is the one currently used, the link will be the reverse order.- Parameters:
out- the JspWriter to use for printing, must not be null.pSort- the sort order to use, must not be empty (usually a comparator name as available throughComparatorManager)pTitleProp- an optional I18N string to be used in the generated A tag (<a>{glp(pTitleProp)}</a>)- Throws:
IOException- if an error occured when printing to specified JspWriterIllegalArgumentException- ifpSortis null or emptyIllegalStateException- if this method is called before all parameters have been set
-
getFirstLinkURL
This method CANNOT be called as long as the computation is not done.- Returns:
- an URL to show the First page.
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
printFirstLink
Print on the given JspWriter a link to show the First page. unless we are already on the first page in case we just print the text of the link. This method CANNOT be called as long as the computation is not done.- Parameters:
out- the JspWriter to use for printing, must not be null.- Throws:
IOException- if an error occured when printing to specified JspWriterIllegalStateException- if this method is called before all parameters have been set
-
getPreviousLinkURL
This method CANNOT be called as long as the computation is not done.- Returns:
- an URL to show the Previous page.
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
printPreviousLink
Print a link to navigate to the previous page. This method CANNOT be called as long as the computation is not done.- Parameters:
out- the JspWriter to use for printing, must not be null.- Throws:
IOException- if an error occured when printing to specified JspWriterIllegalStateException- if this method is called before all parameters have been set
-
getPageLinkURL
This method CANNOT be called as long as the computation is not done.- Parameters:
pageIdx- a new page index to navigate to, with1 <= pageIdx <= pagesNbr- Returns:
- an URL to show the given page idx.
- Throws:
IllegalArgumentException- ifpageIdxdoes not match the requirements1 <= pageIdx <= pagesNbrIllegalStateException- if this method is called before all parameters have been set
-
printPagesLinks
Print a list of links for current accessible pages to the given output. This method CANNOT be called as long as the computation is not done.- Parameters:
out- the JspWriter to use for printing, must not be null.- Throws:
IOException- if an error occured when printing to specified JspWriterIllegalStateException- if this method is called before all parameters have been set
-
getNextLinkURL
This method CANNOT be called as long as the computation is not done.- Returns:
- an URL to show the Next page.
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
printNextLink
Print a link to navigate to the next page. This method CANNOT be called as long as the computation is not done.- Parameters:
out- the JspWriter to use for printing, must not be null.- Throws:
IOException- if an error occured when printing to specified JspWriterIllegalStateException- if this method is called before all parameters have been set
-
getLastLinkURL
This method CANNOT be called as long as the computation is not done.- Returns:
- an URL to show the Last page.
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
printLastLink
Print a link to navigate to the Last Page. This method CANNOT be called as long as the computation is not done.- Parameters:
out- the JspWriter to use for printing, must not be null.- Throws:
IOException- if an error occured when printing to specified JspWriterIllegalStateException- if this method is called before all parameters have been set
-
getShowPageSizeURL
This method CANNOT be called as long as the computation is not done.- Parameters:
pPageSize- a new valid page size to use for the link- Returns:
- an URL to show the pager with the given page size (must be a valid page size as specified in property pager.page-sizes).
- Throws:
IllegalArgumentException- ifpPageSizeis not a valide page size for this pagerIllegalStateException- if this method is called before all parameters have been set
-
printShowPageSizesLink
Print a list of links for changing the current page size (must be a valid page size as specified in property pager.page-sizes). This method CANNOT be called as long as the computation is not done.- Parameters:
out- the JspWriter to use for printing, must not be null.- Returns:
- false if there is juste one page to display and therefore nothing was printed, true otherwise (something was printed)
- Throws:
IOException- if an error occured when printing to specified JspWriterIllegalStateException- if this method is called before all parameters have been set
-
getPagerAllURL
This method CANNOT be called as long as the computation is not done.- Returns:
- an URL to show the pager in pager all mode (only if items nbr is allowed by pager and by property pager.show-all-limit).
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
printPagerAllLink
Print a "Pager All" link to the given output (only if items nbr is allowed by property pager.show-all-limit). This method CANNOT be called as long as the computation is not done.- Parameters:
out- the JspWriter to use for printing, must not be null.- Throws:
IOException- if an error occured when printing to specified JspWriterIllegalStateException- if this method is called before all parameters have been set
-
getShowPagerURL
This method CANNOT be called as long as the computation is not done.- Returns:
- an URL to show the pager when hidden (opposite of pager all mode).
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
printShowPagerLink
Print a "Show Pager" link to the given output. This method CANNOT be called as long as the computation is not done.- Parameters:
out- the JspWriter to use for printing, must not be null.- Throws:
IOException- if an error occured when printing to specified JspWriterIllegalStateException- if this method is called before all parameters have been set
-
printAllPager
Print a complete pager to the given output. This method CANNOT be called as long as the computation is not done.- Parameters:
out- the JspWriter to use for printing, must not be null.- Throws:
IOException- if an error occured when printing to specified JspWriterIllegalStateException- if this method is called before all parameters have been set
-
display
public void display(javax.servlet.jsp.PageContext pageContext, String template) throws javax.servlet.ServletException, IOException Display the pager using the specified template.
This method CANNOT be called as long as the computation is not done.- Parameters:
pageContext- the Jsp PageContext for which the page is being displayedtemplate- the template name (retrieved using propertypager.template.{templateName}: /path/to.jsp- Throws:
javax.servlet.ServletException- if an error occursIOException- if an error occursIllegalArgumentException- if the specified template does not exists- Since:
- jcms-6.0
-
getSort
This method can be called when the computation has not yet been done.- Returns:
- the current sort order as a string
-
isReverse
public boolean isReverse()This method can be called when the computation has not yet been done.- Returns:
- true if the current sort order is reversed, false otherwise
-
getPageSize
public int getPageSize()This method CANNOT be called as long as the computation is not done.- Returns:
- the page size of the pager, return itemsNbr if in pager all mode
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
getPageSizes
public int[] getPageSizes()Retrieves the page sizes to be displayed for this pager.
This method CANNOT be called as long as the computation is not done.- Returns:
- an array of page size.
- Throws:
IllegalStateException- if this method is called before all parameters have been set- Since:
- jcms-6.0
-
canShowPagerAll
public boolean canShowPagerAll()Check if the pager all link can be displayed.
This method CANNOT be called as long as the computation is not done.- Returns:
- true if the items nbr is below the pager all limit, false otherwise.
- Throws:
IllegalStateException- if this method is called before all parameters have been set- Since:
- jcms-6.0
-
isPagerAll
public boolean isPagerAll()Checks if this pager is in pager all mode.
This method CANNOT be called as long as the computation is not done.- Returns:
- true if the pager is in pager all mode AND items nbr is below the pager all limit, false otherwise.
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
getStart
public int getStart()Retrieves the start item idx of the pager.
This method CANNOT be called as long as the computation is not done.- Returns:
- the start item idx of the pager (always >= 0 and < itemNbr), return 0 if in pager all mode
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
getItemsNbr
public int getItemsNbr()Retrieves the number of items managed by this pager.
This method CANNOT be called as long as the computation is not done.- Returns:
- the number of items managed by this pager.
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
getPageItemsNbr
public int getPageItemsNbr()Retrieves the number of items displayed in current page.
This method CANNOT be called as long as the computation is not done.- Returns:
- the number of items displayed in current page.
- Throws:
IllegalStateException- if this method is called before all parameters have been set- Since:
- jcms-9.0.1
-
getPagesNbr
public int getPagesNbr()Retrieves the total number of pages of this pager .
This method CANNOT be called as long as the computation is not done.- Returns:
- the total number of pages (1 if we are in pager all mode)
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
getCurrentPage
public int getCurrentPage()This method CANNOT be called as long as the computation is not done.- Returns:
- the current page number (from 1 to pages nbr) (1 if we are in pager all mode)
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
isFirstPage
public boolean isFirstPage()This method CANNOT be called as long as the computation is not done.- Returns:
- the true if the current page is the first one (always true when in pager all mode)
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
isLastPage
public boolean isLastPage()This method CANNOT be called as long as the computation is not done.- Returns:
- the true if the current page is the last one (always true when in pager all mode)
- Throws:
IllegalStateException- if this method is called before all parameters have been set
-
getPagesLinksStartNbr
public int getPagesLinksStartNbr()Retrieves the number of the first page link to be displayed.
This method CANNOT be called as long as the computation is not done.- Returns:
- a page number
- Since:
- jcms-6.0
-
getPagesLinksNbrs
public int[] getPagesLinksNbrs()Retrieves the page link numbers to be displayed.
This method CANNOT be called as long as the computation is not done.- Returns:
- an array of page number
- Since:
- jcms-6.0
-
getPagesLinksEndNbr
public int getPagesLinksEndNbr()Retrieves the number of the last page link to be displayed.
This method CANNOT be called as long as the computation is not done.- Returns:
- a page number
- Since:
- jcms-6.0
-
getShowFirstLink
public boolean getShowFirstLink() -
setShowFirstLink
public void setShowFirstLink(boolean showFirstLink) -
getShowLastLink
public boolean getShowLastLink() -
setShowLastLink
public void setShowLastLink(boolean showLastLink) -
isSizeAccurate
public boolean isSizeAccurate() -
setSizeAccurate
public void setSizeAccurate(boolean isSizeAccurate) -
clearSessionParams
public void clearSessionParams()Clear all session parameters of this pager, if the paramPrefix specified is a portlet action param (starts withPortalManager.PORTAL_ACTION).Invoking this method will therefore reset the parameters and next request for the same pager (parameter prefix) will not have memorized the pager options (sorting/paging).
- Since:
- jcms-7.0.0
-
toString
-