com.day.cq.analytics.testandtarget.util
Class OfferHelper

java.lang.Object
  extended by com.day.cq.analytics.testandtarget.util.OfferHelper

public class OfferHelper
extends Object


Field Summary
static String PN_LOCATION
          Mbox location property name
static String PN_TESTANDTARGETCONFIG
          Account-Reference property name
static String PN_THIRDPARTYID
          Third-Party property name
static String RT_CAMPAIGN
          Campaign resource type
static String RT_EXPERIENCE
          Experience resource type
static String RT_TEASER
          Offer resource type
 
Constructor Summary
OfferHelper()
           
 
Method Summary
static Page getCampaign(Page page)
          Returns a page with resource type 'cq/personalization/components/campaignpage'.
static String getCampaignName(String path)
          Returns a campaign name based on a repository path, following the same rules as getOfferName(String)
static String getOfferLocation(Page offerPage, WCMMode wcmMode)
          Returns the offer location as it should be sent to Test&Target
static String getOfferName(String path)
          Returns an Offer name constructed by concatenating the path and replacing slashes (/) with dashes (-).
static String getThirdPartyCampaignId(Node contentResourceNode)
          Returns the third party id for a campaign page's resource node
static String getThirdPartyID(Node node)
          Returns the third party ID of a Node if property exists, otherwise one is generated in Timestamp format.
static void setConfigurationPath(String path, Page page)
          Saves the configuration reference to the campaign page
static void setThirdPartyID(Node node, String operation, String thirdpartyid)
          Saves or deletes the third party ID property in the provided Node according to the executed operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PN_THIRDPARTYID

public static final String PN_THIRDPARTYID
Third-Party property name

See Also:
Constant Field Values

RT_CAMPAIGN

public static final String RT_CAMPAIGN
Campaign resource type

See Also:
Constant Field Values

RT_EXPERIENCE

public static final String RT_EXPERIENCE
Experience resource type

See Also:
Constant Field Values

RT_TEASER

public static final String RT_TEASER
Offer resource type

See Also:
Constant Field Values

PN_TESTANDTARGETCONFIG

public static final String PN_TESTANDTARGETCONFIG
Account-Reference property name

See Also:
Constant Field Values

PN_LOCATION

public static final String PN_LOCATION
Mbox location property name

See Also:
Constant Field Values
Constructor Detail

OfferHelper

public OfferHelper()
Method Detail

getOfferName

public static String getOfferName(String path)
Returns an Offer name constructed by concatenating the path and replacing slashes (/) with dashes (-).

Parameters:
currentPage -
Returns:

getCampaignName

public static String getCampaignName(String path)
Returns a campaign name based on a repository path, following the same rules as getOfferName(String)

Parameters:
path -
Returns:
the campaign name

setThirdPartyID

public static void setThirdPartyID(Node node,
                                   String operation,
                                   String thirdpartyid)
                            throws RepositoryException
Saves or deletes the third party ID property in the provided Node according to the executed operation.

Parameters:
node -
operation -
thirdpartyid -
Throws:
RepositoryException

getThirdPartyID

public static String getThirdPartyID(Node node)
                              throws RepositoryException
Returns the third party ID of a Node if property exists, otherwise one is generated in Timestamp format.

Parameters:
node - Offer node
Returns:
Third-Party ID
Throws:
RepositoryException

getThirdPartyCampaignId

public static String getThirdPartyCampaignId(Node contentResourceNode)
                                      throws RepositoryException
Returns the third party id for a campaign page's resource node

Parameters:
contentResourceNode -
Returns:
the third party id
Throws:
RepositoryException

setConfigurationPath

public static void setConfigurationPath(String path,
                                        Page page)
                                 throws AnalyticsException,
                                        RepositoryException
Saves the configuration reference to the campaign page

Parameters:
path - Configuration path
page - Current offer page
Throws:
RepositoryException - in case an error occurs when node property is set
AnalyticsException - is never thrown

getCampaign

public static Page getCampaign(Page page)
Returns a page with resource type 'cq/personalization/components/campaignpage'. The method walks ascending up the hierachie until a page with the corresponding resource type is found.

Parameters:
page - Page with resource type 'cq/personalization/components/campaignpage' or initially provided page.
Returns:

getOfferLocation

public static String getOfferLocation(Page offerPage,
                                      WCMMode wcmMode)
Returns the offer location as it should be sent to Test&Target

Parameters:
offerPage - The offer page from CQ
wcmMode - The mode for which the location is calculated . Used to create different locations for author and publish environments
Returns:
the offer location or if no location property is found in the offerPage


Copyright © 2011-2013 Adobe Systems Incorporated. All Rights Reserved.