218
|
1 <?xml version="1.0" encoding="UTF-8"?>
|
221
|
2 <schema targetNamespace="http://implab.org/schemas/resources"
|
|
3 elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema"
|
|
4 xmlns:tns="http://implab.org/schemas/resources">
|
|
5 <element name="resources">
|
|
6 <complexType>
|
|
7 <sequence>
|
223
|
8 <element name="root" type="tns:ResourceContract" />
|
|
9 <element name="contracts" minOccurs="0">
|
221
|
10 <complexType>
|
|
11 <sequence>
|
222
|
12 <element name="contract" maxOccurs="unbounded">
|
221
|
13 <complexType>
|
|
14 <complexContent>
|
223
|
15 <extension base="tns:ResourceContract">
|
|
16 <attribute name="id" type="string" />
|
224
|
17 <attribute name="modelType" type="tns:ClassName"/>
|
221
|
18 </extension>
|
|
19 </complexContent>
|
|
20 </complexType>
|
|
21 </element>
|
|
22 </sequence>
|
|
23 </complexType>
|
|
24 </element>
|
|
25 </sequence>
|
|
26 </complexType>
|
|
27 </element>
|
|
28
|
|
29 <!-- abstract types -->
|
223
|
30 <complexType name="AbstractBinding" abstract="true" />
|
|
31 <complexType name="AbstractTransformation" abstract="true" />
|
|
32 <complexType name="AbstractResult" abstract="true" />
|
221
|
33
|
223
|
34 <complexType name="ResourceContract">
|
221
|
35 <sequence>
|
223
|
36 <group ref="tns:RestOperations" />
|
|
37 <element name="resource" maxOccurs="unbounded" minOccurs="0"
|
|
38 type="tns:ChildResourceContract" />
|
221
|
39 </sequence>
|
|
40 </complexType>
|
|
41
|
223
|
42 <complexType name="ChildResourceContract">
|
222
|
43 <sequence>
|
223
|
44 <choice>
|
|
45 <element name="name" type="string" />
|
|
46 <element name="match" type="string" />
|
|
47 </choice>
|
|
48 <element name="model" minOccurs="0" type="tns:MethodBinding" />
|
|
49 <choice>
|
|
50 <element name="contract">
|
|
51 <complexType>
|
|
52 <attribute name="ref" type="string" use="required" />
|
|
53 </complexType>
|
|
54 </element>
|
|
55 <sequence>
|
|
56 <group ref="tns:RestOperations" />
|
|
57 <element name="resource" type="tns:ChildResourceContract"
|
|
58 minOccurs="0" maxOccurs="unbounded" />
|
|
59 </sequence>
|
|
60 </choice>
|
|
61 </sequence>
|
|
62
|
|
63 </complexType>
|
|
64
|
|
65 <group name="RestOperations">
|
|
66 <sequence>
|
|
67 <element name="get" type="tns:OperationContract" minOccurs="0" />
|
|
68 <element name="post" type="tns:OperationContract" minOccurs="0" />
|
|
69 <element name="put" type="tns:OperationContract" minOccurs="0" />
|
|
70 <element name="delete" type="tns:OperationContract"
|
222
|
71 minOccurs="0" />
|
|
72 </sequence>
|
|
73 </group>
|
|
74
|
223
|
75 <complexType name="OperationContract">
|
|
76 <complexContent>
|
|
77 <extension base="tns:MethodBinding">
|
|
78 <sequence>
|
224
|
79 <element name="response" minOccurs="0">
|
|
80 <complexType>
|
|
81 <choice>
|
|
82 <element name="redirect" type="tns:RedirectResponse" />
|
|
83 <element name="transform" type="tns:Transformation"/>
|
|
84 </choice>
|
|
85 </complexType>
|
|
86 </element>
|
223
|
87 </sequence>
|
|
88 </extension>
|
|
89 </complexContent>
|
221
|
90 </complexType>
|
|
91
|
223
|
92 <complexType name="MethodBinding">
|
221
|
93 <sequence>
|
223
|
94 <element name="var" type="tns:BindingVariable" minOccurs="0"
|
221
|
95 maxOccurs="unbounded" />
|
|
96 </sequence>
|
223
|
97 <attribute name="expr" type="string" use="required" />
|
|
98 <attribute name="handler" type="string" />
|
221
|
99 </complexType>
|
|
100
|
223
|
101 <complexType name="BindingVariable">
|
224
|
102 <choice>
|
|
103 <element name="bind" type="tns:MethodBinding" />
|
|
104 <element name="transform" type="tns:Transformation" />
|
|
105 </choice>
|
|
106 <attribute name="name" type="tns:IdentifierName" use="required" />
|
221
|
107 </complexType>
|
|
108
|
|
109
|
224
|
110 <complexType name="Transformation">
|
|
111 <sequence>
|
|
112 <element name="target" type="tns:MethodBinding" minOccurs="0"/>
|
|
113 <element name="transform" type="tns:Transformation" minOccurs="0"/>
|
|
114 </sequence>
|
|
115 <attribute name="class" type="tns:ClassName" use="required" />
|
221
|
116 </complexType>
|
|
117
|
223
|
118 <complexType name="ResourceLocator">
|
224
|
119 <attribute name="locator" type="string" use="required" />
|
221
|
120 </complexType>
|
|
121
|
223
|
122 <simpleType name="RedirectCodes">
|
221
|
123 <restriction base="string">
|
|
124 <enumeration value="moved-permanently" />
|
|
125 <enumeration value="temporary-redirect" />
|
|
126 <enumeration value="see-other" />
|
|
127 </restriction>
|
|
128 </simpleType>
|
|
129
|
223
|
130 <complexType name="RedirectResponse">
|
221
|
131 <complexContent>
|
223
|
132 <extension base="tns:AbstractResult">
|
224
|
133 <sequence>
|
|
134 <element name="location" type="tns:ResourceLocator" />
|
223
|
135 <element name="status" type="tns:RedirectCodes" minOccurs="0" />
|
224
|
136 </sequence>
|
221
|
137 </extension>
|
|
138 </complexContent>
|
|
139 </complexType>
|
219
|
140
|
223
|
141 <simpleType name="ClassName">
|
|
142 <restriction base="string">
|
|
143 <pattern value="\w+(::\w+)*" />
|
|
144 </restriction>
|
|
145 </simpleType>
|
|
146
|
224
|
147 <simpleType name="IdentifierName">
|
|
148 <restriction base="string">
|
|
149 <pattern value="\w+" />
|
|
150 </restriction>
|
|
151 </simpleType>
|
|
152
|
218
|
153 </schema> |