public abstract class AbstractPageLayoutActivity
extends java.lang.Object
A Page Layout Activity cannot be instantiated directly. It is used only in conjunction with the corresponding Page Layout Activity Helper.
This base class provides methods for the following:
getCampaignElement(String)
.getSpots()
and setSpots(List)
.getDeviceClass()
and setDeviceClass(String)
.AbstractPageLayoutActivityHelper.tailorActivityTemplate(ActivityType, String, String)
, you can
add/overwrite the structure of an existing Activity Template during SAR publish. To access the new Campaign Elements (Targets, Actions, etc)
which you may have added, you can add appropriate getters & setters by extending this class. For example, let's say you added a new Activity
Template that has a new Action called "showPageLayout"
which stores the Page Layout Id. The setter & getter would have the
implementation like the following:
public void setLayoutId(String layoutId){ final String METHODNAME = "setLayoutId(String layoutId)"; LOGGER.entering(CLASSNAME, METHODNAME, layoutId); CampaignElementType showLayoutElement = getCampaignElement(PageLayoutActivityHelperConstants.CAMPAIGN_ELEMENT_TEMPLATE_NAME_ACTION_LAYOUT); if(showLayoutElement == null){ throw new PageLayoutSystemException(PageLayoutSystemMessageKeys._SYS_ACTIVITY_ELEMENT_NOT_EXIST, PageLayoutActivityHelperConstants.CAMPAIGN_ELEMENT_TEMPLATE_NAME_ACTION_LAYOUT, CLASSNAME, METHODNAME); } ListIn the above code snippet, the reference to Campaign Element forcampaignElementVariableList = showLayoutElement.getCampaignElementVariable(); for (CampaignElementVariableType campaignElementVariable : campaignElementVariableList) { if(PageLayoutActivityHelperConstants.CAMPAIGN_ELEMENT_VARIABLE_NAME_PAGE_LAYOUT_ID.equals(campaignElementVariable.getName())){ campaignElementVariable.setValue(layoutId); break; } } dirtyElement(showLayoutElement); LOGGER.exiting(CLASSNAME, METHODNAME); } public String getLayoutId(){ final String METHODNAME = "getLayoutId()"; LOGGER.entering(CLASSNAME, METHODNAME); CampaignElementType showLayoutElement = getCampaignElement(PageLayoutActivityHelperConstants.CAMPAIGN_ELEMENT_TEMPLATE_NAME_ACTION_LAYOUT); if(showLayoutElement == null){ throw new PageLayoutSystemException(PageLayoutSystemMessageKeys._SYS_ACTIVITY_ELEMENT_NOT_EXIST, PageLayoutActivityHelperConstants.CAMPAIGN_ELEMENT_TEMPLATE_NAME_ACTION_LAYOUT, CLASSNAME, METHODNAME); } String layoutId = null; List campaignElementVariableList = showLayoutElement.getCampaignElementVariable(); for (CampaignElementVariableType campaignElementVariable : campaignElementVariableList) { if(PageLayoutActivityHelperConstants.CAMPAIGN_ELEMENT_VARIABLE_NAME_PAGE_LAYOUT_ID.equals(campaignElementVariable.getName())){ layoutId = campaignElementVariable.getValue(); break; } } LOGGER.exiting(CLASSNAME, METHODNAME, layoutId); return layoutId; }
"showPageLayout"
is got using the method getCampaignElement(String)
.
In the setter, the Page layout Id is set in the Campaign Element and then final the Campaign Element is added to the set of dirty elements in the Activity
using dirtyElement(CampaignElementType)
. When the Activity is finally saved by invoking AbstractPageLayoutActivityHelper.savePageLayoutActivity(List)
,
only the dirty Campaign Elements are saved.
Similarly, if you set values in the Activity itself like start date, end date, priority, etc then your setter should make the Activity dirty by invoking
dirtyActivity()
. The Page Layout Activity Framework will save the Activity level details only if the Activity is dirty.
AbstractPageLayoutActivityHelper
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getActivityId()
Returns the Activity Id of this Page Layout Activity.
|
CampaignElementType |
getCurrentPageCampaignElement()
This method returns the Current Page Campaign Element template name of the
Page Layout Activity.
|
java.lang.String |
getDeviceClass()
Returns the Device Class of this Page Layout Activity.
|
java.lang.Object |
getEnddate()
Returns the End Date of this Page Layout Activity.
|
java.lang.String |
getName()
Returns the Name of this Page Layout Activity.
|
java.math.BigInteger |
getPriority()
Returns the Priority of this Page Layout Activity.
|
java.lang.Object |
getStartDate()
Returns the Start Date of this Page Layout Activity.
|
java.lang.String |
getStoreId()
Returns the Store Id of this Page Layout Activity.
|
void |
setCurrentPageCampaignElementTemplate(CampaignElementType newCurrentPageCampaignElement)
Sets the Current Page campaign element in this Page Layout Activity to the specified element.
|
void |
setDeviceClass(java.lang.String deviceClass)
Sets the Device Class in this Page Layout Activity.
|
void |
setEndDate(java.lang.Object date)
Sets the End Date of this Page Layout Activity.
|
void |
setName(java.lang.String name)
Sets the Name of this Page Layout Activity.
|
void |
setPriority(java.math.BigInteger priority)
Sets the Priority of this Page Layout Activity.
|
void |
setStartDate(java.lang.Object date)
Sets the Start Date of this Page Layout Activity.
|
void |
setStoreId(java.lang.String storeId)
Sets the Store Id of this Page Layout Activity.
|
public final java.lang.String getActivityId()
public void setName(java.lang.String name)
name
- The Page Layout Activity Name to set.public java.lang.String getName()
public void setStoreId(java.lang.String storeId)
storeId
- The Store Id to set.public java.lang.String getStoreId()
public void setStartDate(java.lang.Object date)
date
- The Start Date to set. The format should be an SDO representation of XML dateTime.public java.lang.Object getStartDate()
public void setEndDate(java.lang.Object date)
date
- The End Date to set. The format should be an SDO representation of XML dateTime.public java.lang.Object getEnddate()
public void setPriority(java.math.BigInteger priority)
priority
- The Priority of this Page Layout Activity.public java.math.BigInteger getPriority()
public CampaignElementType getCurrentPageCampaignElement()
The Map of Campaign Elements present in this Page Layout Activity is constructed in the constructor
AbstractPageLayoutActivity(ActivityType, AbstractPageLayoutActivityHelper)
.
public void setCurrentPageCampaignElementTemplate(CampaignElementType newCurrentPageCampaignElement)
newCurrentPageCampaignElement
- The New Campaign Element to set.public void setDeviceClass(java.lang.String deviceClass)
deviceClass
- The Device Class to set.public java.lang.String getDeviceClass()