Using the new SDO to customize the client library and component facade

This section explains using the new SDO to customize the client library and component facade.

About this task

Create the source code support the new engraving attributes for the Web service

Procedure

  1. In the Enterprise Explorer view click Other Projects > WebSphereCommerceServerExtensionsLogic. Create a new package:
    1. Click src, then selecting new, then package. Enter the name com.mycompany.commerce.customization.order and select Finish.
  2. In the new package, create a new class by left clicking com.mycompany.commerce.customization.order, and selecting new then class. Enter MyOrderFacadeClient into the name field then click Finish.
  3. Repeat the preceding step to create the classes MyExtendOrderItemProcessCmdImpl, ExtComposeOrderDetailsCmdImpl and MyOrderFactoryImpl.

    The first class that is called MyOrderFacadeClient.java extends the client API library to expect new engraving attributes from the store. The next two classes, MyExtendOrderItemProcessCmdImpl.java and ExtComposeOrderDetailsCmdImpl.java are both commands. These new classes extend existing commands and persist and retrieve the engraving information of an order item to the PATTRVALUE table. The last class is called MyOrderFactoryImpl.java and it used to override the order factory so that your customized EngravingOrderItemType is used. Your workspace can resemble the following image. You might encounter compilation errors. You must complete all steps before the classes compile.

    Your workspace

  4. Open MyOrderFacadeClient.java and replace the contents with the following code: MyOrderFacadeClient.java.
  5. Open MyExtendOrderItemProcessCmdImpl.java and replace the contents with the following code: MyExtendOrderItemProcessCmdImpl.java.
  6. Open ExtComposeOrderDetailsCmdImpl.java and replace the contents with the following code: ExtComposeOrderDetailsCmdImpl.java
  7. Open MyOrderFactoryImpl.java and replace the contents with the following code: MyOrderFactoryImpl.java.
  8. After you enter the new code for each Java class, right-click in the editor and select Source then Organize Imports.
  9. Clean and rebuild your entire workspace by selecting Projects in WebSphere Commerce Developer. Then, select Clean, ensure that Clean all projects is selected and click OK. Ensure that all build errors no longer display.