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
Procedure
- In the Enterprise Explorer view, navigate to the directory.
- Open the spring-extension.xml file for editing.
-
Add a controller configuration for your new promotion type by coping the following code into
your file.
<bean id="/SerializePromotionElement-ProductLevelFreeGiftPurchaseCondition" class="org.springframework.web.servlet.mvc.ParameterizableViewController"> <property name="viewName" value="/jsp/commerce/promotion/restricted/SerializeGenericPromotionElement.jsp"/> <property name="supportedMethods" value="GET,POST"/> </bean>
If this is the only custom controller configuration bean definition in the file, your spring-extension.xml can resemble the following code snippet:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="/SerializePromotionElement-ProductLevelFreeGiftPurchaseCondition" class="org.springframework.web.servlet.mvc.ParameterizableViewController"> <property name="viewName" value="/jsp/commerce/promotion/restricted/SerializeGenericPromotionElement.jsp"/> <property name="supportedMethods" value="GET,POST"/> </bean> </beans>
Theid
attribute value is in the 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 HCL 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.