Interface PageRootProvider


@ConsumerType public interface PageRootProvider
Service to fetch the site root page (i.e. home page) for a given resource.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.day.cq.wcm.api.Page
    getRootPage(org.apache.sling.api.resource.Resource resource)
    Returns the root page for the provided resource.
    getRootPagePath(String resourcePath)
    Returns the root path for the provided resource path.
  • Method Details

    • getRootPage

      com.day.cq.wcm.api.Page getRootPage(org.apache.sling.api.resource.Resource resource)
      Returns the root page for the provided resource. The root page is selected via the regex(es) provided in the PageRootProviderImpl's OSGi configuration.
      Parameters:
      resource - The Resource for which to return the root page
      Returns:
      Root page
    • getRootPagePath

      String getRootPagePath(String resourcePath)
      Returns the root path for the provided resource path. The root path is selected via the regex(es) provided in the PageRootProviderImpl's OSGi configuration.
      Parameters:
      resourcePath - The path for which to return the root path
      Returns:
      Root path