public class ShowPromotion extends Promotion implements IShowPromotion
Modifier and Type | Field and Description |
---|---|
static int | ACTIVE_STATUS
A string constant that represents the active status of a promotion.
|
static java.lang.String | CLASSNAME
Class name field.
|
static java.lang.String | COPYRIGHT
IBM Copyright notice field.
|
static java.lang.String | PARAMETER_CUSTOMER_ID
A string constant that holds the parameter customerId.
|
static java.lang.String | PARAMETER_ORDER_ID
A string constant that holds the parameter order Id.
|
static java.lang.String | PROMTION_RELATION
A string constant that represents the promotion relationship.
|
Constructor and Description |
---|
ShowPromotion() |
Modifier and Type | Method and Description |
---|---|
protected void | buildDataArea()
This method builds the Data Area subsection of the reply BOD.
|
protected org.w3c.dom.Element | createCatalogItemsElement(PromotionSearchResultBean abnPromotionSearchResult, org.w3c.dom.Element aParentElement)
This method builds the CatalogItems element from the specified CatalogEntryDataBean.
|
org.w3c.dom.Element | createPromotionElement(PromotionSearchResultBean abnPromotionSearchResult, org.w3c.dom.Element aParentElement)
This method builds the Promotion element from the specified RLPromotion bean.
|
protected org.w3c.dom.Element | createUserdataInCatalogItemsElement(CatalogEntryDataBean catalogEntryDataBean, PromotionSearchResultBean abnPromotionSearchResult, org.w3c.dom.Element catalogItemsElement)
This is an empty method to create the UserData element for CatalogItems.
|
java.util.ArrayList | executeGetPromotion(SearchCriteria aSearchCriteria)
This method gets the list of promotions that meets the specified search criteria.
|
protected PromotionKey[] | getAllActivePromotion()
This method gets all the promotions which are in the active state.
|
protected java.lang.String | getCalculationCodeForPromotion(java.lang.String promotionId)
This method gets the calculation code for the Promotion Id.
|
protected java.lang.String | getCategoryNameForCatEntry(java.lang.String astrCatEntId)
This method gets the category name for a specified category entry ID.
|
protected java.lang.String | getIdFromPromotionKey(PromotionKey promotionKey)
This method gets the promotion Id for the promotion key.
|
protected void | getMACatEntIds(java.lang.String astrCatEntryId, java.util.Vector nCatEntIdsFromShoppingCart)
This method gets all the catalog entry IDs related to a specified category entry ID through a merchandising association.
|
protected java.lang.Long[] | getMemberGroupIds(java.lang.String customerId)
This method gets the member group Ids related to this customer.
|
protected java.util.Vector | getOrderItemIdsFromOrder(java.lang.String orderId)
This method gets the item IDs and their merchandising association's item IDs in the current order.
|
protected java.util.Vector | getPromotedOrderItemsForCategoryTypePromotion(java.util.Vector promItemIds, java.util.Vector orderItemIds)
This method gets the item IDs in the current order that are qualified to the given category type promotion.
|
protected java.util.Vector | getPromotedOrderItemsForItemTypePromotion(java.util.Vector promItemIds, java.util.Vector orderItemIds)
This method gets the item IDs in the current order that are qualified to the specified item type Promotion.
|
protected java.util.Vector | getPromotedOrderItemsForProductTypePromotion(java.util.Vector promItemIds, java.util.Vector orderItemIds)
This method gets the item IDs in the current order that are qualified to the specified product type promotion.
|
protected java.util.Vector | getPromotionsFromRelatedStores()
This method gets the promotions from the related stores.
|
protected RLPromotionBean | getRLPromotionBean(java.lang.String calCodeId)
This method creates and populates an instance of RLPromotionBean for the calculation code Id.
|
protected java.lang.String | getRootElementName()
This method gets the root element name of the response document.
|
void | init(CommandContext aCmdCtxt, TypedProperty aRequestProperties, TypedProperty aResponseProperties, org.w3c.dom.Document aRequestBOD, org.w3c.dom.Document aResponseBOD)
This method initializes the necessary parameters before starting to build the response Business Object Document.
|
protected java.util.ArrayList | populateSearchResult(java.lang.String astrPromotionId, java.lang.String orderId, java.lang.Long[] mbrGrpIds, java.util.ArrayList promotionList)
This method populates the search result for the specified promotion ID.
|
protected java.util.ArrayList | populateSearchResultWithCategoryTypePromotion(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.util.Vector catEntIdsFromShoppingCart)
This method populates the search result for the given category type promotion.
|
protected java.util.ArrayList | populateSearchResultWithCMCRLPromotions(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.util.Vector catEntIdsFromShoppingCart)
This method populates promotions from CMCRLPromotion.
|
protected java.util.ArrayList | populateSearchResultWithItemTypePromotion(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.util.Vector catEntIdsFromShoppingCart)
This method populates the search result for the given Item type promotion.
|
protected java.util.ArrayList | populateSearchResultWithOrderPromotion(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.lang.Long[] mbrGrpIds)
This method populates the search result for the order/shipping level promotion.
|
protected java.util.ArrayList | populateSearchResultWithOtherGroupPromotions(java.lang.String astrPromotionId, java.lang.String orderId, java.lang.Long[] mbrGrpIds, RLPromotionBean rlPromBean, java.util.ArrayList promotionList)
This method can be extended for customization to handle unsupported promotion groups separately.
|
protected java.util.ArrayList | populateSearchResultWithOtherPromotions(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.util.Vector catEntIdsFromShoppingCart)
This method can be extended for customization to handle unsupported promotion separately.
|
protected java.util.ArrayList | populateSearchResultWithProductPromotion(java.lang.String astrPromotionId, java.lang.String orderId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean)
This method populates the search result for the specified product level promotion.
|
protected java.util.ArrayList | populateSearchResultWithProductTypePromotion(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.util.Vector catEntIdsFromShoppingCart)
This method populates the search result for the given Product type promotion.
|
protected void | recurseCategory(java.lang.String astrCatgroupId)
This method gets all the category IDs of the specified tree in recursive manner.
|
public static final java.lang.String CLASSNAME
public static final java.lang.String COPYRIGHT
public static final java.lang.String PARAMETER_CUSTOMER_ID
public static final java.lang.String PARAMETER_ORDER_ID
public static final int ACTIVE_STATUS
public static final java.lang.String PROMTION_RELATION
public void init(CommandContext aCmdCtxt, TypedProperty aRequestProperties, TypedProperty aResponseProperties, org.w3c.dom.Document aRequestBOD, org.w3c.dom.Document aResponseBOD)
This method first calls the init method from the parent class.
It will then call the initializeSearchTypeMapping to initialize the mappings between the search type obtained from the SelectExpression element in the request Business Object Document to the actual value set to the search bean.
protected void buildDataArea() throws ECException
This method will do the following:
<wc:DataArea> <oa:Show confirm="Always"/> <wc:Promotions> <-- createPromotionElement() --> </wc:Promotions> </wc:DataArea>
public java.util.ArrayList executeGetPromotion(SearchCriteria aSearchCriteria) throws ECException
The getAllActivePromotion method gets the list of all active promotions that meets the specified search criteria. Extend this method to control over filtering/adding promotions based on required scenario.
protected java.lang.Long[] getMemberGroupIds(java.lang.String customerId) throws ECException
protected java.lang.String getIdFromPromotionKey(PromotionKey promotionKey) throws ECException
protected java.util.ArrayList populateSearchResult(java.lang.String astrPromotionId, java.lang.String orderId, java.lang.Long[] mbrGrpIds, java.util.ArrayList promotionList) throws ECException
protected java.util.ArrayList populateSearchResultWithOtherGroupPromotions(java.lang.String astrPromotionId, java.lang.String orderId, java.lang.Long[] mbrGrpIds, RLPromotionBean rlPromBean, java.util.ArrayList promotionList) throws ECException
protected java.lang.String getCalculationCodeForPromotion(java.lang.String promotionId) throws ECException
protected RLPromotionBean getRLPromotionBean(java.lang.String calCodeId) throws ECException
This method can be extended to create and return any specific instance of RLPromotionBean class.
protected java.util.ArrayList populateSearchResultWithOrderPromotion(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.lang.Long[] mbrGrpIds)
protected java.util.ArrayList populateSearchResultWithProductPromotion(java.lang.String astrPromotionId, java.lang.String orderId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean) throws ECException
protected java.util.ArrayList populateSearchResultWithCMCRLPromotions(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.util.Vector catEntIdsFromShoppingCart) throws ECException
protected java.util.ArrayList populateSearchResultWithOtherPromotions(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.util.Vector catEntIdsFromShoppingCart) throws ECException
protected java.util.ArrayList populateSearchResultWithCategoryTypePromotion(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.util.Vector catEntIdsFromShoppingCart) throws ECException
protected java.util.ArrayList populateSearchResultWithProductTypePromotion(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.util.Vector catEntIdsFromShoppingCart) throws ECException
protected java.util.ArrayList populateSearchResultWithItemTypePromotion(java.lang.String astrPromotionId, java.util.ArrayList promotionList, RLPromotionBean rlPromBean, java.util.Vector catEntIdsFromShoppingCart) throws ECException
protected java.util.Vector getOrderItemIdsFromOrder(java.lang.String orderId) throws ECSystemException
protected void getMACatEntIds(java.lang.String astrCatEntryId, java.util.Vector nCatEntIdsFromShoppingCart) throws ECSystemException
protected java.lang.String getRootElementName()
protected PromotionKey[] getAllActivePromotion()
This method can be extended to handle filtering/adding the promotions by using available finder query in PromotionPersistenceManager class.
protected java.util.Vector getPromotionsFromRelatedStores()
This method can be extended to handle filtering/adding the promotions by using available finder query in PromotionPersistenceManager class.
protected void recurseCategory(java.lang.String astrCatgroupId) throws ECSystemException
protected java.lang.String getCategoryNameForCatEntry(java.lang.String astrCatEntId) throws ECSystemException
protected java.util.Vector getPromotedOrderItemsForItemTypePromotion(java.util.Vector promItemIds, java.util.Vector orderItemIds)
protected java.util.Vector getPromotedOrderItemsForProductTypePromotion(java.util.Vector promItemIds, java.util.Vector orderItemIds) throws ECSystemException
protected java.util.Vector getPromotedOrderItemsForCategoryTypePromotion(java.util.Vector promItemIds, java.util.Vector orderItemIds) throws ECSystemException
public org.w3c.dom.Element createPromotionElement(PromotionSearchResultBean abnPromotionSearchResult, org.w3c.dom.Element aParentElement) throws ECException
The following sample shows the structure of the Promotion element and how it is constructed.
<Promotion> <oa:DocumentIds> <oa:DocumentId> <oa:Id>10000205</oa:Id> <!-- abnPromotionSearchResult.getPromotionId() --> </oa:DocumentId> </oa:DocumentIds> <oa:Description lang="en-US">Save 20% on all Furniture items! No restrictions!</oa:Description> <!-- RLPromotionBean.getShopLongDesc() --> <oa:Name lang="en-US">Furniture Category Discount</oa:Name> <!-- RLPromotionBean.getRLPromotion().getName() --> <oa:Usage>CategoryLevelPercentDiscount</oa:Usage> <!-- RLPromotionBean.getRLPromotion().getRLPromotionType() --> <oa:Note lang="en-US">Unused</oa:Note> <!-- Not used --> <ShortDescription lang="en-US">Save 20% on Furniture</ShortDescription> <!-- RLPromotionBean.getShopDesc() --> <Group>ProductLevelPromotion</Group> <!-- RLPromotionBean.getRLPromotion().getGroupName() --> <CatalogItems/> <!-- createCatalogItemsElement() is used to populate this element --> </Promotion>
protected org.w3c.dom.Element createCatalogItemsElement(PromotionSearchResultBean abnPromotionSearchResult, org.w3c.dom.Element aParentElement) throws ECException
The following sample indicates the structure of the CatalogItems element and how it is constructed.
<CatalogItems> <oa:ItemIds> <oa:ItemId> <oa:Id>10062</oa:Id> <!-- CatalogEntryDataBean.getCatalogEntryID() --> </oa:ItemId> </oa:ItemIds> <oa:ItemCategoryId>FULOV-0101</oa:ItemCategoryId> <!-- CatalogEntryDataBean.getPartNumber() --> <oa:ItemType>ItemBean</oa:ItemType> <!-- CatalogEntryDataBean.getType() --> <oa:Description lang="en-US">This classic love seat offers plush comfortable seating and is perfect for color-rich decors. Measures 73" in length, 37" in depth, and 38" in height.</oa:Description> <!-- CatalogEntryDataBean.getDescription().getLongDescription() --> <CategoryDescription lang="en-US">Loveseats</CategoryDescription> <!-- uses getCategoryNameForCatEntry() method --> <ItemName lang="en-US">Classic Blue-Fabric Roll-Arm Love Seat</ItemName> <!-- CatalogEntryDataBean.getDescription().getName() --> <UserData> <!-- createUserdataInCatalogItemsElement(CatalogEntryDataBean, PromotionSearchResultBean, Element) --> <UserDataField name="Name">"Value"</UserDataField> <UserData/> </CatalogItems>
protected org.w3c.dom.Element createUserdataInCatalogItemsElement(CatalogEntryDataBean catalogEntryDataBean, PromotionSearchResultBean abnPromotionSearchResult, org.w3c.dom.Element catalogItemsElement) throws ECException
... Element userDataElement = createWCDocumentElement(catalogItemsElement, BodConstants.TAG_WC_USER_DATA); createUserDataFieldElement(userDataElement, fieldName, fieldValue); ... return userDataElement;