diff _test/Resources/resources.xsd @ 219:c477f24f1980

sync
author sergey
date Tue, 21 Aug 2012 17:13:47 +0400
parents 358f867712b4
children 5c82c15b25b1
line wrap: on
line diff
--- a/_test/Resources/resources.xsd	Mon Aug 20 17:24:48 2012 +0400
+++ b/_test/Resources/resources.xsd	Tue Aug 21 17:13:47 2012 +0400
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<schema targetNamespace="uri:impl-web-application/resources" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="uri:impl-web-application/resources">
+<schema targetNamespace="http://implab.org/schemas/resources" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://implab.org/schemas/resources">
     <element name="resources">
     	<complexType>
     		<sequence>
     			<element name="root" type="tns:restResource"></element>
-    			<element name="typeMap">
+    			<element name="typeMap" minOccurs="0">
     				<complexType>
     					<sequence>
-    						<element name="item">
+    						<element name="item" maxOccurs="unbounded">
     							<complexType>
     								<complexContent>
     									<extension
@@ -25,6 +25,11 @@
     	</complexType>
     </element>
     
+    <!-- abstract types  -->
+    <complexType name="abstractBinding" abstract="true"/>
+    <complexType name="abstractTransformation" abstract="true" />
+    <complexType name="abstractResult" abstract="true" />
+    
     <complexType name="restResource">
         <sequence>
     		<element name="get" type="tns:restOperation" minOccurs="0">
@@ -41,9 +46,69 @@
     
     <complexType name="restOperation">
     	<sequence>
-    		<element name="invoke" type="string"></element>
+    		<element ref="tns:abstractBinding"/>
     		<element name="parameters" type="string"></element>
-    		<element name="result" type="string"></element>
+    		<element ref="tns:abstractResult"/>
     	</sequence>
     </complexType>
+    
+    <complexType name="methodBinding" >
+        <complexContent>
+            <extension base="tns:abstractBinding">
+                <attribute name="target" type="string" />
+                <attribute name="invoke" type="string" use="required" />
+            </extension>
+        </complexContent>
+    </complexType>
+    
+    <complexType name="transformation">
+        <attribute name="class" type="string" />
+    </complexType>
+    
+    <complexType name="resourceLocator">
+        <sequence>
+            <element ref="tns:abstractBinding" />
+            <element name="template" type="string" />
+        </sequence>
+    </complexType>
+    
+    
+    
+    
+    <!-- substitutions  -->
+    
+    <!-- abstract -->
+    <element name="abstractBinding" type="tns:abstractBinding" abstract="true"/>
+    <element name="abstractTransfomation" type="tns:abstractTransformation" />
+    <element name="abstractResult" type="tns:abstractResult" abstract="true" />
+    
+    <!-- specific -->
+    
+    <!-- bindings -->
+    <element name="bind" type="tns:methodBinding" substitutionGroup="tns:abstractBinding"/>
+    
+    <!-- transformation -->
+    
+    <!-- result handlers  -->
+    <simpleType name="redirectCodes">
+        <restriction base="string">
+            <enumeration value="moved-permanently"/>
+            <enumeration value="temporary-redirect"/>
+            <enumeration value="see-other"/>
+        </restriction>
+    </simpleType>
+    
+    <complexType name="redirectResult">
+        <complexContent>
+            <extension base="tns:abstractResult">
+                <sequence>
+                    <element name="locator" type="tns:resourceLocator" />
+                    <element name="status" type="tns:redirectCodes" minOccurs="0"/>
+                </sequence>
+            </extension>
+        </complexContent>
+    </complexType>
+    
+    <element name="redirect" type="tns:redirectResult" substitutionGroup="tns:abstractResult" />    
+
 </schema>
\ No newline at end of file