Creating the overlay type

In this step you will create an XSD file that extends the OrderItemType to include your new engraving attributes. Create an XSD using the recommended OAGIS directory structure and your custom namespace that contains the extended complex type with the additional elements and attributes.

Before you begin

  • Ensure the EMF capability is enabled

    In you development workspace, click Windows > Preferences > Workbench > Capabilities. Expand Eclipse Developer and ensure that the Eclipse Modeling Framework (EMF) selection is checked. Click OK.

    Ensuring that Eclipse Modeling Framework (EMF) is checked

Procedure

  1. In WebSphere Commerce Developer.
  2. Right-click WebServicesRouter; then click Refresh.
  3. Navigate to WebServicesRouter/WebContent/component-services/xsd/OAGIS/9.0/Overlays.
  4. Create a folder by right-clicking Overlays and selecting New > Folder. In the name field type MyCompany then click Finish. Click MyCompany and create a new folder called Commerce. Add another folder inside Commerce called Resources and a folder called Components inside of Resources. Your folder structure should look similar to the following screen capture.

    Overlays folder structure

  5. Right-click the Components folder and select New > Other. Expand the XML folder and select XML Schema.

    Selecting XML Schema

  6. Name the file MyExtensionType.xsd and click Finish.

    Naming the file MyExtensionType.xsd and click Finish

  7. Open the new XSD file and replace the contents with the following code. This XML schema definition defines the overlay types that extend OrderItem to EngravingOrderItem, and the required supporting types (EngravingOrderItemTextType).
    
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
            xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
            xmlns:oa="http://www.openapplications.org/oagis/9"
           
    xmlns:myord="http://www.mycompany.com/xmlns/prod/commerce/9/order"
            xmlns:_ord="http://www.ibm.com/xmlns/prod/commerce/9/order"
           
    targetNamespace="http://www.mycompany.com/xmlns/prod/commerce/9/order"
            elementFormDefault="qualified"
    attributeFormDefault="unqualified"
            ecore:nsPrefix="myord"
           
    ecore:package="com.mycompany.commerce.order.facade.datatypes">
    
            <import
    namespace="http://www.ibm.com/xmlns/prod/commerce/9/order"
                   
    schemaLocation="../../../../IBM/Commerce/Resources/Nouns/Order.xsd"
    />
    
            <complexType name="EngravingOrderItemType">
                    <complexContent>
                            <extension base="_ord:OrderItemType">
                                    <sequence>
                                            <element
    name="EngravingText" type="myord:EngravingTextType" minOccurs="0"
    maxOccurs="unbounded">
                                            </element>
                                    </sequence>
                            </extension>
                    </complexContent>
            </complexType>
    
            <element name="EngravingOrderItem"
    type="myord:EngravingOrderItemType"
    substitutionGroup="_ord:OrderItem">
            </element>
    
            <complexType name="EngravingTextType">
                    <simpleContent>
                            <extension base="string">
                                    <attribute name="font"
    type="string"></attribute>
                                    <attribute name="size"
    type="string"></attribute>
                            </extension>
                    </simpleContent>
            </complexType>
    
    </schema>
    
  8. Save and close the file.