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.
Procedure
- In WebSphere Commerce Developer.
-
Right-click WebServicesRouter;
then click Refresh.
- Navigate
to WebServicesRouter/WebContent/component-services/xsd/OAGIS/9.0/Overlays.
- Create a folder by right-clicking Overlays and selecting
. 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. - Right-click the
Components folder and select .
Expand the XML folder and select XML Schema.
- Name the file MyExtensionType.xsd
and click Finish.
- 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>
- Save and close the file.