Manifest schema

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
3
           targetNamespace="http://www.cid-protocol/schema/v1/core" xmlns:cid="http://www.cid-protocol/schema/v1/core">
4
    <xs:import schemaLocation="http://www.w3.org/2001/xml.xsd" namespace="http://www.w3.org/XML/1998/namespace"/>
5
6
    <xs:element name="manifest">
7
        <xs:complexType>
8
            <xs:sequence>
9
                <!-- Human oriented documentation -->
10
                <xs:element name="label" minOccurs="0" maxOccurs="unbounded" type="cid:localized-element"/>
11
                <xs:element name="doc" minOccurs="0" maxOccurs="unbounded" type="cid:localized-element"/>
12
13
                <!-- list of processes -->
14
                <xs:element name="process" maxOccurs="unbounded">
15
                    <xs:complexType>
16
                        <xs:sequence>
17
                            <!-- Human oriented process documentation -->
18
                            <xs:element name="label" minOccurs="0" maxOccurs="unbounded" type="cid:localized-element"/>
19
                            <xs:element name="doc" minOccurs="0" maxOccurs="unbounded" type="cid:localized-element"/>
20
                            <!-- Meta and restriction declarationwebAsyncUpload -->
21
                            <xs:element name="restriction" minOccurs="0" maxOccurs="unbounded" type="cid:restriction-element"/>
22
                            <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="cid:meta-element"/>
23
                            <!-- Steps declaration -->
24
                            <xs:choice maxOccurs="unbounded">
25
                                <xs:element name="exchange" type="cid:asyncStep-element"/>
26
                                <xs:element name="upload" type="cid:asyncStep-element"/>
27
                                <xs:element name="interact" type="cid:regularStep-element"/>
28
                            </xs:choice>
29
                        </xs:sequence>
30
31
                        <!-- Bind a this process to a specific transport -->
32
                        <xs:attribute name="transports" type="cid:NCName-list"/>
33
                        <!-- Computer oriented process description -->
34
                        <xs:attribute name="is" type="cid:uri-list"/>
35
                    </xs:complexType>
36
                </xs:element>
37
38
                <!-- List of defined transports -->
39
                <xs:element name="transports">
40
                    <xs:complexType>
41
                        <xs:choice maxOccurs="unbounded">
42
                            <!-- Web transport declaration -->
43
                            <xs:element name="webTransport">
44
                                <xs:complexType>
45
                                    <xs:all>
46
                                        <!-- First transport declaration step : supported authentication -->
47
                                        <xs:element name="authentications">
48
                                            <xs:complexType>
49
                                                <!-- An empty authentications element means "no authentication needed" -->
50
                                                <xs:choice minOccurs="0" maxOccurs="unbounded">
51
                                                    <xs:element name="noAuthentication">
52
                                                        <xs:complexType/>
53
                                                    </xs:element>
54
                                                    <xs:element name="basicHttp">
55
                                                        <xs:complexType/>
56
                                                    </xs:element>
57
                                                    <!-- Must be operated as a web interact -->
58
                                                    <xs:element name="webAuthentication">
59
                                                        <xs:complexType>
60
                                                            <xs:attribute name="url" type="xs:anyURI"/>
61
                                                        </xs:complexType>
62
                                                    </xs:element>
63
                                                </xs:choice>
64
                                            </xs:complexType>
65
                                        </xs:element>
66
67
                                        <!-- List of step transport declaration -->
68
                                        <xs:element name="webExchange" minOccurs="0">
69
                                            <xs:complexType>
70
                                                <xs:sequence>
71
                                                    <xs:element name="request" type="cid:regularRequest" maxOccurs="unbounded"/>
72
                                                </xs:sequence>
73
                                            </xs:complexType>
74
                                        </xs:element>
75
                                        <xs:element name="webInteract" minOccurs="0">
76
                                            <xs:complexType>
77
                                                <xs:sequence>
78
                                                    <xs:element name="request" type="cid:regularRequest" maxOccurs="unbounded"/>
79
                                                </xs:sequence>
80
                                            </xs:complexType>
81
                                        </xs:element>
82
                                        <xs:element name="webUpload" minOccurs="0">
83
                                            <xs:complexType>
84
                                                <xs:sequence>
85
                                                    <xs:element name="request" type="cid:uploadRequest" maxOccurs="unbounded"/>
86
                                                </xs:sequence>
87
                                            </xs:complexType>
88
                                        </xs:element>
89
                                    </xs:all>
90
91
                                    <!--  Id needed to bind a process to a specific transport -->
92
                                    <xs:attribute name="id" type="xs:NCName"/>
93
                                    <!--  True if the server use a cookies -->
94
                                    <xs:attribute name="needCookies" type="xs:boolean"/>
95
                                    <!--
96
                                        Names of session properties. A session properties must be neutrally handled
97
                                         (returned by the client if sent by the server
98
                                    -->
99
                                    <xs:attribute name="sessionProperties" type="cid:NCName-list"/>
100
                                </xs:complexType>
101
                            </xs:element>
102
                            <xs:any namespace="##other"/>
103
                        </xs:choice>
104
                    </xs:complexType>
105
                </xs:element>
106
            </xs:sequence>
107
        </xs:complexType>
108
    </xs:element>
109
110
 <!-- *****************************************************************
111
             SIMPLE TYPE LIBRARY
112
 ***************************************************************** -->
113
114
    <!-- List of uris (is attribute) -->
115
    <xs:simpleType name="uri-list">
116
        <xs:restriction>
117
            <xs:simpleType>
118
                <xs:list itemType="xs:anyURI"/>
119
            </xs:simpleType>
120
            <xs:minLength value="1"/>
121
        </xs:restriction>
122
    </xs:simpleType>
123
124
    <!-- List of properties name (sessionProperties attribute) -->
125
    <xs:simpleType name="NCName-list">
126
        <xs:restriction>
127
            <xs:simpleType>
128
                <xs:list itemType="xs:NCName"/>
129
            </xs:simpleType>
130
            <xs:minLength value="1"/>
131
        </xs:restriction>
132
    </xs:simpleType>
133
134
    <!-- request method token definition (get or post) -->
135
    <xs:simpleType name="getPost-token">
136
        <xs:restriction base="xs:token">
137
            <xs:enumeration value="GET"/>
138
            <xs:enumeration value="POST;application/x-www-form-urlencoded"/>
139
            <xs:enumeration value="POST;multipart/form-data"/>
140
        </xs:restriction>
141
    </xs:simpleType>
142
143
    <!-- request method token definition (get, put or post) -->
144
    <xs:simpleType name="getPutPost-token">
145
        <xs:restriction base="xs:token">
146
            <xs:enumeration value="GET"/>
147
            <xs:enumeration value="PUT"/>
148
            <xs:enumeration value="POST"/>
149
            <xs:enumeration value="POST;multipart/form-data"/>
150
        </xs:restriction>
151
    </xs:simpleType>
152
153
    <!-- list of properties storage method (header, querystring or post) -->
154
    <xs:simpleType name="postProp-list">
155
        <xs:restriction>
156
            <xs:simpleType>
157
                <xs:list>
158
                    <xs:simpleType>
159
                        <xs:restriction base="xs:token">
160
                            <xs:enumeration value="header"/>
161
                            <xs:enumeration value="queryString"/>
162
                            <xs:enumeration value="post"/>
163
                        </xs:restriction>
164
                    </xs:simpleType>
165
                </xs:list>
166
            </xs:simpleType>
167
            <xs:minLength value="1"/>
168
        </xs:restriction>
169
    </xs:simpleType>
170
171
    <!-- *****************************************************************
172
             COMPLEXE TYPE LIBRARY  
173
  ***************************************************************** -->    
174
    
175
    <!-- localized informations (used to write human oriented doc) -->
176
    <xs:complexType name="localized-element" mixed="true">
177
        <xs:attribute ref="xml:lang"/>
178
    </xs:complexType>
179
180
    <!-- restriction element -->
181
    <xs:complexType name="restriction-element">
182
        <xs:sequence>
183
            <xs:element name="label" minOccurs="0" maxOccurs="unbounded" type="cid:localized-element"/>
184
            <xs:element name="doc" minOccurs="0" maxOccurs="unbounded" type="cid:localized-element"/>
185
        </xs:sequence>
186
        <xs:attribute name="name" use="required" type="xs:NCName"/>
187
        <xs:attribute name="is" type="cid:uri-list"/>
188
        <xs:attribute name="value" use="required" type="xs:string"/>
189
    </xs:complexType>
190
    
191
    <!-- meta element -->
192
    <xs:complexType name="meta-element">
193
        <xs:sequence>
194
            <xs:element name="label" minOccurs="0" maxOccurs="unbounded" type="cid:localized-element"/>
195
            <xs:element name="doc" minOccurs="0" maxOccurs="unbounded" type="cid:localized-element"/>
196
            <xs:element name="value" minOccurs="0" maxOccurs="unbounded">
197
                <xs:complexType mixed="true"/>
198
            </xs:element>
199
        </xs:sequence>
200
        <xs:attribute name="name" use="required" type="xs:NCName"/>
201
        <xs:attribute name="is" type="cid:uri-list"/>
202
    </xs:complexType> 
203
    
204
    <!-- common step attribute -->
205
    <xs:complexType name="step-commons">
206
        <xs:attribute name="url" use="required" type="xs:anyURI"/>
207
        <xs:attribute name="needMetas" type="cid:NCName-list"/>
208
        <xs:attribute name="useMetas" type="cid:NCName-list"/>
209
        <xs:attribute name="returnMetas" type="cid:NCName-list"/>
210
    </xs:complexType> 
211
    
212
    <!-- Step element (used by interact and asyncStep) -->
213
    <xs:complexType name="regularStep-element">
214
        <xs:complexContent>
215
            <xs:extension base="cid:step-commons">
216
                <xs:attribute name="is" type="cid:uri-list"/>
217
                <xs:attribute name="required" type="xs:boolean"/>
218
            </xs:extension>
219
        </xs:complexContent>
220
    </xs:complexType>
221
    
222
    <!-- Step element (used by upload and exchange) -->
223
    <xs:complexType name="asyncStep-element">
224
        <xs:complexContent>
225
            <xs:extension base="cid:regularStep-element">
226
                <xs:all>
227
                    <xs:element name="systemWait" minOccurs="0">
228
                        <xs:complexType>
229
                            <xs:complexContent>
230
                                <xs:extension base="cid:step-commons">
231
                                    <xs:attribute name="waitProperties" type="cid:NCName-list"/>
232
                                </xs:extension>
233
                            </xs:complexContent>
234
                        </xs:complexType>
235
                    </xs:element>
236
                    <xs:element name="userWait" minOccurs="0" type="cid:step-commons"/>
237
                </xs:all>
238
            </xs:extension>
239
        </xs:complexContent>
240
    </xs:complexType>
241
242
    <!-- Definition of a regular request (exchange/interact) -->
243
    <xs:complexType name="regularRequest">
244
        <xs:attribute name="method" use="required" type="cid:getPost-token"/>
245
        <xs:attribute name="properties" use="required" type="cid:postProp-list"/>
246
    </xs:complexType>
247
    
248
    <!-- Definition of a request which contains -->
249
    <xs:complexType name="uploadRequest">
250
        <xs:attribute name="method" use="required" type="cid:getPutPost-token"/>
251
        <xs:attribute name="properties" use="required" type="cid:postProp-list"/>
252
    </xs:complexType>
253
    
254
    <!-- Definition of a transport property -->
255
    <xs:complexType name="property">
256
        <xs:attribute name="key" use="required" type="xs:NCName"/>
257
        <xs:attribute name="value" use="required" type="xs:NCName"/>
258
    </xs:complexType>
259
</xs:schema>