Registering a serialization JSP file

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

  1. In the Enterprise Explorer view, navigate to the LOBTools > WebContent > WEB-INF directory.
  2. Open the struts-extension.xml file with a Struts configuration file editor.
  3. Add a new action mapping:
    1. Click the ActionMappings tab.
    2. In the Action Mappings section, click Add.
    3. Under The following Action Mappings are defined for this config file, type /SerializePromotionElement-ProductLevelFreeGiftPurchaseCondition
    4. In the Action Mapping attributes section, select Include, and then type /jsp/commerce/promotion/restricted/SerializeGenericPromotionElement.jsp
    5. Save the struts-extension.xml configuration file.
    6. 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.

  4. 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.