Interface SiteRootDetector


@ProviderType public interface SiteRootDetector
Detects the site root based on Context-Aware configuration context paths.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getSiteRootLevel(@Nullable org.apache.sling.api.resource.Resource contextResource)
    Returns the absolute path level where the root page of the site is located.
  • Method Details

    • getSiteRootLevel

      int getSiteRootLevel(@Nullable @Nullable org.apache.sling.api.resource.Resource contextResource)
      Returns the absolute path level where the root page of the site is located. This is the context path of the "inner-most" context-aware configuration context.
      Parameters:
      contextResource - Context resource that is assumed to be inside the site context.
      Returns:
      Root level or -1 if it could not be detected