Class SitecatalystUtil
java.lang.Object
com.day.cq.analytics.sitecatalyst.SitecatalystUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourcefindAnalyticsResource(ResourceResolver resolver, Resource resource) static IntegergetCookieDomainNamePeriod(SlingHttpServletRequest request, String server) Returns number of domain name periods.static StringgetFormattedPagePath(Resource pageResource, Configuration configuration) Formats the resource path of a ResourcepageResourcerelative to the providedConfigurationpath.static StringReturns 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 suitestatic StringgetReportSuites(SlingSettingsService settingsService, Configuration configuration) Returns a comma separated list of report suites depending on the current run mode of the server.static StringgetServer(SlingHttpServletRequest request, Configuration config) Returns server URL according to request scheme.
-
Method Details
-
getServer
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 requestconfig- 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- SlingSettingsServiceconfiguration- the configuratin- Returns:
- comma separated list of report suites for runmode of current server
-
getCookieDomainNamePeriod
Returns number of domain name periods.- Parameters:
request- the requestserver- the server url- Returns:
- number ofdomain name periods
-
getFormattedPagePath
Formats the resource path of a ResourcepageResourcerelative to the providedConfigurationpath. A trailing slash will be removed if present, all other slashes will be replaced by colons./content/geometrixx/en/supportwill be formatted tocontent:geometrixx:en:support- Parameters:
pageResource- page Resourceconfiguration- SiteCatalyst configuration- Returns:
- Formatted path
-
findAnalyticsResource
Ascends theResourceuntil aPagewith a valid analytics configuration is found. The configuration is considered valid if the node has a property cq:services.- Parameters:
resolver-ResourceResolverresource-Resource- Returns:
- Analytics resource or
nullif none could be found.
-
getPublishPreferredReportSuite
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
-