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:
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); } List campaignElementVariableList = 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; }In the above code snippet, the reference to Campaign Element for "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.
Modifier | Constructor and Description |
---|---|
protected | AbstractPageLayoutActivity(AbstractPageLayoutActivity activity)
This is a copy constructor that does a shallow copy of the fields.
|
protected | AbstractPageLayoutActivity(ActivityType activity, AbstractPageLayoutActivityHelper helper)
This Constructor sets the backing Marketing Activity & the reference of the Page Layout Activity Helper instance that instantiated this Page Layout Activity.
|
Modifier and Type | Method and Description |
---|---|
protected void | dirtyActivity()
Sets this Page Layout Activity as dirty.
|
protected void | dirtyElement(CampaignElementType campaignElement)
This method adds a given Campaign Element to the set of Campaign Elements that are dirty in this Page Layout Activity.
|
java.lang.String | getActivityId()
Returns the Activity Id of this Page Layout Activity.
|
protected ActivityType | getBackingActivity()
Returns the backing Marketing Activity object of this Page Layout Activity.
|
protected CampaignElementType | getCampaignElement(java.lang.String elementName)
This method returns the reference of the Campaign Element specified by the given Campaign Element Name which is present in 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.
|
protected java.util.List<AbstractPageLayoutActivityESpot> | getSpots()
Returns the list of ESpots set in 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.
|
protected void | setSpots(java.util.List<AbstractPageLayoutActivityESpot> espotList)
Sets a list of given ESpots to 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.
|
protected AbstractPageLayoutActivity(ActivityType activity, AbstractPageLayoutActivityHelper helper)
This method also constructs the Campaign Element Map that is later used by getCampaignElement(String).
protected AbstractPageLayoutActivity(AbstractPageLayoutActivity activity)
protected final CampaignElementType getCampaignElement(java.lang.String elementName)
The Map of Campaign Elements present in this Page Layout Activity is constructed in the constructor AbstractPageLayoutActivity(ActivityType, AbstractPageLayoutActivityHelper). The Campaign Element Name is used as the key of this map.
protected final void dirtyElement(CampaignElementType campaignElement)
protected final void dirtyActivity()
protected final ActivityType getBackingActivity()
public final java.lang.String getActivityId()
public void setName(java.lang.String name)
public java.lang.String getName()
public void setStoreId(java.lang.String storeId)
public java.lang.String getStoreId()
public void setStartDate(java.lang.Object date)
public java.lang.Object getStartDate()
public void setEndDate(java.lang.Object date)
public java.lang.Object getEnddate()
public void setPriority(java.math.BigInteger priority)
public java.math.BigInteger getPriority()
protected void setSpots(java.util.List<AbstractPageLayoutActivityESpot> espotList)
protected java.util.List<AbstractPageLayoutActivityESpot> getSpots()
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)
public void setDeviceClass(java.lang.String deviceClass)
public java.lang.String getDeviceClass()