Tutorial: Customizing Web 2.0 and Web services to support personalization > < Previous | Next >

 

Generating the SDO code from the genmodel file

In this step you will generate the new Service Data Object from the genmodel file. Generate the SDO

  1. Inside Project Explorer, navigate to Dynamic Web Projects/WebServicesRouter/WebContent/component-services/ecore folders. Open MyExtension.genmodel file if it is not already open. Expand MyExtension.

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

  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.

Verify your SDO has been create properly

  1. Verify that the following packages and java classes were generated under the src folder of your WebSphereCommerceServerExtensionLogic.

  2. Right-click WebShepereServerExtensionLogic and select Properties. Click Java Build Path then the Projects tab. Ensure that WebSphereCommerceServerExtensionsData is selected.

  3. Click the Order and Export tab and ensure that WebSphereCommerceServerExtensionData is selected.

  4. Click OK.

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. Inside an explorer window, 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
            #
    or
            # disclosure restricted by GSA ADP Schedule Contract with
    IBM Corp.
           
    #-------------------------------------------------------------------
            #
            
           
    com.mycompany.commerce.order.facade.datatypes.MyOrderPackage
    

< Previous | Next >