java.lang.Object
com.semanticcms.core.servlet.PageIndex
Captures all pages recursively and builds an index of pages
for fast page number lookups.
The index may be created on the entire site or single subtree.
The index is used when presenting multiple pages in a combined view.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ScopeEE.Request.Attribute
<PageIndex> The request scope variable containing any active page index. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendIdInPage
(PageIndex pageIndex, Page page, String id, Appendable out) Appends an id for use in referencing the given page.static void
appendIdInPage
(Integer index, String id, Appendable out) Appends an id for use in referencing the page at the given index.static PageIndex
getCurrentPageIndex
(ServletRequest request) Gets the current page index setup by a combined view ornull
if not doing a combined view.getPageIndex
(PageRef pagePath) static PageIndex
getPageIndex
(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, PageRef rootPageRef) Captures the root with META capture level and all children as PAGE.static String
Gets an id for use in referencing the page at the given index.static String
getRefId
(ServletContext servletContext, HttpServletRequest request, PageIndex pageIndex, String id) Gets an id for use in the current page.static String
getRefId
(ServletContext servletContext, HttpServletRequest request, String id) Gets an id for use in the current page.static String
getRefIdInPage
(PageIndex pageIndex, Page page, String id) Gets an id for use in referencing the given page.static String
getRefIdInPage
(HttpServletRequest request, Page page, String id) Gets an id for use in referencing the given page.The root page, captured in META level.
-
Field Details
-
REQUEST_ATTRIBUTE
The request scope variable containing any active page index.
-
-
Method Details
-
getCurrentPageIndex
Gets the current page index setup by a combined view ornull
if not doing a combined view. -
getPageIndex
public static PageIndex getPageIndex(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, PageRef rootPageRef) throws ServletException, IOException Captures the root with META capture level and all children as PAGE.- Throws:
ServletException
IOException
-
getRefId
Gets an id for use in referencing the page at the given index. If the index is non-null, as in a combined view, will be "page#-id". Otherwise, the id is unchanged.- Parameters:
id
- optional, id not added when null or empty- See Also:
-
getRefId
public static String getRefId(ServletContext servletContext, HttpServletRequest request, PageIndex pageIndex, String id) throws ServletException Gets an id for use in the current page. If the page is part of a page index, as in a combined view, will be "page#-id". Otherwise, the id is unchanged.- Parameters:
id
- optional, id not added when null or empty- Throws:
ServletException
-
getRefId
public static String getRefId(ServletContext servletContext, HttpServletRequest request, String id) throws ServletException Gets an id for use in the current page. If the page is part of a page index, as in a combined view, will be "page#-id". Otherwise, the id is unchanged.- Parameters:
id
- optional, id not added when null or empty- Throws:
ServletException
-
getRefIdInPage
Gets an id for use in referencing the given page. If the page is part of a page index, as in a combined view, will be "page#-id". Otherwise, the id is unchanged.- Parameters:
id
- optional, id not added when null or empty- See Also:
-
getRefIdInPage
Gets an id for use in referencing the given page. If the page is part of a page index, as in a combined view, will be "page#-id". Otherwise, the id is unchanged.- Parameters:
id
- optional, id not added when null or empty- See Also:
-
appendIdInPage
Appends an id for use in referencing the page at the given index. If the index is non-null, as in a combined view, will be "page#-id". Otherwise, the id is unchanged.- Parameters:
id
- optional, id not added when null or empty- Throws:
IOException
-
appendIdInPage
public static void appendIdInPage(PageIndex pageIndex, Page page, String id, Appendable out) throws IOException Appends an id for use in referencing the given page.- Parameters:
id
- optional, id not added when null or empty- Throws:
IOException
- See Also:
-
getRootPage
The root page, captured in META level. -
getPageList
-
getPageIndexes
-
getPageIndex
-