Tutorials > Program model > Web services > Create a new WebSphere Commerce BOD service module

< Previous | Next >


Generate the SDOs for the TutorialStore noun

Once you have the base code and project structure generated using JET, you now can generate the service data objects (SDOs) that implement the logical data model of the TutorialStore noun, which is defined in the TutorialStore.xsd file. SDOs are Java objects that represent the nouns in the logical model. You can generate these nouns from the noun definition.

As a quick reminder, a noun is defined as an XML schema and can include primitive XML schema types, new complex types, or reuse WebSphere Commerce and Oagis9 predefined type constructs. The TutorialStore noun represents the logical data model of the new service module that you are building in this tutorial. In the diagram below, you can see how generating the SDOs fits into the overall customization process:

Before you start generating the data objects, set up the predefined WebSphere Commerce type constructs, and to update the JET-generated TutorialStore.xsd template with the own noun definition.


Procedure

  1. Update the generated TutorialStore noun:

    1. Open the BODTutorialStore-DataObjects/xsd/OAGIS/9.0/Overlays/MyCompany/Commerce/Resources/Nouns/TutorialStore.xsd file in a text editor.

    2. Replace the generated content with the contents of the following download: TutorialStore.xsd.

      Open the download in a text editor (not an internet browser) to copy the contents

  2. Open the BODTutorialStore-DataObjects\ecore folder.

  3. Right-click BODTutorialStore.genmodel and select Reload.

  4. Select XML Schema. Click Next.

  5. Click Next again.

  6. Click Add.

  7. Expand the WebServicesRouter\WebContent\component-services\ecore folder.

  8. Select Foundation.genmodel and Oagis9.genmodel.

  9. Click OK.

  10. In the Referenced generator models area, select com.ibm.commerce.oagis9.datatypes.codelists, com.ibm.commerce.oagis9.datatypes.unqualifieddatatypes, com.ibm.commerce.oagis9.datatypes under the Oagis9 model and com.ibm.commerce.foundation.common.datatypes under the Foundation model. Click Finish.

  11. Open BODTutorialStore.genmodel.

  12. Right-click the BODTutorialStore element under the BODTutorialStore root and select Generate Model Code. This generates the BODTutorialStore-DataObjects code.

  13. Verify that the BODTutorialStore-DataObjects project has no compilation errors.


Lesson checkpoint

In this step, you used the Eclipse Modeling Framework (EMF) to generate Service Data Objects (SDO) from the TutorialStore noun which is defined in the TutorialStore.xsd file.

< Previous | Next >


+

Search Tips   |   Advanced Search