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 Object
Model for detecting site root pages.
  • Constructor Details

    • SiteRoot

      public SiteRoot()
  • Method Details

    • getRootPath

      @Nullable public @Nullable String getRootPath(@Nullable @Nullable 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

      @Nullable public @Nullable String getRootPath(@Nullable @Nullable 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

      @Nullable public @Nullable 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

      @Nullable public @Nullable com.day.cq.wcm.api.Page getRootPage()
      Gets site root page of the current site.
      Returns:
      Site root page for the current site.
    • getRelativePage

      @Nullable public @Nullable com.day.cq.wcm.api.Page getRelativePage(@NotNull @NotNull 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(@NotNull @NotNull com.day.cq.wcm.api.Page page)
      Parameters:
      page - Page
      Returns:
      true if given page is the site root page