Tutorials > Program model > Web services > Customize Web 2.0 and Web services to support personalization

< Previous | Next >


Use 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.

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 on com.mycompany.commerce.customization.order, and selecting new then class. Enter MyOrderFacadeClient into the name field then click Finish.

  3. Repeat step two above, three more times creating the classes MyExtendOrderItemProcessCmdImpl, ExtComposeOrderDetailsCmdImpl and MyOrderFactoryImpl.

    The first class 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 will respectively 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 the customized EngravingOrderItemType is used. Your workspace should look like the following. You will probably get compile errors, but complete all steps before the classes will compile.

  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 entering the new code for each Java class, right-click in the editor and select Source then Organize Imports.

  9. Clean and rebuild the 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 have disappeared.

< Previous | Next >


+

Search Tips   |   Advanced Search