Tutorial: Customizing Web 2.0 and Web services to support personalization > < Previous | Next >

 

Updating the order shopping flow

This section explains how to update the order shopping flow.. Register the your new commands

  1. Open abrowser and type the following URL: http://localhost/webapp/wcs/admin/servlet/db.jsp.

  2. In the input box, enter the following SQL statement to register the new commands
    INSERT INTO CMDREG(STOREENT_ID, INTERFACENAME, CLASSNAME, TARGET)
    VALUES
    (0,'com.ibm.commerce.orderitems.commands.ExtendOrderItemProcessCmd','com.mycompany.commerce.customization.order.MyExtendOrderItemProcessCmdImpl','Local');
    
    UPDATE CMDREG SET CLASSNAME =
    'com.mycompany.commerce.customization.order.ExtComposeOrderDetailsCmdImpl'
    WHERE
    INTERFACENAME='com.ibm.commerce.order.facade.server.commands.ComposeOrderCmd+IBM_Details';
    

Register the your new Client API

  1. Use explorer to navigate to WCDE_installdir\workspace\Stores\WebContent\WEB-INF

  2. Find the struts-config-ext.xml file and click the Source tab.

  3. Open the file with an editor and paste the below text into the bottom of the file, but above the </struts-config> tag, save and close the file
    <plug-in className="com.ibm.commerce.struts.ComponentPlugIn">
            <set-property property="componentId" value="order"/>
            <set-property property="clientFacadeClassName"
    value="com.mycompany.commerce.customization.order.MyOrderFacadeClient"/>
    </plug-in>
    

Add the overlay engraving objects to the mapping files

  1. Navigate to WCDE_installdir\xml\messaging\component-services folder. Create a copy of the ChangeOrderSOIBODMapping.xml file and rename it CustomizedChangeOrderSOIBODMapping.xml.

  2. Open CustomizedChangeOrderSOIBODMapping.xml inside an editor and add the following text to the bottom of the file but before the </TemplateTag>. Save and close the file
            <Tag XPath="DataArea/Order/OrderItem/EngravingText"
    Field="engravingText"/>
            <Tag XPath="DataArea/Order/OrderItem/EngravingText@font"
    Field="engravingFont"/>
            <Tag XPath="DataArea/Order/OrderItem/EngravingText@size"
    Field="engravingSize"/>              
    

  3. Open the file component-services-user-template.xml inside of an editor. Copy the text below and replace the entire contents of the file. This will add the entry for your new CustomizedChangeOrderSOIBODMapping.xml. The component-services-user-template.xml should look like this:

<?xml version="1.0"?>
<!--
 *===================================================================
 * Licensed Materials - Property of IBM
 *
 * WebSphere Commerce
 *
 * (c) Copyright IBM Corp. 2000, 2004
 * disclosure restricted by GSA ADP Schedule Contract with IBM
Corp.
 *===================================================================
-->
<!-- If you are viewing with browser (IE for example), select
View Source to see actual source of file -->
<!DOCTYPE ECTemplate SYSTEM '../ec_template.dtd' [     <!--
Source comment: this [ is required, do not remove -->
        <!ENTITY CustomizedChangeOrderSOIBODMappingDefinition
SYSTEM 'CustomizedChangeOrderSOIBODMapping.xml'>
]>   <!-- Source comment: this ]> is required, do not
remove -->

<ECTemplate>
        &CustomizedChangeOrderSOIBODMappingDefinition;
</ECTemplate>
< Previous | Next >