public class FetchPageDesignCmdImpl extends AbstractFetchNounCmdImpl implements FetchPageDesignCmd
It uses Marketing Engine as the execution engine for evaluating the Winning Layout. Refer to evaluateWinningLayout(PageDesignType) for more details on the evaluation of a Winning Layout.
Refer to performExecute() for more details on the execution steps that this command follows.
Constructor and Description |
---|
FetchPageDesignCmdImpl()
This method is the default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.List<java.util.List<java.lang.String>> | evaluateWinningLayout(PageDesignType pageDesign)
Evaluates a Winning Layout for the Store Page based upon the Page Group, the Object Identifier and the Device Class specified in the given PageDesign Noun.
|
protected LayoutType | getDefaultLayout(java.lang.String pageGroup, java.lang.String deviceClass)
This method fetches the Default Layout for the given Page Group and Device Class.
|
static java.lang.String | getFallBackDeviceClass(java.lang.String deviceClass)
For a given deviceClass, this method returns the fall back device class defined in wc-component.xml under the extended configuration group DeviceClassDefaultLayoutFallback.
|
static java.lang.String | getFallBackPageGroup(java.lang.String pageGroup)
For a given pageGroup, this method returns the fall back page group defined in wc-component.xml under the extended configuration group PageGroupDefaultLayoutFallback.
|
protected java.lang.String | getFetchLayoutDetailsAccessProfile()
Returns the access profile name to be used for retrieving the layout details.
|
protected java.lang.String | getFetchMarketingSpotDataAccessProfile()
Returns the access profile name to be used for retrieving the marketing spot data..
|
java.util.List<PageDesignType> | getNouns()
This method returns the list of nouns retrieved by the fetch implementation.
|
void | performExecute()
This method performs the main execution logic of this command.
|
protected void | populateLayoutDetails(PageDesignType pageDesign)
This method populates the given PageDesign Noun with the Layout Details, primarily the Layout Name and the Widget Tree of the Layout.
|
void | reset()
This method resets the instance variables so the command can be reused.
|
protected java.util.List<java.util.List<java.lang.String>> | resolveLayout(PageDesignType pageDesign)
This method resolves the Layout for the given PageDesign Noun.
|
protected void | setFetchLayoutDetailsAccessProfile(java.lang.String fetchLayoutDetailsAccessProfile)
Sets the access profile used for fetching the details of the Winning Layout.
|
protected void | setFetchMarketingSpotDataAccessProfile(java.lang.String fetchMarketingSpotDataAccessProfile)
Sets the access profile used for fetching Marketing Spot Data using the Marketing Facade Client.
|
protected void | setMarketingFacadeClient(MarketingFacadeClient marketingFacadeClient)
Sets the Marketing Facade Client instance used by this command.
|
public FetchPageDesignCmdImpl()
It sets the following:
protected final void setMarketingFacadeClient(MarketingFacadeClient marketingFacadeClient)
protected final void setFetchMarketingSpotDataAccessProfile(java.lang.String fetchMarketingSpotDataAccessProfile)
protected final void setFetchLayoutDetailsAccessProfile(java.lang.String fetchLayoutDetailsAccessProfile)
protected final java.lang.String getFetchLayoutDetailsAccessProfile()
protected final java.lang.String getFetchMarketingSpotDataAccessProfile()
public void reset()
public java.util.List<PageDesignType> getNouns()
protected final java.util.List<java.util.List<java.lang.String>> evaluateWinningLayout(PageDesignType pageDesign) throws PageLayoutApplicationException
This method first invokes #constructESpotNamesQueryList(PageDesignType) to construct the list of ESpot Names. Using the list of ESpot Names it constructs an XPath request and passes the request to the Marketing Engine using the Marketing Facade Client to evaluate the ESpots. The Marketing Engine evaluates the ESpots in the sequence(as returned by #constructESpotNamesQueryList(PageDesignType))) they are passed and finally returns the Layout Id's that satisfy all the conditions like schedule, priority, etc. The Marketing Engine might return multiple Layout Id's in scenarios where there are multiple Layouts assigned for the same Page with same schedule, priority, etc. From the list of returned Layout Id's the first one is used as the Winning Layout Id.
The Winning Layout Id is set in the given PageDesign Noun. In a Preview Context, the Marketing Engine returns a Preview Report which contains all the Layouts(and their details) which were considered while evaluating the Winning Layout. This Preview Report is set in the given PageDesign Noun.
protected LayoutType getDefaultLayout(java.lang.String pageGroup, java.lang.String deviceClass) throws PageLayoutApplicationException
public static java.lang.String getFallBackPageGroup(java.lang.String pageGroup)
public static java.lang.String getFallBackDeviceClass(java.lang.String deviceClass)
protected java.util.List<java.util.List<java.lang.String>> resolveLayout(PageDesignType pageDesign) throws PageLayoutApplicationException
This method first invokes evaluateWinningLayout(PageDesignType) to evaluate a Winning Layout. If there is no Winning Layout, then it sets the default Layout.
The Layout Id of the resolved Layout is set in the given PageDesign Noun.
protected void populateLayoutDetails(PageDesignType pageDesign) throws PageLayoutApplicationException
It uses the Layout Id that was set in the PageDesign Noun by evaluateWinningLayout(PageDesignType) and fetches the Layout Details using the Read Mediator of the Layout Noun.
public void performExecute() throws java.lang.Exception
It performs the following: