Mercurial > pub > Impl
comparison _test/Resources/resources.xsd @ 223:edf011437be8
updated resources schema
author | sergey |
---|---|
date | Tue, 28 Aug 2012 17:29:42 +0400 |
parents | 84a6382b49c8 |
children | e6c050db7d98 |
comparison
equal
deleted
inserted
replaced
222:84a6382b49c8 | 223:edf011437be8 |
---|---|
3 elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" | 3 elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" |
4 xmlns:tns="http://implab.org/schemas/resources"> | 4 xmlns:tns="http://implab.org/schemas/resources"> |
5 <element name="resources"> | 5 <element name="resources"> |
6 <complexType> | 6 <complexType> |
7 <sequence> | 7 <sequence> |
8 <element name="root" type="tns:resourceContract" /> | 8 <element name="root" type="tns:ResourceContract" /> |
9 <element name="typeMap" minOccurs="0"> | 9 <element name="contracts" minOccurs="0"> |
10 <complexType> | 10 <complexType> |
11 <sequence> | 11 <sequence> |
12 <element name="contract" maxOccurs="unbounded"> | 12 <element name="contract" maxOccurs="unbounded"> |
13 <complexType> | 13 <complexType> |
14 <complexContent> | 14 <complexContent> |
15 <extension base="tns:resourceContract"> | 15 <extension base="tns:ResourceContract"> |
16 <sequence></sequence> | 16 <all> |
17 <attribute name="type" type="string" use="required"> | 17 <element name="modelType" type="tns:ClassName" /> |
18 </attribute> | 18 </all> |
19 <attribute name="id" type="string" /> | |
19 </extension> | 20 </extension> |
20 </complexContent> | 21 </complexContent> |
21 </complexType> | 22 </complexType> |
22 </element> | 23 </element> |
23 </sequence> | 24 </sequence> |
27 <complexType> | 28 <complexType> |
28 <sequence> | 29 <sequence> |
29 <element name="locator" maxOccurs="unbounded"> | 30 <element name="locator" maxOccurs="unbounded"> |
30 <complexType> | 31 <complexType> |
31 <complexContent> | 32 <complexContent> |
32 <extension base="tns:resourceLocator"> | 33 <extension base="tns:ResourceLocator"> |
33 <attribute name="name" type="string" /> | 34 <attribute name="name" type="string" /> |
34 </extension> | 35 </extension> |
35 </complexContent> | 36 </complexContent> |
36 </complexType> | 37 </complexType> |
37 </element> | 38 </element> |
49 <field xpath="@name" /> | 50 <field xpath="@name" /> |
50 </key> | 51 </key> |
51 </element> | 52 </element> |
52 | 53 |
53 <!-- abstract types --> | 54 <!-- abstract types --> |
54 <complexType name="abstractBinding" abstract="true" /> | 55 <complexType name="AbstractBinding" abstract="true" /> |
55 <complexType name="abstractTransformation" abstract="true" /> | 56 <complexType name="AbstractTransformation" abstract="true" /> |
56 <complexType name="abstractResult" abstract="true" /> | 57 <complexType name="AbstractResult" abstract="true" /> |
57 | 58 |
58 <complexType name="resourceContract"> | 59 <complexType name="ResourceContract"> |
59 <sequence> | 60 <sequence> |
60 <group ref="tns:restOperations"></group> | 61 <group ref="tns:RestOperations" /> |
61 <element name="resource" maxOccurs="unbounded" minOccurs="0"> | 62 <element name="resource" maxOccurs="unbounded" minOccurs="0" |
62 <complexType> | 63 type="tns:ChildResourceContract" /> |
63 <sequence> | |
64 <element name="contract" type="tns:resourceContract" /> | |
65 </sequence> | |
66 <attribute name="name" type="string" /> | |
67 </complexType> | |
68 </element> | |
69 </sequence> | 64 </sequence> |
70 </complexType> | 65 </complexType> |
71 | 66 |
72 <group name="restOperations"> | 67 <complexType name="ChildResourceContract"> |
73 <sequence> | 68 <sequence> |
74 <element name="get" type="tns:operationContract" minOccurs="0" /> | 69 <choice> |
75 <element name="post" type="tns:operationContract" minOccurs="0" /> | 70 <element name="name" type="string" /> |
76 <element name="put" type="tns:operationContract" minOccurs="0" /> | 71 <element name="match" type="string" /> |
77 <element name="delete" type="tns:operationContract" | 72 </choice> |
73 <element name="model" minOccurs="0" type="tns:MethodBinding" /> | |
74 <choice> | |
75 <element name="contract"> | |
76 <complexType> | |
77 <attribute name="ref" type="string" use="required" /> | |
78 </complexType> | |
79 </element> | |
80 <sequence> | |
81 <group ref="tns:RestOperations" /> | |
82 <element name="resource" type="tns:ChildResourceContract" | |
83 minOccurs="0" maxOccurs="unbounded" /> | |
84 </sequence> | |
85 </choice> | |
86 </sequence> | |
87 | |
88 </complexType> | |
89 | |
90 <group name="RestOperations"> | |
91 <sequence> | |
92 <element name="get" type="tns:OperationContract" minOccurs="0" /> | |
93 <element name="post" type="tns:OperationContract" minOccurs="0" /> | |
94 <element name="put" type="tns:OperationContract" minOccurs="0" /> | |
95 <element name="delete" type="tns:OperationContract" | |
78 minOccurs="0" /> | 96 minOccurs="0" /> |
79 </sequence> | 97 </sequence> |
80 </group> | 98 </group> |
81 | 99 |
82 <complexType name="operationContract"> | 100 <complexType name="OperationContract"> |
83 <sequence> | 101 <complexContent> |
84 <element name="bind" type="tns:methodBinding" /> | 102 <extension base="tns:MethodBinding"> |
85 <element name="parameters" type="tns:transformation" | 103 <sequence> |
86 minOccurs="0" /> | 104 <element name="response" type="tns:AbstractResult" |
87 <element name="response" type="tns:abstractResult" minOccurs="0" /> | 105 minOccurs="0" /> |
88 </sequence> | 106 </sequence> |
107 </extension> | |
108 </complexContent> | |
89 </complexType> | 109 </complexType> |
90 | 110 |
91 <complexType name="methodBinding"> | 111 <complexType name="MethodBinding"> |
92 <sequence> | 112 <sequence> |
93 <element name="var" type="tns:bindingVariable" minOccurs="0" | 113 <element name="var" type="tns:BindingVariable" minOccurs="0" |
94 maxOccurs="unbounded" /> | 114 maxOccurs="unbounded" /> |
95 </sequence> | 115 </sequence> |
96 <attribute name="bind" type="string" use="required" /> | 116 <attribute name="expr" type="string" use="required" /> |
117 <attribute name="handler" type="string" /> | |
97 </complexType> | 118 </complexType> |
98 | 119 |
99 <complexType name="bindingVariable"> | 120 <complexType name="BindingVariable"> |
100 <complexContent> | 121 <complexContent> |
101 <extension base="tns:methodBinding"> | 122 <extension base="tns:MethodBinding"> |
102 <attribute name="name" type="string" /> | 123 <attribute name="name" type="string" /> |
103 </extension> | 124 </extension> |
104 </complexContent> | 125 </complexContent> |
105 </complexType> | 126 </complexType> |
106 | 127 |
107 | 128 |
108 <complexType name="transformation"> | 129 <complexType name="transformation"> |
109 <attribute name="class" type="string" /> | 130 <attribute name="class" type="string" /> |
110 </complexType> | 131 </complexType> |
111 | 132 |
112 <complexType name="resourceLocator"> | 133 <complexType name="ResourceLocator"> |
113 <sequence> | 134 <sequence> |
114 <element name="var" type="tns:bindingVariable" minOccurs="0" | 135 <element name="var" type="tns:BindingVariable" minOccurs="0" |
115 maxOccurs="unbounded" /> | 136 maxOccurs="unbounded" /> |
116 <element name="template" type="string" /> | 137 <element name="template" type="string" /> |
117 </sequence> | 138 </sequence> |
118 </complexType> | 139 </complexType> |
119 | 140 |
120 <simpleType name="redirectCodes"> | 141 <simpleType name="RedirectCodes"> |
121 <restriction base="string"> | 142 <restriction base="string"> |
122 <enumeration value="moved-permanently" /> | 143 <enumeration value="moved-permanently" /> |
123 <enumeration value="temporary-redirect" /> | 144 <enumeration value="temporary-redirect" /> |
124 <enumeration value="see-other" /> | 145 <enumeration value="see-other" /> |
125 </restriction> | 146 </restriction> |
126 </simpleType> | 147 </simpleType> |
127 | 148 |
128 <complexType name="redirectResponse"> | 149 <complexType name="RedirectResponse"> |
129 <complexContent> | 150 <complexContent> |
130 <extension base="tns:abstractResult"> | 151 <extension base="tns:AbstractResult"> |
131 <choice> | 152 <choice> |
132 <element name="locator" type="tns:resourceLocator" /> | 153 <element name="locator" type="tns:ResourceLocator" /> |
133 <element name="locatorRef"> | 154 <element name="locatorRef"> |
134 <complexType> | 155 <complexType> |
135 <attribute name="ref" type="string" /> | 156 <attribute name="ref" type="string" /> |
136 </complexType> | 157 </complexType> |
137 </element> | 158 </element> |
138 <element name="status" type="tns:redirectCodes" minOccurs="0" /> | 159 <element name="status" type="tns:RedirectCodes" minOccurs="0" /> |
139 </choice> | 160 </choice> |
140 </extension> | 161 </extension> |
141 </complexContent> | 162 </complexContent> |
142 </complexType> | 163 </complexType> |
143 | 164 |
165 <simpleType name="ClassName"> | |
166 <restriction base="string"> | |
167 <pattern value="\w+(::\w+)*" /> | |
168 </restriction> | |
169 </simpleType> | |
170 | |
144 </schema> | 171 </schema> |