public class OfferHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PN_LOCATION
Mbox location property name
|
static java.lang.String |
PN_TESTANDTARGETCONFIG
Account-Reference property name
|
static java.lang.String |
PN_THIRDPARTYID
Third-Party property name
|
static java.lang.String |
RT_CAMPAIGN
Campaign resource type
|
static java.lang.String |
RT_EXPERIENCE
Experience resource type
|
static java.lang.String |
RT_OFFER_PROXY
Offer proxy resource type
|
static java.lang.String |
RT_TEASER
Offer resource type
|
| Constructor and Description |
|---|
OfferHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Page |
getCampaign(Page page)
Returns a page with resource type
'cq/personalization/components/campaignpage' or
null. |
static java.lang.String |
getCampaignName(java.lang.String path)
Returns a campaign name based on a repository path, following the same rules as
getOfferName(String) |
static long |
getOfferId(Page offerPage)
Returns the offer id from Target
|
static long |
getOfferId(Page offerPage,
WCMMode wcmMode)
Returns the id of the offer set by Target.
|
static java.lang.String |
getOfferLocation(Page offerPage,
WCMMode wcmMode)
Returns the offer location as it should be sent to Adobe Target
|
static java.lang.String |
getOfferLocation(Page offerPage,
WCMMode wcmMode,
java.lang.String ambitName)
Returns the offer location as it should be sent to Adobe Target
|
static java.lang.String |
getOfferName(Page offerPage,
WCMMode wcmMode)
Returns the offer name based on this offer's location.
|
static java.lang.String |
getOfferName(Page offerPage,
WCMMode wcmMode,
java.lang.String ambitName)
Returns the offer name based on this offer's location.
|
static java.lang.String |
getOfferName(java.lang.String path)
Returns an Offer name constructed by concatenating the path and replacing
slashes (/) with dashes (-).
|
static java.lang.String |
getThirdPartyCampaignId(Node contentResourceNode)
Returns the third party id for a campaign page's resource node
|
static java.lang.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(java.lang.String path,
Page page)
Saves the configuration reference to the campaign page
|
static void |
setThirdPartyID(Node node,
java.lang.String operation,
java.lang.String thirdpartyid)
Saves or deletes the third party ID property in the provided
Node
according to the executed operation. |
public static final java.lang.String PN_THIRDPARTYID
public static final java.lang.String RT_CAMPAIGN
public static final java.lang.String RT_EXPERIENCE
public static final java.lang.String RT_TEASER
public static final java.lang.String RT_OFFER_PROXY
public static final java.lang.String PN_TESTANDTARGETCONFIG
public static final java.lang.String PN_LOCATION
public static java.lang.String getOfferName(java.lang.String path)
path - pathpublic static java.lang.String getOfferName(Page offerPage, WCMMode wcmMode)
getOfferName(String)offerPage - the offer pagewcmMode - the WCM mode. This is required to determine the offer locationpublic static java.lang.String getOfferName(Page offerPage, WCMMode wcmMode, java.lang.String ambitName)
getOfferName(String)offerPage - the offer pagewcmMode - the WCM mode. This is required to determine the offer locationambitName - the name of the ambit that this offer is part of.WCMMode.DISABLED then it's ommited. If the ambit name is PersonalizationConstants.AMBIT_DEFAULT_NAME then it's omitted.public static java.lang.String getCampaignName(java.lang.String path)
getOfferName(String)path - pathpublic static void setThirdPartyID(Node node, java.lang.String operation, java.lang.String thirdpartyid) throws RepositoryException
Node
according to the executed operation.node - Nodeoperation - operationthirdpartyid - thirdpartyidRepositoryException - RepositoryExceptionpublic static java.lang.String getThirdPartyID(Node node) throws RepositoryException
node - Offer nodeRepositoryException - RepositoryExceptionpublic static java.lang.String getThirdPartyCampaignId(Node contentResourceNode) throws RepositoryException
contentResourceNode - Node of pages contentresourcenodeRepositoryException - RepositoryExceptionpublic static void setConfigurationPath(java.lang.String path,
Page page)
throws RepositoryException
path - Configuration pathpage - Current offer pageRepositoryException - in case an error occurs when node property is setpublic static Page getCampaign(Page page)
null. The method
walks ascending up the hierarchy until a page with the corresponding resource
type is found.page - Page with resource type
'cq/personalization/components/campaignpage' or initially provided
page.nullpublic static java.lang.String getOfferLocation(Page offerPage, WCMMode wcmMode)
offerPage - The offer page from CQwcmMode - The mode for which the location is calculated . Used to create different locations for author and
publish environmentspublic static java.lang.String getOfferLocation(Page offerPage, WCMMode wcmMode, java.lang.String ambitName)
offerPage - The offer page from CQwcmMode - The mode for which the location is calculated . Used to create different locations for author and
publish environmentsambitName - the name of the MSM ambit that this offer is part ofpublic static long getOfferId(Page offerPage)
offerPage - the offer page from CQpublic static long getOfferId(Page offerPage, WCMMode wcmMode)
offerPage - the offer page from AEMwcmMode - the WCMMode. If the WCMMode is WCMMode.EDIT then the id value is read from the cq:authorExternalId property, otherwise the value of the cq:publishExternalId property is returnedCopyright © 2010 - 2023 Adobe. All Rights Reserved