Loading the completed tutorial code

You can load the completed code into WebSphere Commerce Developer instead of completing each step in the tutorial. Loading the code consists of the following high-level steps: Updating the command registry on the target WebSphere Commerce Server; and Validating the new logic on the target WebSphere Commerce Server.

About this task

This step uses controllercmd_completedsource.zip found in the WCSample.zip file.

Procedure

  1. Updating the database in WebSphere Commerce Developer. In this step, you will modify the command registry so that it will use your new MyOrderItemAddCmdImpl implementation class. To register MyNewControllerCmd in the CMDREG table:
    1. Start the test environment.
    2. Open a browser and type the following URL: http://localhost/webapp/wcs/admin/servlet/db.jsp.
    3. Enter the following SQL statement:
      
      update CMDREG
      set CLASSNAME='com.ibm.commerce.sample.commands.MyOrderItemAddCmdImpl'
      WHERE INTERFACENAME=
      'com.ibm.commerce.orderitems.commands.OrderItemAddCmd'
      and storeent_Id=0;
      
    4. Click Submit Query to run the SQL statement.
  2. Load the JAR file that contains the new MyOrderItemAddCmdImpl into WebSphere Commerce Developer:
    1. Select the WebSphereCommerceServerExtensionsLogic/src directory, and from its pop-up menu, select Import.
    2. Select Zip file and click Next.
    3. In the From zip file text box, enter or browse to the location of controllercmd_completedsource.zip
    4. Deselect MyNewErrorMessages.properties
    5. Click Finish.
  3. Import the message properties file to WebSphere Commerce Developer. Properties files contain the text that displays in the Web browser and in log files. Add the new message properties file to WebSphere Commerce Developer:
    1. In the Enterprise Explorer view, navigate to Stores > Java Resources > src > Consumer_Direct_name where Consumer_Direct_Name is the name of your consumer direct sample store.
    2. From the Consumer_Direct_name folder's pop-up menu, select Import.
    3. Select Zip file and click Next.
    4. In the From zip file text box, enter or browse to the location of controllercmd_completedsource.zip.
    5. Click Deselect All.
    6. Click MyNewErrorMessages.properties and click Finish.
  4. Verifying the MyOrderItemAddCmdImpl logic in WebSphere Commerce Developer
    Verify that the code is working properly by following the steps in Test the MyOrderItemAddCmdImpl command.