Generating the SDO code from the genmodel file

In this step, you generate the new Service Data Object from the genmodel file.

Procedure

  1. Set your EMF genmodel to generate 2.2 compatible objects.
  2. Inside the Enterprise Explorer view, navigate to WebServicesRouter > WebContent > component-services/ecore folders. Open the MyExtension.genmodel file if it is not already open. Expand MyExtension.

    Expand MyExtension

  3. In your 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.

    Remove the value DataTypes from the prefix property and replace it with the text MyOrder

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

    Change the Model Directory property value

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

    Screen capture of SDO Defaults

  6. Save your changes.
  7. Right-click MyExtension and select Generate Model Code.

    Generate Model Code

  8. 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 must be registered in the application.

    1. Inside the Enterprise Explorer view, navigate to WC/xml/config/. Create a folder that is called com.ibm.commerce.order-ext. Inside your new folder, create a file and name the file: SDO.properties.
    2. Copy and paste the following code into the SDO.properties file. 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.impl.MyOrderPackageImpl