Class SitecatalystUtil

java.lang.Object
com.day.cq.analytics.sitecatalyst.SitecatalystUtil

public class SitecatalystUtil extends Object
  • Method Details

    • getServer

      public static String getServer(SlingHttpServletRequest request, Configuration config)
      Returns server URL according to request scheme. If the scheme is HTTP the tracking server is returned otherwise the secure tracking server is returned.
      Parameters:
      request - the request
      config - the configuration
      Returns:
      server URL
    • getReportSuites

      public static String getReportSuites(SlingSettingsService settingsService, Configuration configuration)
      Returns a comma separated list of report suites depending on the current run mode of the server. If no report suite matches the current run mode an empty string is returned.
      Parameters:
      settingsService - SlingSettingsService
      configuration - the configuratin
      Returns:
      comma separated list of report suites for runmode of current server
    • getCookieDomainNamePeriod

      public static Integer getCookieDomainNamePeriod(SlingHttpServletRequest request, String server)
      Returns number of domain name periods.
      Parameters:
      request - the request
      server - the server url
      Returns:
      number ofdomain name periods
    • getFormattedPagePath

      public static String getFormattedPagePath(Resource pageResource, Configuration configuration)
      Formats the resource path of a Resource pageResource relative to the provided Configuration path. A trailing slash will be removed if present, all other slashes will be replaced by colons.

      /content/geometrixx/en/support will be formatted to content:geometrixx:en:support

      Parameters:
      pageResource - page Resource
      configuration - SiteCatalyst configuration
      Returns:
      Formatted path
    • findAnalyticsResource

      public static Resource findAnalyticsResource(ResourceResolver resolver, Resource resource)
      Ascends the Resource until a Page with a valid analytics configuration is found. The configuration is considered valid if the node has a property cq:services.
      Parameters:
      resolver - ResourceResolver
      resource - Resource
      Returns:
      Analytics resource or null if none could be found.
    • getPublishPreferredReportSuite

      public static String getPublishPreferredReportSuite(Configuration config)
      Returns one of the configured report suites based on the following rules: return first publish report suite, if not, return first report suite for all run modes and if still nothing available return first author report suite
      Parameters:
      config - the Analytics configuration
      Returns:
      the preferred report suite ID