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

< Previous | Next >


Generate the SDO code from the genmodel file

In this step we will generate the new Service Data Object from the genmodel file.


Procedure

  1. Inside the Enterprise Explorer view, navigate to WebServicesRouter > WebContent > component-services/ecore folders. Open MyExtension.genmodel file if it is not already open. Expand MyExtension.

  2. In the editor window select DataTypes. In the properties view under All, remove the value DataTypes from the prefix property and replace it with the text MyOrder.

  3. Select MyExtension in the editor view and scroll down the properties view until you see the Model Directory property, change the value to /WebSphereCommerceServerExtensionsLogic/src. Save your changes.

  4. Inside the editor view, right-click MyExtension select Set SDO Defaults.

  5. Right-click MyExtension and select Generate Model Code.

  6. Remove the SDO generated files

    1. Delete the following packages and Java classes generated under the src folder of the WebSphereCommerceServerExtensionsLogic.

    2. Modify the build path and builders in the project properties accordingly.

  7. Create an SDO properties file

    Create an SDO properties file to register the generated SDO package class. In order to support auto detection of an XML document to the appropriate Java object, the SDO package needs to be registered in the application.

    1. Use Windows Explorer, navigate to WCToolkit_installdir/xml/config/. Create a new folder called com.mycompany.commerce.order. Inside your new folder, using any text editor, create a new file called SDO.properties.

    2. Open SDO.properties with an editor and insert the following text. Save and close the file.

              #
             
      #-------------------------------------------------------------------
              # Licensed Materials - Property of IBM
              #
              # WebSphere Commerce    
              #
              # (c) Copyright IBM Corp. 2006
              #
              # US Government Users Restricted Rights - Use, duplication
      or
              # disclosure restricted by GSA ADP Schedule Contract with
      IBM Corp.
             
      #-------------------------------------------------------------------
              #
              
             
      com.mycompany.commerce.order.facade.datatypes.MyOrderPackage
      

< Previous | Next >


+

Search Tips   |   Advanced Search