public class PageDesignEMarketingSpotListTaskCmdImpl extends TaskCommandImpl implements PageDesignEMarketingSpotListTaskCmd
Modifier and Type | Field and Description |
---|---|
static java.lang.String | CLASSNAME
The class name.
|
Constructor and Description |
---|
PageDesignEMarketingSpotListTaskCmdImpl() |
Modifier and Type | Method and Description |
---|---|
protected void | closestParentFirstAlogrithm(java.util.List<BreadcrumbLocationType> breadcrumbs)
This method populates the eSpot lists used to evaluate the winning layout based on Closest Parent First algorithm.
|
protected java.util.List<java.util.List<java.lang.String>> | constructESpotNamesQueryList(PageDesignType pageDesign)
This method constructs the list of ESpot Names for the request to the Marketing Engine to fetch a Winning Layout for the given PageDesign Noun using either Depth First algorithm or Closest Parent First algorithm.
|
protected void | depthFirstAlogrithm(java.util.List<BreadcrumbLocationType> breadcrumbs)
This method populates the eSpot lists used to evaluate the winning layout based on Depth First algorithm.
|
protected java.util.List<BreadcrumbLocationType> | getBreadcrumbLocations(java.lang.String pageGroup, java.lang.String objectIdentifier)
This method returns a static list of breadcrumb locations for the given Page Group and Object Identifier of the Store page.
|
protected java.lang.String | getEvalStrategy()
This method returns the evaluation strategy used to evaluate the winning layout using the default properties set for the command.
|
java.util.List<java.lang.String> | getPageDesignContributingESpotsFlatList()
Return list of eSpots associated with pageDesign object in a flat list.
|
java.util.List<java.util.List<java.lang.String>> | getPageDesignContributingESpotsHierarchy()
Return list of eSpots associated with pageDesign object in hierarchical manner.
|
void | performExecute()
Executes the task command if pageDesign object is set.
|
void | setPageDesign(PageDesignType pageDesignType)
Sets the pageDesign for which list of eSpots will be generated.
|
public PageDesignEMarketingSpotListTaskCmdImpl()
public void setPageDesign(PageDesignType pageDesignType)
public java.util.List<java.lang.String> getPageDesignContributingESpotsFlatList()
public java.util.List<java.util.List<java.lang.String>> getPageDesignContributingESpotsHierarchy()
public void performExecute() throws ECException
protected java.util.List<java.util.List<java.lang.String>> constructESpotNamesQueryList(PageDesignType pageDesign) throws PageLayoutApplicationException
This method constructs the list of ESpot Names based upon the Category hierarchy of the Category or Catalog Entry object that is displayed on the Store Page. The list is constructed such that the most specific ESpots appear first. The first ESpot Name in the list is always the ESpot Name corresponding to the object being displayed in the Store Page, e.g. "Category_10008" or "Content_10001".
If page group type is Search, PageLayoutServerConstants.PAGE_GROUP_SEARCH, then the first ESpot Name in the list will be "Search_searchTerm". If UseSynonyms flex flow feature is enabled for store, then list of synonyms are fetched for the given searchTerm and rest of ESpot Names will be constructed. e.g. "Search_synonym1", "Search_synonym2"
Only for Store Pages that display a Category or a Catalog Entry, multiple ESpot Names are returned. The rest of the ESpot Names in the list after the first ESpot Name are based upon all the possible breadcrumb locations of the Category or the Catalog Entry. To get the list of all possible breadcrumb locations, this method invokes getBreadcrumbLocations(String, String). Each breadcrumb in the list has a list of parent Category Id's in the order of child Category Id to root Category Id. It uses Depth First algorithm or Closest parent first algorithm to construct the ESpot names based on all possible breadcrumb locations.
Note: Multiple breadcrumbs are returned when the Category or the Catalog Entry has multiple parent Categories at multiple levels in its hierarchy. Example: If bread crumb locations returned in the format [subcategory2 -> subCategory1 -> rootCategory] for a given Category 99999 is as below:
Using Depth First Algorithm, the constructed eSpot names for evaluation will be:
protected final java.util.List<BreadcrumbLocationType> getBreadcrumbLocations(java.lang.String pageGroup, java.lang.String objectIdentifier) throws PageLayoutApplicationException
This method returns the breadcrumb locations only if the given Page Group is either a "Category" or a "CatalogEntry".
This method uses the Facade Client of the Catalog Component to fetch the respective breadcrumb locations.
protected java.lang.String getEvalStrategy()
protected void depthFirstAlogrithm(java.util.List<BreadcrumbLocationType> breadcrumbs)
This method applies a certain depth algorithm using which it constructs a Linked List of ESpot Names using the parent Category Id's for each level in the parent category hierarchy tree (if the list of breadcrumbs are to be visualized as a tree). Hence the length of the Linked List at each level depends upon the number of parent Categories at the same level. However, while traversing the parent Categories in the tree, if any Category already appeared before then the ESpot Name corresponding to the Category is not added to the Linked List. This is done for avoiding redundant processing of ESpots in the Marketing Engine. After processing at each level in the tree, the Linked List is added to the resultant list of ESpot Names. The list at depth1 contains the root category and the list at depthN contains the immediate parent categories. Hence the final list of ESpot Names are in the order of the most specific ones first. When this list of ESpot Names are passed to the Marketing Engine in the method #evaluateWinningLayout(PageDesignType), the Marketing Engine evaluates them in the same order they are passed in. This gives a chance for the most specific Layout Assignments as per the ascending order of its parent Category hierarchy to win first. The following example illustrates the same:
Consider the following list of breadcrumbs that are returned for a Category with id 10008 by the method getBreadcrumbLocations(String, String):
11703->11701->11201->10651 11704->11701->11201->10651 11706->11704->11701->11201->10651 11704->11702->11201->10651 11706->11704->11702->11201->10651 |
In the above list 10651 is the root category. After applying the depth algorithm and constructing the ESpot Names, following is the list of ESpot Names that are returned:
Category_10008 Category_11706 (depth1) Category_11703, Category_11704 (depth2) Category_11701, Category_11702 (depth3) Category_11201 (depth4) Category_10651 (depth5) |
Similarly, if the same list of breadcrumbs are returned for a Catalog Entry with id 12008, then the following list of ESpot Names are returned:
CatalogEntry_12008 Category_11706_CatalogEntry Category_11703_CatalogEntry, Category_11704_CatalogEntry Category_11701_CatalogEntry, Category_11702_CatalogEntry Category_11201_CatalogEntry Category_10651_CatalogEntry |
protected void closestParentFirstAlogrithm(java.util.List<BreadcrumbLocationType> breadcrumbs)
This method applies a closest to depth algorithm which it constructs a Linked List of ESpot Names using the parent Category Id's for each level in the parent category hierarchy tree (if the list of breadcrumbs are to be visualized as a tree). The algorithm returns a list of ESpot Names by depth (distance). Depth0 is the entity itself. Depth1 is all the immediate parent categories. Depth2 is all the categories 2 levels up. While traversing the parent categories in the tree, if any Category already appeared before then the ESpot Name corresponding to the Category is not added to the Linked List. This is done for avoiding redundant processing of ESpots in the Marketing Engine. When the list of ESpot Names are passed to the Marketing Engine in the method #evaluateWinningLayout(PageDesignType), the Marketing Engine evaluates them in the same order they are passed in. This gives a chance for the closest Layout Assignments as per the ascending order of its parent Category hierarchy to win first. The following example illustrates the same:
Consider the following list of breadcrumbs that are returned for a Category with id 10008 by the method getBreadcrumbLocations(String, String):
11703->11701->11201->10651 11704->11701->11201->10651 11706->11704->11701->11201->10651 11704->11702->11201->10651 11706->11704->11702->11201->10651 |
In the above list 10651 is the root category. After applying the closest parent first algorithm and constructing the ESpot Names, following is the list of ESpot Names that are returned:
Category_10008 Category_11706,Category_11704, Category_11703 (depth1) Category_11701,Category_11702 (depth2) Category_11201 (depth3) Category_10651 (depth4) (depth5) |
Similarly, if the same list of breadcrumbs are returned for a Catalog Entry with id 12008, then the following list of ESpot Names are returned:
CatalogEntry_12008 Category_11706_CatalogEntry,Category_11704_CatalogEntry,Category_11703_CatalogEntry (depth1) Category_11701_CatalogEntry,Category_11702_CatalogEntry (depth2) Category_11201_CatalogEntry (depth3) Category_10651_CatalogEntry (depth4) (depth5) |