Thursday, 28 January 2016


Generating SDO from XSD in eclipse 

1. Select xsd file for which you want to generate SDO in Enterprise Explorer 
2. Right click on the xsd and select “New -> Other..” option. 
3. In the next popup screen select the “EMF Model” and Click on “Next” button. 
4. In the next popup screen select the “model” as parent folder and Click on “Next” button. 
5. In the next popup screen select the “XML Schema” and Click on “Next” button. 
6. In the next popup screen click on “Load” button then Click on “Next” button. 
7. In next screen click on “Finish” button. 
8. Open .genmodel file whatever you create then right click on it and select “Set SDO Defaults” 

In the Properties Window (while your genmodel file is selected above) ensure that the following values are set. 

Under the All heading, set these properties: 

  • Property Value 
  • Bundle Manifest False 
  • Compliance Level 1.4 
  • Copyright Fields True 
  • Runtime Version 2.2 
  • Under the Model heading, set these properties: 
  • Suppress EMF Metadata False 
  • Suppress EMF Model Tags True 
  • Save your changes and close the file 

9. Save .genmodel file whatever you created and Right click on genmodel and then click on “Generate Model Code”. 
10. Following folder structure will display on Explorer/ Navigator view. 
11. 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. 
  • Using Windows Explorer, navigate to WCDE_installdir/workspace/WC/xml/config/. Create a new folder based on your module (For example for Retail Interfaces in DFS com.dfs.interfaces). 

12. Inside your new folder, using any text editor, create a new file called SDO.properties. 
Open SDO.properties with an editor and insert the following text. Save and close the file 
13. com.mycompany.commerce.order.facade.datatypes.impl.MyOrderPackageImpl. For DFS Finance Options in Retail Interfaces it is com.dfs.interfaces.datatypes.incoming.financeoptions.impl.FinanceoptionsPackageImpl 
14. Check that the above class is present in that location by the generated SDO code.
15. Check-in code into svn. 

Referencing your SDO Project in other projects

1. If it is a newly created project, it needs to be referenced in the WC and ExtensionLogic projects.
2. Open the application.xml in WC Project. In the design view, click on Manage Utility Jars link 
3. It opens the Java EE Module Dependencies window. 
4. Check your Data Objects jar. (In the above screen shot , it is Common-SDO.jar). Click Apply and then Ok.
5. Right click on ExtensionsLogic project and click on properties. 
6. Select the “Java EE Module Dependencies” option. 
7. Check your DataObjects project jar (In the above screenshot it is Common-SDO.jar). Click Apply and then Ok.
8. Clean and build all projects and start the Server to test the new functionality. 


No comments:

Post a Comment