Tutorials > Program model > Web services > Customize Web 2.0 and Web services to support personalization

< Previous | Next >


Create the SDO genmodel file

In this step we will create an genmodel file that will be used to generate the new EngravingOrderItemType object.


Procedure

  1. To create the EMF genmodel, click MyExtensionType.xsd in the Enterprise Explorer view, then select New then Other. Check the Show All Wizards box and select Eclipse Modeling Framework then EMF Models. Click Next.

  2. Navigate to the WebServicesRouter/WebContent/component-services/ecore folder. Name the new genmodel file MyExtension.genmodel and click Next.

  3. Select Load from an XML Schema and click Next

  4. Click Browse Workspace and select the list of XSD schemas to include in the model. Go to the message BOD, in the Components folder and select MyExtenstionTypes.xsd. Click OK then Next.

  5. Select the datatypes checkbox for com.mycompany.commerce.order.facade.datatypes. Then click the Browse button to add references existing genmodel files.

  6. Expand Workspace/WebServicesRouter/WebContent/component-services/ecore then select Order.genmodel, Foundation.genmodel, and Oagis9.genmodel. Click OK.

  7. Expand Order in the Referenced generator models view. Select all the referenced generator models and click Finish.

  8. Optional: To verify the .genmodel file and .ecore file for a component has been generated correctly:

    1. Open the .genmodel file from the DataObject project.

    2. Search for references to Foundation.genmodel and Oagis9.genmodel and ensure they are not referring to a relative location on the file system.

      For example, the correct referencing should resemble the following snippet:

      bundleManifest="false" copyrightFields="false" runtimeVersion="2.2"
      usedGenPackages="Foundation.genmodel#//datatypes 
      Oagis9.genmodel#//codelists 
      Oagis9.genmodel#//unqualifieddatatypes 
      Oagis9.genmodel#//datatypes"> 
      

      That is, it should not resemble the following snippet:

      bundleManifest="false"
      usedGenPackages="../../Foundation-DataObjects/ecore/Foundation.genmodel#//datatypes 
      ../../Foundation-DataObjects/ecore/Oagis9.genmodel#//codelists 
      ../../Foundation-DataObjects/ecore/Oagis9.genmodel#//unqualifieddatatypes 
      ../../Foundation-DataObjects/ecore/Oagis9.genmodel#//datatypes"> 
      

    3. Open the .ecore file from the DataObject project.

    4. Search for references to the com.ibm.commerce package, such as com.ibm.commerce.oagis9.datatypes.ecore and ensure they are not referring to a relative location on the file system.

      For example, the correct referencing should resemble the following snippet:

      eType="ecore:EClass com.ibm.commerce.oagis9.datatypes.ecore#//AcknowledgeType" 
      

      That is, it should not resemble the following snippet:

      eType="ecore:EClass ../../Foundation-DataObjects/ecore/com.ibm.commerce.oagis9.datatypes.ecore#//AcknowledgeType" 
      

< Previous | Next >


+

Search Tips   |   Advanced Search