Class SitecatalystUtil

  • public class SitecatalystUtil
    extends java.lang.Object
    • Method Detail

      • getServer

        public static java.lang.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.
        request - the request
        config - the configuration
        server URL
      • getReportSuites

        public static java.lang.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.
        settingsService - SlingSettingsService
        configuration - the configuratin
        comma separated list of report suites for runmode of current server
      • getCookieDomainNamePeriod

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

        public static java.lang.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

        pageResource - page Resource
        configuration - SiteCatalyst configuration
        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.
        resolver - ResourceResolver
        resource - Resource
        Analytics resource or null if none could be found.
      • getPublishPreferredReportSuite

        public static java.lang.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
        config - the Analytics configuration
        the preferred report suite ID