Generating the SDO code from the genmodel file
In this step, you generate the new Service Data Object from the genmodel file.
Procedure
- Set your EMF genmodel to generate 2.2 compatible objects.
- 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.
- 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. - 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.
- Inside the editor view, right-click MyExtension select
Set SDO Defaults.
- Save your changes.
- Right-click MyExtension and select Generate
Model Code.
- 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.
- 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.
- 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