Package io.wcm.handler.url.ui
Class SiteRoot
- java.lang.Object
-
- io.wcm.handler.url.ui.SiteRoot
-
@ProviderType @Model(adaptables={org.apache.sling.api.SlingHttpServletRequest.class,org.apache.sling.api.resource.Resource.class}) public final class SiteRoot extends ObjectModel for detecting site root pages.
-
-
Constructor Summary
Constructors Constructor Description SiteRoot()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.day.cq.wcm.api.PagegetRelativePage(String relativePath)Get page relative to site root.com.day.cq.wcm.api.PagegetRootPage()Gets site root page of the current site.StringgetRootPath()Gets site root level path of the current site.StringgetRootPath(com.day.cq.wcm.api.Page page)Gets site root level path of a site.StringgetRootPath(org.apache.sling.api.resource.Resource resource)Gets site root level path of a site.booleanisRootPage(com.day.cq.wcm.api.Page page)
-
-
-
Method Detail
-
getRootPath
public String getRootPath(com.day.cq.wcm.api.Page page)
Gets site root level path of a site.- Parameters:
page- CQ Page of site- Returns:
- Site root path for the site. The path is not checked for validness.
-
getRootPath
public String getRootPath(org.apache.sling.api.resource.Resource resource)
Gets site root level path of a site.- Parameters:
resource- Resource within the site- Returns:
- Site root path for the site. The path is not checked for validness.
-
getRootPath
public String getRootPath()
Gets site root level path of the current site.- Returns:
- Site root path for the current site. The path is not checked for validness.
-
getRootPage
public com.day.cq.wcm.api.Page getRootPage()
Gets site root page of the current site.- Returns:
- Site root page for the current site.
-
getRelativePage
public com.day.cq.wcm.api.Page getRelativePage(String relativePath)
Get page relative to site root.- Parameters:
relativePath- Path relative to site root- Returns:
- Page instance or null if not found
-
isRootPage
public boolean isRootPage(com.day.cq.wcm.api.Page page)
- Parameters:
page- Page- Returns:
- true if given page is the site root page
-
-