public abstract class AbstractPageLayoutActivityHelper
extends java.lang.Object
This class provides the support for the following:
Modifier and Type | Class and Description |
---|---|
protected static class | AbstractPageLayoutActivityHelper.PagingIterator<K>
This iterator iterates over a list in a page-wise manner.
|
Constructor and Description |
---|
AbstractPageLayoutActivityHelper()
Constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
void | deActivateActivity(java.util.List<java.lang.String> activityIdList)
De-activates Activities for the given list of Activity Id's.
|
void | deleteActivity(java.util.List<java.lang.String> activityIdList)
Deletes Activities for the given list of Activity Id's.
|
protected java.util.List<MarketingSpotType> | fetchESpot(java.lang.String espotName)
This method fetches the layout e-marketing spot by name.
|
java.util.Map<ESpotIdentifier,java.lang.String> | fetchESpotIds(java.util.Set<ESpotIdentifier> espotIdentifiers)
This method fetches ESpot Ids for the set of ESpot identifier that are passed to this method.
|
java.util.List<java.lang.String> | fetchESpotIds(java.lang.String espotName)
This method fetches ESpot Ids for given ESpot name.
|
protected java.lang.String | getActivityTemplateName(java.lang.String activityGroup, java.lang.String storeId)
This method finds the Activity Template Name for a given Activity Group from the Component Configuration file wc-component.xml of the Page Layout Component.
|
protected java.util.List<AbstractPageLayoutActivity> | getPageLayoutActivity(AbstractPageLayoutActivityESpot espot, java.lang.String storeId, GetType getVerb, ShowType showVerb)
This method fetches all the Page Layout Activities for a given ESpot.
|
protected java.util.Map<java.lang.String,AbstractPageLayoutActivity> | getPageLayoutActivity(java.util.List<java.lang.String> activityIdList)
This method returns Page Layout Activities for a given list of Activity Ids.
|
protected AbstractPageLayoutActivity | getPageLayoutActivityTemplate(java.lang.String activityGroup, java.lang.String storeId)
This method returns the Page Layout Activity Template for the given Activity Group Name and the Store Id.
|
protected abstract AbstractPageLayoutActivity | instantiatePageLayoutActivity(ActivityType backingActivity)
This method instantiates a Page Layout Activity using a backing Marketing Activity object.
|
protected abstract AbstractPageLayoutActivityESpot | instantiatePageLayoutActivityESpot(java.lang.String properties)
This method instantiates a new Page Layout Activity ESpot passing a string of properties.
|
java.util.Map<ESpotIdentifier,java.lang.String> | saveESpots(java.util.Set<ESpotIdentifier> espotIdentifiers)
Saves ESpots for the given set of ESpot Identifiers.
|
protected void | savePageLayoutActivity(java.util.List<AbstractPageLayoutActivity> pageLayoutActivityList)
This method saves a given list of Page Layout Activities to the database.
|
void | setFetchActivityByCampaignElementAccessProfile(java.lang.String accessProfile)
Sets the access profile for fetching Activity by a Campaign Element.
|
void | setFetchActivityByIdAccessProfile(java.lang.String accessProfile)
Sets the access profile for fetching Activities by Activity Id's.
|
void | setFetchActivityElementsByIdAccessProfile(java.lang.String accessProfile)
Sets the access profile for fetching the Campaign Elements of an Activity by Activity Id.
|
void | setFetchActivityTemplateByNameAccessProfile(java.lang.String accessProfile)
Sets the access profile for fetching Activity Template by Name.
|
void | setFetchESpotAccessProfile(java.lang.String accessProfile)
Sets the access profile for fetching an ESpot.
|
protected void | setMarketingFacadeClient(MarketingFacadeClient marketingFacadeClient)
Sets the Marketing Facade Client instance used by this class.
|
protected void | tailorActivityTemplate(ActivityType activityTemplate, java.lang.String activityGroup, java.lang.String storeId)
This method tailors a given Activity Template.
|
public AbstractPageLayoutActivityHelper()
It initializes the following:
public final void setFetchActivityTemplateByNameAccessProfile(java.lang.String accessProfile)
public final void setFetchActivityByIdAccessProfile(java.lang.String accessProfile)
public final void setFetchActivityByCampaignElementAccessProfile(java.lang.String accessProfile)
public final void setFetchActivityElementsByIdAccessProfile(java.lang.String accessProfile)
public final void setFetchESpotAccessProfile(java.lang.String accessProfile)
protected final void setMarketingFacadeClient(MarketingFacadeClient marketingFacadeClient)
public java.util.Map<ESpotIdentifier,java.lang.String> fetchESpotIds(java.util.Set<ESpotIdentifier> espotIdentifiers) throws MarketingSpotException
public java.util.List<java.lang.String> fetchESpotIds(java.lang.String espotName) throws MarketingSpotException
public final void deActivateActivity(java.util.List<java.lang.String> activityIdList) throws PageLayoutApplicationException
public final void deleteActivity(java.util.List<java.lang.String> activityIdList) throws PageLayoutApplicationException
protected java.util.List<MarketingSpotType> fetchESpot(java.lang.String espotName) throws MarketingSpotException
protected java.lang.String getActivityTemplateName(java.lang.String activityGroup, java.lang.String storeId) throws PageLayoutApplicationException
The Activity Template names corresponding to each Activity Groups are specified in the extended configuration group named "ActivityGroupToActivityTemplateMapping" in the wc-component.xml file. The default Activity Templates are created for all the default Activity Groups and they are available for each Store.
protected final AbstractPageLayoutActivity getPageLayoutActivityTemplate(java.lang.String activityGroup, java.lang.String storeId) throws PageLayoutApplicationException
This method performs the following sequence of steps to return an activity template instance:
protected void tailorActivityTemplate(ActivityType activityTemplate, java.lang.String activityGroup, java.lang.String storeId)
You can override the structure of an Activity Template according to your custom requirement during SAR publish for your Store, using an XML file similar to <Store Directory>\WEB-INF\stores\StoreAssetsDir\data\pagelayout\activityTemplates\Category_PageLocation_Template.sample. However if there are any specific requirements for which you need to modify the structure of the Activity Template using custom Java code, then you can do so by extending this method.
protected abstract AbstractPageLayoutActivity instantiatePageLayoutActivity(ActivityType backingActivity)
This method is used internally by the framework. Implement this method in your extended class such that it returns the Page Layout Activity instance specific to your requirement. The Page Layout Activity instance that your return should be a descendant of AbstractPageLayoutActivity.
protected final java.util.Map<java.lang.String,AbstractPageLayoutActivity> getPageLayoutActivity(java.util.List<java.lang.String> activityIdList) throws PageLayoutApplicationException
This method delegates the fetch operation to the Marketing Component through web services. Once the Marketing Activities are returned, this method instantiates a new Page Layout Activity by invoking instantiatePageLayoutActivity(ActivityType) passing the Marketing Activity for each of the Marketing Activities. It creates a Map of these Page Layout Activities, using the Activity Id as the key.
protected final java.util.List<AbstractPageLayoutActivity> getPageLayoutActivity(AbstractPageLayoutActivityESpot espot, java.lang.String storeId, GetType getVerb, ShowType showVerb) throws PageLayoutApplicationException
This method delegates the fetch operation to the Marketing Component through web services. Using the Marketing Activity Ids that it receives for the given ESpot, this method invokes getPageLayoutActivity(List) to get a Map of Page Layout Activities. Finally this method returns the Values of the Page Layout Activities Map as the result.
public final java.util.Map<ESpotIdentifier,java.lang.String> saveESpots(java.util.Set<ESpotIdentifier> espotIdentifiers) throws PageLayoutApplicationException
This method creates ESpots for non-existing ESpots. It returns the ESpot Ids for all the ESpots specified in the given set of ESpot Identifiers.
Note: ESpots set in Page Layout Activities are automatically saved and hence this method is not required to be invoked explicitly. You can use this method in scenarios where you are not using Page Layout Activities but want to directly save ESpots or retrieve the ESpot Ids.
protected abstract AbstractPageLayoutActivityESpot instantiatePageLayoutActivityESpot(java.lang.String properties)
This method is used internally by the framework. The instances of the returned Page Layout Activity ESpot must be descendants of AbstractPageLayoutActivityESpot.
protected final void savePageLayoutActivity(java.util.List<AbstractPageLayoutActivity> pageLayoutActivityList) throws PageLayoutApplicationException
This method sets the ESpot Ids of the ESpots present in the Page Layout Activities before persisting them. Based upon the presence of the Activity Id in the Page Layout Activities, this method either creates or updates the given Page Layout Activities. This method de-activates the existing Activities before updating them, and finally activates them once they are created or updated.
While updating the existing Activities, this method updates only the Activity Elements that are dirty. Activity Elements are set as dirty using AbstractPageLayoutActivity.dirtyElement(CampaignElementType). Similarly, the Activity itself is updated only when the Activity is dirty. An Activity is set as dirty using AbstractPageLayoutActivity.dirtyActivity(). An Activity is set as dirty only when Activity level information like start date, end date, priority, etc are updated.