Tutorials > Program model > Extend the object model and modifying an existing task command

< Previous


Load the completed tutorial code

This section explains how to load the completed code into WebSphere Commerce Developer instead of completing each tutorial step. You can load the completed code into WebSphere Commerce Developer instead of completing each tutorial step.

You must have created a store based on the consumer direct sample store in your WebSphere Commerce development environment.

The completed tutorial code is in the objectmodel_completedsource.zip file, provided with the tutorial sample code in the WCSample.zip file.


Procedure

  1. Start the test environment.

  2. Open a browser and type the following URL: http://localhost/webapp/wcs/admin/servlet/db.jsp

  3. In the input box, enter the following SQL statement:

    insert into CMDREG (STOREENT_ID, INTERFACENAME, DESCRIPTION,     CLASSNAME, TARGET)
     values (CD_storeent_ID,     'com.ibm.commerce.order.commands.ExtOrderProcessCmd', 
         'This is a new task command for the extending an entity bean tutorial.',     'com.ibm.commerce.sample.commands.MyExtOrderProcessCmdImpl',     'local');
    

    Where: CD_storeent_ID is the store's unique identifier.

  4. Click Submit Query to run the SQL statement.

  5. In this step, you create the XORDGIFT table that stores the gift order information. Follow the steps in Create and populating the XORDGIFT table.

  6. Import the files required to display the new Gift Order function:

    1. In the Enterprise Explorer view, navigate to Stores > WebContent > ConsumerDirect_name > ShoppingArea > CheckoutSection > StandardCheckoutSubsection

    2. Create a backup copy of OrderConfirmationDisplay.jsp called OrderConfirmationDisplay.bak.jsp.

    3. Navigate to Stores > WebContent > ConsumerDirect_name > Snippets > EDP > PaymentMethods

    4. Create a backup copy of PaymentMethodsDisplay.jsp called PaymentMethodsDisplay.bak.jsp.

    5. From the ConsumerDirect_name folder's pop-up menu, select Import.

    6. Select General > Archive File and click Next.

    7. In the From archive file text box, enter or browse to the objmodel_completedsource.zip file.

    8. Deselect ordergift.properties, WebSphereCommerceServerExtensionsData.jar, and WebSphereCommerceServerExtensionsLogic.jar

    9. Click Finish.

    10. The following files are introduced into the workspace:

      • ConsumerDirect_name\include\OrderSummaryDisplayInclude.jsp

      • ConsumerDirect_name\include\OrderDetailDisplayInclude.jsp

      • ConsumerDirect_name\ShoppingArea\CheckoutSection\StandardCheckoutSubsection\OrderConfirmationDisplay.jsp

      • ConsumerDirect_name\Snippets\EDP\PaymentMethods\PaymentMethodsDisplay.jsp

    11. In the Enterprise Explorer view, navigate to Stores > Java Resources: src > ConsumerDirect_name

    12. From the ConsumerDirect_name directory's pop-up menu, select Import.

    13. Select General > Archive File and click Next.

    14. In the From Archive File field, browse to the objmodel_completedsource.zip file.

    15. Click Deselect All.

    16. Select ordergift.properties.

    17. Click Finish.

  7. Update the command and data bean JAR file on the target WebSphere Commerce Server

    In this section you update the target WebSphere Commerce Server to use the new command and data bean JAR file,...

    1. From the objmodel_completedsource.zip file, extract WebSphereCommerceServerExtensionsLogic.jar file to a temporary directory.

    2. In the Enterprise Explorer view, navigate to the WebSphereCommerceServerExtensionsLogic project.

    3. From the src folder's pop-up menu, select Import.

    4. Select General > Archive File and click Next.

    5. In the From Archive File field, browse to or enter the full path of the WebSphereCommerceServerExtensionsLogic.jar file. Click Open.

    6. Click Deselect All in the right pane, and select the com folder.

    7. Click Finish.

  8. Update the EJB JAR file on the target WebSphere Commerce Server

    1. From the objmodel_completedsource.zip file, extract WebSphereCommerceServerExtensionsData.jar file to a temporary directory.

    2. In the Enterprise Explorer view, navigate to the WebSphereCommerceServerExtensionsData project.

    3. From the ejbModule folder's pop-up menu, select Import .

    4. Select General > Archive File and click Next.

    5. In the From archive file field, browse to or enter the fully qualified path of the WebSphereCommerceServerExtensionsData.jar file.

    6. Select Overwrite existing resources without warning.

    7. Click Finish.

    8. Generate Test deployment code:

      1. From the WebSphereCommerceServerExtensionsData project's pop-up menu, select Java EE > Prepare for Deployment.

      2. Ensure no errors display in the console view.

  9. Verify the gift message functionality by following the instructions in Test the new gift message functionality.

< Previous


+

Search Tips   |   Advanced Search