public class HierarchyUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addEntryPointPage(org.apache.sling.api.SlingHttpServletRequest request,
com.day.cq.wcm.api.Page currentPage,
@NotNull List<com.day.cq.wcm.api.Page> descendedPages)
Optionally adds a page that is the entry point of a site model request, even when was not added because of the root structure
configuration
|
static org.apache.sling.api.SlingHttpServletRequest |
createHierarchyServletRequest(@NotNull org.apache.sling.api.SlingHttpServletRequest request,
com.day.cq.wcm.api.Page page,
com.day.cq.wcm.api.Page entryPage)
Creates a new request wrapping the
request from the parameters. |
protected static @Nullable Page |
getDescendantModel(com.day.cq.wcm.api.Page childPage,
org.apache.sling.api.SlingHttpServletRequest slingRequestWrapper,
org.apache.sling.models.factory.ModelFactory modelFactory) |
static @NotNull List<com.day.cq.wcm.api.Page> |
getDescendants(com.day.cq.wcm.api.Page page,
org.apache.sling.api.SlingHttpServletRequest slingRequest,
List<Pattern> structurePatterns,
int depth)
Traverses the tree of descendants of the page.
|
static @NotNull Map<String,Page> |
getDescendantsModels(org.apache.sling.api.SlingHttpServletRequest request,
com.day.cq.wcm.api.Page currentPage,
com.day.cq.wcm.api.designer.Style currentStyle,
org.apache.sling.models.factory.ModelFactory modelFactory)
Returns all descended page models of the currentPage plus the entryPoint page (even if was excluded based on rules enforced by
filterPatterns or traversalDepth)
|
static com.day.cq.wcm.api.Page |
getEntryPoint(@NotNull org.apache.sling.api.SlingHttpServletRequest request)
Returns the request's entry point attribute value
|
static com.day.cq.wcm.api.Page |
getRootPage(org.apache.sling.api.resource.Resource resource,
com.day.cq.wcm.api.Page currentPage)
Returns the root page which the current page is part of
|
static @NotNull List<Pattern> |
getStructurePatterns(@NotNull org.apache.sling.api.SlingHttpServletRequest request,
com.day.cq.wcm.api.designer.Style currentStyle)
Returns the page structure patterns to filter the descendants to be exported.
|
public static org.apache.sling.api.SlingHttpServletRequest createHierarchyServletRequest(@NotNull
@NotNull org.apache.sling.api.SlingHttpServletRequest request,
@NotNull
com.day.cq.wcm.api.Page page,
@Nullable
com.day.cq.wcm.api.Page entryPage)
request from the parameters. request - Request to be wrappedpage - Page to be referenced as statically containing the current page contententryPage - Page that is the entry point of the requestSlingHttpServletRequestWrapper containing the given page and requestpublic static com.day.cq.wcm.api.Page getEntryPoint(@NotNull
@NotNull org.apache.sling.api.SlingHttpServletRequest request)
request - Request to get the entry point attribute frompublic static void addEntryPointPage(org.apache.sling.api.SlingHttpServletRequest request,
com.day.cq.wcm.api.Page currentPage,
@NotNull
@NotNull List<com.day.cq.wcm.api.Page> descendedPages)
request - RequestcurrentPage - Current styledescendedPages - List of descendants@NotNull public static @NotNull List<Pattern> getStructurePatterns(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.designer.Style currentStyle)
request - RequestcurrentStyle - Current stylepublic static com.day.cq.wcm.api.Page getRootPage(org.apache.sling.api.resource.Resource resource,
com.day.cq.wcm.api.Page currentPage)
resource - ResourcecurrentPage - Current page@NotNull public static @NotNull List<com.day.cq.wcm.api.Page> getDescendants(com.day.cq.wcm.api.Page page, org.apache.sling.api.SlingHttpServletRequest slingRequest, List<Pattern> structurePatterns, int depth)
page - Page from which to extract descended pagesslingRequest - RequeststructurePatterns - Patterns to filter descended pagesdepth - Depth of the traversal@Nullable protected static @Nullable Page getDescendantModel(com.day.cq.wcm.api.Page childPage, org.apache.sling.api.SlingHttpServletRequest slingRequestWrapper, org.apache.sling.models.factory.ModelFactory modelFactory)
@NotNull public static @NotNull Map<String,Page> getDescendantsModels(org.apache.sling.api.SlingHttpServletRequest request, com.day.cq.wcm.api.Page currentPage, com.day.cq.wcm.api.designer.Style currentStyle, org.apache.sling.models.factory.ModelFactory modelFactory)
request - RequestcurrentPage - Current pagecurrentStyle - Current stylemodelFactory - Model factoryMap containing the page models with their corresponding paths (as keys)Copyright © 2019. All rights reserved.