In this lesson, you register a serialization
JSP file. This file takes the promotion authoring elements from the
PX_ELEMENT and PX_ELEMENTNVP tables and displays them in the "Purchase
Condition and Reward" section of the Management Center user interface
for your new promotion type. Business users can then use this section
of the user interface when they create promotions.
About this task
The JSP file is provided with the Management Center as SerializeGenericPromotionElement.jsp;
you must register this file with the new promotion type. Note that
the PX_ELEMENT and PX_ELEMENTNVP tables are initially empty until
someone creates a new promotion using the Management Center.
Procedure
- In the Enterprise Explorer view,
navigate to the directory.
- Open the struts-extension.xml file
with a Struts configuration file editor.
- Add a new action mapping:
- Click the ActionMappings tab.
- In the Action Mappings section,
click Add.
- Under The following Action Mappings are defined
for this config file, type /SerializePromotionElement-ProductLevelFreeGiftPurchaseCondition
- In the Action Mapping attributes section,
select Include, and then type /jsp/commerce/promotion/restricted/SerializeGenericPromotionElement.jsp
- Save the struts-extension.xml configuration
file.
- To verify your updates, view the source of the struts-extension.xml configuration
file and ensure you see the code you added, as shown here:
<action path="/SerializePromotionElement-ProductLevelFreeGiftPurchaseCondition"
include="/jsp/commerce/promotion/restricted/SerializeGenericPromotionElement.jsp"/>
Note: The
path value is constructed in each promotion element according to the
following format:
/SerializePromotionElement-<promotion_element_subtype>
The
promotion element subtype value comes from the PX_ELEMENT table in
the SUBTYPE column.
The JSP file used in the
Management Center Promotions tool is the SerializeGenericPromotionElement.jsp
file. This file serves to serialize the generic promotion elements
in the user interface. The user interface elements of the new promotion
type can also be serialized by this file.
- Restart the WebSphere Commerce test server to make the
new configuration available.
Results
In this lesson you registered the serialization JSP file.
In next lesson, you retrieve and register the XSL template used to
transform the authoring promotion XML to the runtime promotion XML.