1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <module version="2.0"> |
---|
3 | <meta> |
---|
4 | <identity> |
---|
5 | <uri>urn:org:isocat:schemacat:interface:rest</uri> |
---|
6 | <version>1.0.0</version> |
---|
7 | </identity> |
---|
8 | <info> |
---|
9 | <name>SCHEMAcat - interface - REST</name> |
---|
10 | <description>REST interface for SCHEMAcat</description> |
---|
11 | <icon>res:/schemacat/pub/icon.png</icon> |
---|
12 | </info> |
---|
13 | </meta> |
---|
14 | <system> |
---|
15 | <dynamic/> |
---|
16 | </system> |
---|
17 | <rootspace name="SCHEMAcat - interface - REST - Development Space" |
---|
18 | uri="urn:org:isocat:schemacat:interface:rest"> |
---|
19 | <fileset> |
---|
20 | <regex>res:/etc/system/SimpleDynamicImportHook.xml</regex> |
---|
21 | </fileset> |
---|
22 | <overlay> |
---|
23 | <!-- this scratch pad is used to store the user info --> |
---|
24 | <prototype>ScratchPad</prototype> |
---|
25 | <space> |
---|
26 | <pluggable-overlay> |
---|
27 | <preProcess> |
---|
28 | <identifier>active:javascript</identifier> |
---|
29 | <argument name="operator">res:/interface/checkUser.js</argument> |
---|
30 | <argument name="operand">arg:request</argument> |
---|
31 | </preProcess> |
---|
32 | <space> |
---|
33 | <fileset> |
---|
34 | <regex>res:/debug/.*</regex> |
---|
35 | <mutable/> |
---|
36 | </fileset> |
---|
37 | <fileset> |
---|
38 | <regex>res:/interface/.*</regex> |
---|
39 | </fileset> |
---|
40 | <import> |
---|
41 | <uri>urn:org:isocat:schemacat:interface:rest:overlay</uri> |
---|
42 | </import> |
---|
43 | <import> |
---|
44 | <uri>urn:org:netkernel:lang:javascript</uri> |
---|
45 | </import> |
---|
46 | <import> |
---|
47 | <uri>urn:org:netkernel:web:core</uri> |
---|
48 | </import> |
---|
49 | </space> |
---|
50 | </pluggable-overlay> |
---|
51 | </space> |
---|
52 | </overlay> |
---|
53 | <overlay> |
---|
54 | <!-- serve webapp files directly with this overlay --> |
---|
55 | <prototype>RESTOverlay</prototype> |
---|
56 | <config> |
---|
57 | <basepath>/schemacat</basepath> |
---|
58 | </config> |
---|
59 | <space> |
---|
60 | <mapper> |
---|
61 | <config> |
---|
62 | <endpoint> |
---|
63 | <meta> |
---|
64 | <rest> |
---|
65 | <simple>/site/{file}</simple> |
---|
66 | <compress/> |
---|
67 | <Etag>MD5</Etag> |
---|
68 | </rest> |
---|
69 | </meta> |
---|
70 | <grammar>res:/schemacat/<group name="file"><regex type="anything"/></group></grammar> |
---|
71 | <request> |
---|
72 | <identifier>res:/schemacat/site/[[arg:file]]</identifier> |
---|
73 | </request> |
---|
74 | </endpoint> |
---|
75 | </config> |
---|
76 | <space> |
---|
77 | <import> |
---|
78 | <uri>urn:org:isocat:schemacat:site</uri> |
---|
79 | </import> |
---|
80 | </space> |
---|
81 | </mapper> |
---|
82 | </space> |
---|
83 | </overlay> |
---|
84 | <fileset> |
---|
85 | <!--Icon--> |
---|
86 | <regex>res:/pub/(.*)</regex> |
---|
87 | <rewrite>res:/pub/$1</rewrite> |
---|
88 | </fileset> |
---|
89 | <import> |
---|
90 | <private/> |
---|
91 | <uri>urn:org:netkernel:tpt:http</uri> |
---|
92 | </import> |
---|
93 | <import> |
---|
94 | <private/> |
---|
95 | <uri>urn:org:netkernel:ext:layer1</uri> |
---|
96 | </import> |
---|
97 | </rootspace> |
---|
98 | <rootspace name="SCHEMAcat - interface - REST Overlay - Space" public="true" |
---|
99 | uri="urn:org:isocat:schemacat:interface:rest:overlay"> |
---|
100 | <overlay> |
---|
101 | <!-- all endpoints firs run findUser to store the user info in the scratch pad --> |
---|
102 | <prototype>RESTOverlay</prototype> |
---|
103 | <config> |
---|
104 | <basepath>/schemacat</basepath> |
---|
105 | </config> |
---|
106 | <space> |
---|
107 | <mapper> |
---|
108 | <config> |
---|
109 | <endpoint> |
---|
110 | <meta> |
---|
111 | <rest> |
---|
112 | <method>POST</method> |
---|
113 | <simple>/users/{userID:([^/]+)}{slash:(/|)}</simple> |
---|
114 | <compress/> |
---|
115 | <Etag>MD5</Etag> |
---|
116 | <consumes>application/json</consumes> |
---|
117 | <produces>application/json</produces> |
---|
118 | </rest> |
---|
119 | </meta> |
---|
120 | <grammar> |
---|
121 | <active> |
---|
122 | <identifier>active:org.schemacat.rest.post.user.json</identifier> |
---|
123 | <argument name="userID" min="1" max="1"/> |
---|
124 | <argument name="slash"/> |
---|
125 | </active> |
---|
126 | </grammar> |
---|
127 | <request> |
---|
128 | <identifier>active:JSONFromXML</identifier> |
---|
129 | <argument name="operand"> |
---|
130 | <request> |
---|
131 | <identifier>active:sloot.dpml</identifier> |
---|
132 | <argument name="operator">res:/interface/postUser.dpml</argument> |
---|
133 | <argument name="userID" method="as-string">arg:userID</argument> |
---|
134 | </request> |
---|
135 | </argument> |
---|
136 | </request> |
---|
137 | <header name="mime">application/json</header> |
---|
138 | </endpoint> |
---|
139 | <endpoint> |
---|
140 | <meta> |
---|
141 | <rest> |
---|
142 | <method>POST</method> |
---|
143 | <simple>/schemas/{schemaID:([^/]+)}/access{slash:(/|)}</simple> |
---|
144 | <compress/> |
---|
145 | <Etag>MD5</Etag> |
---|
146 | <consumes>application/json</consumes> |
---|
147 | <produces>application/json</produces> |
---|
148 | </rest> |
---|
149 | </meta> |
---|
150 | <grammar> |
---|
151 | <active> |
---|
152 | <identifier>active:org.schemacat.rest.schema.access</identifier> |
---|
153 | <argument name="schemaID"/> |
---|
154 | <argument name="slash"/> |
---|
155 | </active> |
---|
156 | </grammar> |
---|
157 | <request> |
---|
158 | <identifier>active:JSONFromXML</identifier> |
---|
159 | <argument name="operand"> |
---|
160 | <request> |
---|
161 | <identifier>active:sloot.dpml</identifier> |
---|
162 | <argument name="operator">res:/interface/postSchemaAccess.dpml</argument> |
---|
163 | <argument method="as-string" name="schemaID">arg:schemaID</argument> |
---|
164 | </request> |
---|
165 | </argument> |
---|
166 | </request> |
---|
167 | <header name="mime">application/json</header> |
---|
168 | </endpoint> |
---|
169 | <endpoint> |
---|
170 | <meta> |
---|
171 | <rest> |
---|
172 | <method>GET</method> |
---|
173 | <simple>/users/{userID:([^/]+)}{slash:(/|)}</simple> |
---|
174 | <compress/> |
---|
175 | <Etag>MD5</Etag> |
---|
176 | <produces>application/json</produces> |
---|
177 | </rest> |
---|
178 | </meta> |
---|
179 | <grammar> |
---|
180 | <active> |
---|
181 | <identifier>active:org.schemacat.rest.get.user.json</identifier> |
---|
182 | <argument name="userID" min="1" max="1"/> |
---|
183 | <argument name="slash"/> |
---|
184 | </active> |
---|
185 | </grammar> |
---|
186 | <request> |
---|
187 | <identifier>active:JSONFromXML</identifier> |
---|
188 | <argument name="operand"> |
---|
189 | <request> |
---|
190 | <identifier>active:sloot.dpml</identifier> |
---|
191 | <argument name="operator">res:/interface/getUser.dpml</argument> |
---|
192 | <argument name="userID" method="as-string">arg:userID</argument> |
---|
193 | </request> |
---|
194 | </argument> |
---|
195 | </request> |
---|
196 | <header name="mime">application/json</header> |
---|
197 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
198 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
199 | </endpoint> |
---|
200 | <endpoint> |
---|
201 | <meta> |
---|
202 | <rest> |
---|
203 | <method>GET</method> |
---|
204 | <simple>/users/{userID:([^/]+)}{slash:(/|)}</simple> |
---|
205 | <compress/> |
---|
206 | <Etag>MD5</Etag> |
---|
207 | <produces>application/xml</produces> |
---|
208 | </rest> |
---|
209 | </meta> |
---|
210 | <grammar> |
---|
211 | <active> |
---|
212 | <identifier>active:org.schemacat.rest.get.user.xml</identifier> |
---|
213 | <argument name="userID" min="1" max="1"/> |
---|
214 | <argument name="slash"/> |
---|
215 | </active> |
---|
216 | </grammar> |
---|
217 | <request> |
---|
218 | <identifier>active:sloot.dpml</identifier> |
---|
219 | <argument name="operator">res:/interface/getUser.dpml</argument> |
---|
220 | <argument name="userID" method="as-string">arg:userID</argument> |
---|
221 | </request> |
---|
222 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
223 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
224 | </endpoint> |
---|
225 | <endpoint> |
---|
226 | <meta> |
---|
227 | <rest> |
---|
228 | <method>GET</method> |
---|
229 | <simple>/users{slash:(/|)}</simple> |
---|
230 | <compress/> |
---|
231 | <Etag>MD5</Etag> |
---|
232 | <produces>application/json</produces> |
---|
233 | </rest> |
---|
234 | </meta> |
---|
235 | <grammar> |
---|
236 | <active> |
---|
237 | <identifier>active:org.schemacat.rest.users.json</identifier> |
---|
238 | <argument name="slash"/> |
---|
239 | </active> |
---|
240 | </grammar> |
---|
241 | <request> |
---|
242 | <identifier>active:JSONFromXML</identifier> |
---|
243 | <argument name="operand"> |
---|
244 | <request> |
---|
245 | <identifier>active:sloot.dpml</identifier> |
---|
246 | <argument name="operator">res:/interface/users.dpml</argument> |
---|
247 | </request> |
---|
248 | </argument> |
---|
249 | </request> |
---|
250 | <header name="mime">application/json</header> |
---|
251 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
252 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
253 | </endpoint> |
---|
254 | <endpoint> |
---|
255 | <meta> |
---|
256 | <rest> |
---|
257 | <method>GET</method> |
---|
258 | <simple>/users{slash:(/|)}</simple> |
---|
259 | <compress/> |
---|
260 | <Etag>MD5</Etag> |
---|
261 | <produces>application/xml</produces> |
---|
262 | </rest> |
---|
263 | </meta> |
---|
264 | <grammar> |
---|
265 | <active> |
---|
266 | <identifier>active:org.schemacat.rest.users.xml</identifier> |
---|
267 | <argument name="slash"/> |
---|
268 | </active> |
---|
269 | </grammar> |
---|
270 | <request> |
---|
271 | <identifier>active:sloot.dpml</identifier> |
---|
272 | <argument name="operator">res:/interface/users.dpml</argument> |
---|
273 | </request> |
---|
274 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
275 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
276 | </endpoint> |
---|
277 | <endpoint> |
---|
278 | <meta> |
---|
279 | <rest> |
---|
280 | <method>GET</method> |
---|
281 | <simple>/users/{userID}/schemas{slash:(/|)}</simple> |
---|
282 | <compress/> |
---|
283 | <Etag>MD5</Etag> |
---|
284 | <produces>application/json</produces> |
---|
285 | </rest> |
---|
286 | </meta> |
---|
287 | <grammar> |
---|
288 | <active> |
---|
289 | <identifier>active:org.schemacat.rest.user.schemas.json</identifier> |
---|
290 | <argument name="userID" min="1" max="1"/> |
---|
291 | <argument name="slash"/> |
---|
292 | </active> |
---|
293 | </grammar> |
---|
294 | <request> |
---|
295 | <identifier>active:JSONFromXML</identifier> |
---|
296 | <argument name="operand"> |
---|
297 | <request> |
---|
298 | <identifier>active:sloot.dpml</identifier> |
---|
299 | <argument name="operator">res:/interface/userSchemas.dpml</argument> |
---|
300 | <argument method="as-string" name="userID">arg:userID</argument> |
---|
301 | </request> |
---|
302 | </argument> |
---|
303 | </request> |
---|
304 | <header name="mime">application/json</header> |
---|
305 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
306 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
307 | </endpoint> |
---|
308 | <endpoint> |
---|
309 | <meta> |
---|
310 | <rest> |
---|
311 | <method>GET</method> |
---|
312 | <simple>/users/{userID}/schemas{slash:(/|)}</simple> |
---|
313 | <compress/> |
---|
314 | <Etag>MD5</Etag> |
---|
315 | <produces>application/xml</produces> |
---|
316 | </rest> |
---|
317 | </meta> |
---|
318 | <grammar> |
---|
319 | <active> |
---|
320 | <identifier>active:org.schemacat.rest.user.schemas.xml</identifier> |
---|
321 | <argument name="userID" min="1" max="1"/> |
---|
322 | <argument name="slash"/> |
---|
323 | </active> |
---|
324 | </grammar> |
---|
325 | <request> |
---|
326 | <identifier>active:sloot.dpml</identifier> |
---|
327 | <argument name="operator">res:/interface/userSchemas.dpml</argument> |
---|
328 | <argument method="as-string" name="userID">arg:userID</argument> |
---|
329 | </request> |
---|
330 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
331 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
332 | </endpoint> |
---|
333 | <endpoint> |
---|
334 | <meta> |
---|
335 | <rest> |
---|
336 | <method>GET</method> |
---|
337 | <simple>/users/{userID}/schemas/pagedlist/page/{startPage:([1-9][0-9]*)}/pagesize/{pageSize:([1-9][0-9]*)}{slash:(/|)}</simple> |
---|
338 | <compress/> |
---|
339 | <Etag>MD5</Etag> |
---|
340 | <produces>application/json</produces> |
---|
341 | </rest> |
---|
342 | </meta> |
---|
343 | <grammar> |
---|
344 | <active> |
---|
345 | <identifier>active:org.schemacat.rest.user.schemas.paged.json</identifier> |
---|
346 | <argument name="userID" min="1" max="1"/> |
---|
347 | <argument name="startPage" min="1" max="1"/> |
---|
348 | <argument name="pageSize" min="1" max="1"/> |
---|
349 | <argument name="slash"/> |
---|
350 | </active> |
---|
351 | </grammar> |
---|
352 | <request> |
---|
353 | <identifier>active:JSONFromXML</identifier> |
---|
354 | <argument name="operand"> |
---|
355 | <request> |
---|
356 | <identifier>active:sloot.dpml</identifier> |
---|
357 | <argument name="operator">res:/interface/pagedUserSchemas.dpml</argument> |
---|
358 | <argument method="as-string" name="userID">arg:userID</argument> |
---|
359 | <argument method="as-string" name="startPage">arg:startPage</argument> |
---|
360 | <argument method="as-string" name="pageSize">arg:pageSize</argument> |
---|
361 | </request> |
---|
362 | </argument> |
---|
363 | </request> |
---|
364 | <header name="mime">application/json</header> |
---|
365 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
366 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
367 | </endpoint> |
---|
368 | <endpoint> |
---|
369 | <meta> |
---|
370 | <rest> |
---|
371 | <method>GET</method> |
---|
372 | <simple>/users/{userID}/schemas/pagedlist/page/{startPage:([1-9][0-9]*)}/pagesize/{pageSize:([1-9][0-9]*)}{slash:(/|)}</simple> |
---|
373 | <compress/> |
---|
374 | <Etag>MD5</Etag> |
---|
375 | <produces>application/xml</produces> |
---|
376 | </rest> |
---|
377 | </meta> |
---|
378 | <grammar> |
---|
379 | <active> |
---|
380 | <identifier>active:org.schemacat.rest.user.schemas.paged.xml</identifier> |
---|
381 | <argument name="userID" min="1" max="1"/> |
---|
382 | <argument name="startPage" min="1" max="1"/> |
---|
383 | <argument name="pageSize" min="1" max="1"/> |
---|
384 | <argument name="slash"/> |
---|
385 | </active> |
---|
386 | </grammar> |
---|
387 | <request> |
---|
388 | <identifier>active:sloot.dpml</identifier> |
---|
389 | <argument name="operator">res:/interface/pagedUserSchemas.dpml</argument> |
---|
390 | <argument method="as-string" name="userID">arg:userID</argument> |
---|
391 | <argument method="as-string" name="startPage">arg:startPage</argument> |
---|
392 | <argument method="as-string" name="pageSize">arg:pageSize</argument> |
---|
393 | </request> |
---|
394 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
395 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
396 | </endpoint> |
---|
397 | <endpoint> |
---|
398 | <meta> |
---|
399 | <rest> |
---|
400 | <method>GET</method> |
---|
401 | <simple>/schemas{slash:(/|)}</simple> |
---|
402 | <compress/> |
---|
403 | <Etag>MD5</Etag> |
---|
404 | <produces>application/json</produces> |
---|
405 | </rest> |
---|
406 | </meta> |
---|
407 | <grammar> |
---|
408 | <active> |
---|
409 | <identifier>active:org.schemacat.rest.schemas.json</identifier> |
---|
410 | <argument name="slash"/> |
---|
411 | </active> |
---|
412 | </grammar> |
---|
413 | <request> |
---|
414 | <identifier>active:JSONFromXML</identifier> |
---|
415 | <argument name="operand"> |
---|
416 | <request> |
---|
417 | <identifier>active:sloot.dpml</identifier> |
---|
418 | <argument name="operator">res:/interface/schemas.dpml</argument> |
---|
419 | </request> |
---|
420 | </argument> |
---|
421 | </request> |
---|
422 | <header name="mime">application/json</header> |
---|
423 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
424 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
425 | </endpoint> |
---|
426 | <endpoint> |
---|
427 | <meta> |
---|
428 | <rest> |
---|
429 | <method>GET</method> |
---|
430 | <simple>/schemas{slash:(/|)}</simple> |
---|
431 | <compress/> |
---|
432 | <Etag>MD5</Etag> |
---|
433 | <produces>application/xml</produces> |
---|
434 | </rest> |
---|
435 | </meta> |
---|
436 | <grammar> |
---|
437 | <active> |
---|
438 | <identifier>active:org.schemacat.rest.schemas.xml</identifier> |
---|
439 | <argument name="slash"/> |
---|
440 | </active> |
---|
441 | </grammar> |
---|
442 | <request> |
---|
443 | <identifier>active:sloot.dpml</identifier> |
---|
444 | <argument name="operator">res:/interface/schemas.dpml</argument> |
---|
445 | </request> |
---|
446 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
447 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
448 | </endpoint> |
---|
449 | <endpoint> |
---|
450 | <meta> |
---|
451 | <rest> |
---|
452 | <method>GET</method> |
---|
453 | <simple>/schemas/pagedlist/page/{startPage:([1-9][0-9]*)}/pagesize/{pageSize:([1-9][0-9]*)}{slash:(/|)}</simple> |
---|
454 | <compress/> |
---|
455 | <Etag>MD5</Etag> |
---|
456 | <produces>application/json</produces> |
---|
457 | </rest> |
---|
458 | </meta> |
---|
459 | <grammar> |
---|
460 | <active> |
---|
461 | <identifier>active:org.schemacat.rest.schemas.paged.json</identifier> |
---|
462 | <argument name="startPage" min="1" max="1"/> |
---|
463 | <argument name="pageSize" min="1" max="1"/> |
---|
464 | <argument name="slash"/> |
---|
465 | </active> |
---|
466 | </grammar> |
---|
467 | <request> |
---|
468 | <identifier>active:JSONFromXML</identifier> |
---|
469 | <argument name="operand"> |
---|
470 | <request> |
---|
471 | <identifier>active:sloot.dpml</identifier> |
---|
472 | <argument name="operator">res:/interface/pagedSchemas.dpml</argument> |
---|
473 | <argument method="as-string" name="startPage">arg:startPage</argument> |
---|
474 | <argument method="as-string" name="pageSize">arg:pageSize</argument> |
---|
475 | </request> |
---|
476 | </argument> |
---|
477 | </request> |
---|
478 | <header name="mime">application/json</header> |
---|
479 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
480 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
481 | </endpoint> |
---|
482 | <endpoint> |
---|
483 | <meta> |
---|
484 | <rest> |
---|
485 | <method>GET</method> |
---|
486 | <simple>/schemas/pagedlist/page/{startPage:([1-9][0-9]*)}/pagesize/{pageSize:([1-9][0-9]*)}{slash:(/|)}</simple> |
---|
487 | <compress/> |
---|
488 | <Etag>MD5</Etag> |
---|
489 | <produces>application/xml</produces> |
---|
490 | </rest> |
---|
491 | </meta> |
---|
492 | <grammar> |
---|
493 | <active> |
---|
494 | <identifier>active:org.schemacat.rest.schemas.paged.xml</identifier> |
---|
495 | <argument name="startPage" min="1" max="1"/> |
---|
496 | <argument name="pageSize" min="1" max="1"/> |
---|
497 | <argument name="slash"/> |
---|
498 | </active> |
---|
499 | </grammar> |
---|
500 | <request> |
---|
501 | <identifier>active:sloot.dpml</identifier> |
---|
502 | <argument name="operator">res:/interface/pagedSchemas.dpml</argument> |
---|
503 | <argument method="as-string" name="startPage">arg:startPage</argument> |
---|
504 | <argument method="as-string" name="pageSize">arg:pageSize</argument> |
---|
505 | </request> |
---|
506 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate</header> |
---|
507 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
508 | </endpoint> |
---|
509 | <endpoint> |
---|
510 | <meta> |
---|
511 | <rest> |
---|
512 | <method>GET</method> |
---|
513 | <simple>/schemas/public{slash:(/|)}</simple> |
---|
514 | <compress/> |
---|
515 | <Etag>MD5</Etag> |
---|
516 | <produces>application/json</produces> |
---|
517 | </rest> |
---|
518 | </meta> |
---|
519 | <grammar> |
---|
520 | <active> |
---|
521 | <identifier>active:org.schemacat.rest.schemas.public.json</identifier> |
---|
522 | <argument name="slash"/> |
---|
523 | </active> |
---|
524 | </grammar> |
---|
525 | <request> |
---|
526 | <identifier>active:JSONFromXML</identifier> |
---|
527 | <argument name="operand"> |
---|
528 | <request> |
---|
529 | <identifier>active:sloot.dpml</identifier> |
---|
530 | <argument name="operator">res:/interface/publicSchemas.dpml</argument> |
---|
531 | </request> |
---|
532 | </argument> |
---|
533 | </request> |
---|
534 | <header name="mime">application/json</header> |
---|
535 | <header name="httpResponse:/header/Cache-Control">public, max-age=0, must-revalidate, proxy-revalidate</header> |
---|
536 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
537 | </endpoint> |
---|
538 | <endpoint> |
---|
539 | <meta> |
---|
540 | <rest> |
---|
541 | <method>GET</method> |
---|
542 | <simple>/schemas/public{slash:(/|)}</simple> |
---|
543 | <compress/> |
---|
544 | <Etag>MD5</Etag> |
---|
545 | <produces>application/xml</produces> |
---|
546 | </rest> |
---|
547 | </meta> |
---|
548 | <grammar> |
---|
549 | <active> |
---|
550 | <identifier>active:org.schemacat.rest.schemas.public.xml</identifier> |
---|
551 | <argument name="slash"/> |
---|
552 | </active> |
---|
553 | </grammar> |
---|
554 | <request> |
---|
555 | <identifier>active:sloot.dpml</identifier> |
---|
556 | <argument name="operator">res:/interface/publicSchemas.dpml</argument> |
---|
557 | </request> |
---|
558 | <header name="httpResponse:/header/Cache-Control">public, max-age=0, must-revalidate, proxy-revalidate</header> |
---|
559 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
560 | </endpoint> |
---|
561 | <endpoint> |
---|
562 | <meta> |
---|
563 | <rest> |
---|
564 | <method>GET</method> |
---|
565 | <simple>/schemas/public/pagedlist/page/{startPage:([1-9][0-9]*)}/pagesize/{pageSize:([1-9][0-9]*)}{slash:(/|)}</simple> |
---|
566 | <compress/> |
---|
567 | <Etag>MD5</Etag> |
---|
568 | <produces>application/json</produces> |
---|
569 | </rest> |
---|
570 | </meta> |
---|
571 | <grammar> |
---|
572 | <active> |
---|
573 | <identifier>active:org.schemacat.rest.schemas.public.paged.json</identifier> |
---|
574 | <argument name="startPage" min="1" max="1"/> |
---|
575 | <argument name="pageSize" min="1" max="1"/> |
---|
576 | <argument name="slash"/> |
---|
577 | </active> |
---|
578 | </grammar> |
---|
579 | <request> |
---|
580 | <identifier>active:JSONFromXML</identifier> |
---|
581 | <argument name="operand"> |
---|
582 | <request> |
---|
583 | <identifier>active:sloot.dpml</identifier> |
---|
584 | <argument name="operator">res:/interface/pagedPublicSchemas.dpml</argument> |
---|
585 | <argument method="as-string" name="startPage">arg:startPage</argument> |
---|
586 | <argument method="as-string" name="pageSize">arg:pageSize</argument> |
---|
587 | </request> |
---|
588 | </argument> |
---|
589 | </request> |
---|
590 | <header name="mime">application/json</header> |
---|
591 | <header name="httpResponse:/header/Cache-Control">public, max-age=0, must-revalidate, proxy-revalidate</header> |
---|
592 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
593 | </endpoint> |
---|
594 | <endpoint> |
---|
595 | <meta> |
---|
596 | <rest> |
---|
597 | <method>GET</method> |
---|
598 | <simple>/schemas/public/pagedlist/page/{startPage:([1-9][0-9]*)}/pagesize/{pageSize:([1-9][0-9]*)}{slash:(/|)}</simple> |
---|
599 | <compress/> |
---|
600 | <Etag>MD5</Etag> |
---|
601 | <produces>application/xml</produces> |
---|
602 | </rest> |
---|
603 | </meta> |
---|
604 | <grammar> |
---|
605 | <active> |
---|
606 | <identifier>active:org.schemacat.rest.schemas.public.paged.xml</identifier> |
---|
607 | <argument name="startPage" min="1" max="1"/> |
---|
608 | <argument name="pageSize" min="1" max="1"/> |
---|
609 | <argument name="slash"/> |
---|
610 | </active> |
---|
611 | </grammar> |
---|
612 | <request> |
---|
613 | <identifier>active:sloot.dpml</identifier> |
---|
614 | <argument name="operator">res:/interface/pagedPublicSchemas.dpml</argument> |
---|
615 | <argument method="as-string" name="startPage">arg:startPage</argument> |
---|
616 | <argument method="as-string" name="pageSize">arg:pageSize</argument> |
---|
617 | </request> |
---|
618 | <header name="httpResponse:/header/Cache-Control">public, max-age=0, must-revalidate, proxy-revalidate</header> |
---|
619 | <header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">0</header> |
---|
620 | </endpoint> |
---|
621 | <endpoint> |
---|
622 | <meta> |
---|
623 | <rest> |
---|
624 | <method>GET</method> |
---|
625 | <simple>/schemas/{schemaID:([^/]+)}{slash:(/|)}</simple> |
---|
626 | <compress/> |
---|
627 | <Etag>MD5</Etag> |
---|
628 | <produces>application/json</produces> |
---|
629 | </rest> |
---|
630 | </meta> |
---|
631 | <grammar> |
---|
632 | <active> |
---|
633 | <identifier>active:org.schemacat.rest.schema.metadata.json</identifier> |
---|
634 | <argument name="schemaID" min="1" max="1"/> |
---|
635 | <argument name="slash"/> |
---|
636 | </active> |
---|
637 | </grammar> |
---|
638 | <request> |
---|
639 | <identifier>active:sloot.dpml</identifier> |
---|
640 | <argument name="operator">res:/interface/getSchemaMetadata.dpml</argument> |
---|
641 | <argument method="as-string" name="schemaID">arg:schemaID</argument> |
---|
642 | <argument name="json"> |
---|
643 | <literal type="boolean">true</literal> |
---|
644 | </argument> |
---|
645 | </request> |
---|
646 | </endpoint> |
---|
647 | <endpoint> |
---|
648 | <meta> |
---|
649 | <rest> |
---|
650 | <method>GET</method> |
---|
651 | <simple>/schemas/{schemaID:([^/]+)}{slash:(/|)}</simple> |
---|
652 | <compress/> |
---|
653 | <Etag>MD5</Etag> |
---|
654 | <produces>application/xml</produces> |
---|
655 | </rest> |
---|
656 | </meta> |
---|
657 | <grammar> |
---|
658 | <active> |
---|
659 | <identifier>active:org.schemacat.rest.schema.metadata.xml</identifier> |
---|
660 | <argument name="schemaID" min="1" max="1"/> |
---|
661 | <argument name="slash"/> |
---|
662 | </active> |
---|
663 | </grammar> |
---|
664 | <request> |
---|
665 | <identifier>active:sloot.dpml</identifier> |
---|
666 | <argument name="operator">res:/interface/getSchemaMetadata.dpml</argument> |
---|
667 | <argument method="as-string" name="schemaID">arg:schemaID</argument> |
---|
668 | <argument name="json"> |
---|
669 | <literal type="boolean">false</literal> |
---|
670 | </argument> |
---|
671 | </request> |
---|
672 | </endpoint> |
---|
673 | <endpoint> |
---|
674 | <meta> |
---|
675 | <rest> |
---|
676 | <method>GET</method> |
---|
677 | <simple>/schemas/{schemaID:([^/]+)}/files/{file-name}</simple> |
---|
678 | <compress/> |
---|
679 | <Etag>MD5</Etag> |
---|
680 | </rest> |
---|
681 | </meta> |
---|
682 | <grammar> |
---|
683 | <active> |
---|
684 | <identifier>active:org.schemacat.rest.schema.file</identifier> |
---|
685 | <argument name="schemaID"/> |
---|
686 | <argument name="file-name"/> |
---|
687 | </active> |
---|
688 | </grammar> |
---|
689 | <request> |
---|
690 | <identifier>active:sloot.dpml</identifier> |
---|
691 | <argument name="operator">res:/interface/schemaFile.dpml</argument> |
---|
692 | <argument method="as-string" name="schemaID">arg:schemaID</argument> |
---|
693 | <argument method="as-string" name="file-name">arg:file-name</argument> |
---|
694 | <argument name="download"> |
---|
695 | <literal type="boolean">false</literal> |
---|
696 | </argument> |
---|
697 | </request> |
---|
698 | </endpoint> |
---|
699 | <endpoint> |
---|
700 | <meta> |
---|
701 | <rest> |
---|
702 | <method>GET</method> |
---|
703 | <simple>/schemas/{schemaID:([^/]+)}/download/files/{file-name}</simple> |
---|
704 | <compress/> |
---|
705 | <Etag>MD5</Etag> |
---|
706 | </rest> |
---|
707 | </meta> |
---|
708 | <grammar> |
---|
709 | <active> |
---|
710 | <identifier>active:org.schemacat.rest.schema.file.download</identifier> |
---|
711 | <argument name="schemaID"/> |
---|
712 | <argument name="file-name"/> |
---|
713 | </active> |
---|
714 | </grammar> |
---|
715 | <request> |
---|
716 | <identifier>active:sloot.dpml</identifier> |
---|
717 | <argument name="operator">res:/interface/schemaFile.dpml</argument> |
---|
718 | <argument method="as-string" name="schemaID">arg:schemaID</argument> |
---|
719 | <argument method="as-string" name="file-name">arg:file-name</argument> |
---|
720 | <argument name="download"> |
---|
721 | <literal type="boolean">true</literal> |
---|
722 | </argument> |
---|
723 | </request> |
---|
724 | </endpoint> |
---|
725 | <endpoint> |
---|
726 | <!-- this falls through to the urn.org.isocat.schemacat.site module --> |
---|
727 | <meta> |
---|
728 | <rest> |
---|
729 | <method>GET</method> |
---|
730 | <simple>/site{file:(?i)(/index.html|/index.htm)}</simple> |
---|
731 | <compress/> |
---|
732 | <Etag>MD5</Etag> |
---|
733 | </rest> |
---|
734 | </meta> |
---|
735 | <grammar> |
---|
736 | <active> |
---|
737 | <identifier>active:org.schemacat.rest.index</identifier> |
---|
738 | <argument name="file"/> |
---|
739 | </active> |
---|
740 | </grammar> |
---|
741 | <request> |
---|
742 | <identifier>active:org.schemacat.site.index</identifier> |
---|
743 | </request> |
---|
744 | </endpoint> |
---|
745 | <endpoint> |
---|
746 | <!-- this falls through to the urn.org.isocat.schemacat.site module --> |
---|
747 | <meta> |
---|
748 | <rest> |
---|
749 | <method>GET</method> |
---|
750 | <simple>/site/completeuserdetails.html</simple> |
---|
751 | <compress/> |
---|
752 | <Etag>MD5</Etag> |
---|
753 | </rest> |
---|
754 | </meta> |
---|
755 | <grammar> |
---|
756 | <active> |
---|
757 | <identifier>active:org.schemacat.rest.completeuserdetails</identifier> |
---|
758 | </active> |
---|
759 | </grammar> |
---|
760 | <request> |
---|
761 | <identifier>active:org.schemacat.site.completeuserdetails</identifier> |
---|
762 | </request> |
---|
763 | <header name="httpResponse:/header/Cache-Control">private, max-age=0, must-revalidate, proxy-revalidate, no-cache, no-store</header> |
---|
764 | </endpoint> |
---|
765 | <endpoint> |
---|
766 | <!-- redirect matches for: /schemacat, /schemacat/, /schemacat/index.html, /schemacat/index.htm and /schemacat/site. |
---|
767 | Case insensitive--> |
---|
768 | <meta> |
---|
769 | <rest> |
---|
770 | <method>GET</method> |
---|
771 | <simple>{redirect:(?i)(|/|/index.html|/index.htm|/site|/site/)}</simple> |
---|
772 | <compress/> |
---|
773 | <Etag>MD5</Etag> |
---|
774 | </rest> |
---|
775 | </meta> |
---|
776 | <grammar> |
---|
777 | <active> |
---|
778 | <identifier>active:org.schemacat.rest.index.redirect</identifier> |
---|
779 | <argument name="redirect"/> |
---|
780 | </active> |
---|
781 | </grammar> |
---|
782 | <request> |
---|
783 | <identifier>active:redirectHTML</identifier> |
---|
784 | <argument name="url">/schemacat/site/index.html</argument> |
---|
785 | </request> |
---|
786 | </endpoint> |
---|
787 | |
---|
788 | |
---|
789 | <!-- endpoint for NetKernel testing purposes --> |
---|
790 | <endpoint> |
---|
791 | <meta> |
---|
792 | <rest> |
---|
793 | <method>GET</method> |
---|
794 | <simple>/site/NKtest/{testarg}</simple> |
---|
795 | <Etag>MD5</Etag> |
---|
796 | </rest> |
---|
797 | </meta> |
---|
798 | <grammar> |
---|
799 | <active> |
---|
800 | <identifier>active:org.schemacat.test</identifier> |
---|
801 | <argument name="testarg" min="1" max="1"/> |
---|
802 | </active> |
---|
803 | </grammar> |
---|
804 | <request> |
---|
805 | <identifier>active:sloot.dpml</identifier> |
---|
806 | <argument name="operator">res:/interface/test.dpml</argument> |
---|
807 | <argument method="as-string" name="operand">arg:testarg</argument> |
---|
808 | </request> |
---|
809 | <!--<header name="HTTP_CACHE_EXPIRES_DELTA_SECONDS">86400</header>--> |
---|
810 | </endpoint> |
---|
811 | |
---|
812 | |
---|
813 | |
---|
814 | |
---|
815 | |
---|
816 | <endpoint> |
---|
817 | <!-- finds user info --> |
---|
818 | <id>findUser</id> |
---|
819 | <grammar> |
---|
820 | <active> |
---|
821 | <identifier>active:findUser</identifier> |
---|
822 | <argument name="request"/> |
---|
823 | </active> |
---|
824 | </grammar> |
---|
825 | <request> |
---|
826 | <identifier>active:sloot.dpml</identifier> |
---|
827 | <argument name="operator">res:/interface/findUser.dpml</argument> |
---|
828 | </request> |
---|
829 | </endpoint> |
---|
830 | <endpoint> |
---|
831 | <!-- finds the principal --> |
---|
832 | <id>findPrincipal</id> |
---|
833 | <grammar> |
---|
834 | <active> |
---|
835 | <identifier>active:findPrincipal</identifier> |
---|
836 | </active> |
---|
837 | </grammar> |
---|
838 | <request> |
---|
839 | <identifier>active:sloot.dpml</identifier> |
---|
840 | <argument name="operator">res:/interface/findPrincipal.dpml</argument> |
---|
841 | </request> |
---|
842 | </endpoint> |
---|
843 | <endpoint> |
---|
844 | <!-- true if requester (from scratchpad) is present in authorized IDs or has an authorized role--> |
---|
845 | <id>isAuthorized</id> |
---|
846 | <grammar> |
---|
847 | <active> |
---|
848 | <identifier>active:isAuthorized</identifier> |
---|
849 | <argument name="authorizedIDs" min="1" max="1"/> |
---|
850 | <argument name="authorizedRoles" min="1" max="1"/> |
---|
851 | <argument name="user" min="1" max="1"/> |
---|
852 | </active> |
---|
853 | </grammar> |
---|
854 | <request> |
---|
855 | <identifier>active:sloot.dpml</identifier> |
---|
856 | <argument name="operator">res:/interface/isAuthorized.dpml</argument> |
---|
857 | <argument name="authorizedIDs">arg:authorizedIDs</argument> |
---|
858 | <argument name="authorizedRoles">arg:authorizedRoles</argument> |
---|
859 | <argument name="user">arg:user</argument> |
---|
860 | </request> |
---|
861 | </endpoint> |
---|
862 | <endpoint> |
---|
863 | <!-- get the user IDs authorized to access a given (by schema-metadata) or specified (by schemaID) schema. --> |
---|
864 | <grammar> |
---|
865 | <active> |
---|
866 | <identifier>active:interface.rest.schema.access.authorizedIds</identifier> |
---|
867 | <argument name="schemaID" min="0" max="1"/> |
---|
868 | <argument name="schema-metadata" min="0" max="1"/> |
---|
869 | </active> |
---|
870 | </grammar> |
---|
871 | <request> |
---|
872 | <identifier>active:sloot.dpml</identifier> |
---|
873 | <argument name="operator">res:/interface/schemaAuthorizedIDs.dpml</argument> |
---|
874 | <argument name="schemaID">arg:schemaID</argument> |
---|
875 | <argument name="schema-metadata">arg:schema-metadata</argument> |
---|
876 | </request> |
---|
877 | </endpoint> |
---|
878 | <endpoint> |
---|
879 | <!-- gets the share status of a given (by schema-metadata) or specified (by schemaID) schema. |
---|
880 | This can be: 'private', 'public' or 'sharedURL' --> |
---|
881 | <grammar> |
---|
882 | <active> |
---|
883 | <identifier>active:interface.rest.schema.access.getstatus</identifier> |
---|
884 | <argument name="schemaID" min="0" max="1"/> |
---|
885 | <argument name="schema-metadata" min="0" max="1"/> |
---|
886 | </active> |
---|
887 | </grammar> |
---|
888 | <request> |
---|
889 | <identifier>active:sloot.dpml</identifier> |
---|
890 | <argument name="operator">res:/interface/schemaAccessStatus.dpml</argument> |
---|
891 | <argument name="schemaID">arg:schemaID</argument> |
---|
892 | <argument name="schema-metadata">arg:schema-metadata</argument> |
---|
893 | </request> |
---|
894 | </endpoint> |
---|
895 | <endpoint> |
---|
896 | <!-- verifies if the user saved in the scratch pad has its profile complete. |
---|
897 | i.e. mandatory fields are all filled in. --> |
---|
898 | <id>verifyProfileCompletion</id> |
---|
899 | <grammar> |
---|
900 | <active> |
---|
901 | <identifier>active:verifyProfileCompletion</identifier> |
---|
902 | <argument name="user" min="1" max="1"/> |
---|
903 | </active> |
---|
904 | </grammar> |
---|
905 | <request> |
---|
906 | <identifier>active:sloot.dpml</identifier> |
---|
907 | <argument name="operator">res:/interface/verifyProfileCompletion.dpml</argument> |
---|
908 | <argument name="user" method="data-uri">arg:user</argument> |
---|
909 | </request> |
---|
910 | </endpoint> |
---|
911 | <endpoint> |
---|
912 | <!-- 403 forbidden response to return when request try to access unauthorized resources. --> |
---|
913 | <grammar> |
---|
914 | <active> |
---|
915 | <identifier>active:interface.rest.HTTPresponse.forbidden</identifier> |
---|
916 | </active> |
---|
917 | </grammar> |
---|
918 | <request> |
---|
919 | <identifier>active:groovy</identifier> |
---|
920 | <argument name="operator"> |
---|
921 | <!-- TODO: check if this is the proper way to generata a forbidden response --> |
---|
922 | <literal type="string"> |
---|
923 | context.createResponseFrom("<html lang='en' xmlns='http://www.w3.org/1999/xhtml'><body><img src='/schemacat/site/images/HTTPstatus/403-Forbidden.jpg'/></body></html>").setMimeType("text/html"); |
---|
924 | context.sink("httpResponse:/code", 403); |
---|
925 | </literal> |
---|
926 | </argument> |
---|
927 | </request> |
---|
928 | </endpoint> |
---|
929 | </config> |
---|
930 | <space> |
---|
931 | <fileset> |
---|
932 | <regex>res:/etc/system/LogConfig.xml</regex> |
---|
933 | </fileset> |
---|
934 | <import> |
---|
935 | <uri>urn:org:netkernel:lang:groovy</uri> |
---|
936 | </import> |
---|
937 | <import> |
---|
938 | <uri>urn:org:netkernel:lang:dpml</uri> |
---|
939 | </import> |
---|
940 | <import> |
---|
941 | <uri>urn:org:netkernel:json:core</uri> |
---|
942 | </import> |
---|
943 | <import> |
---|
944 | <uri>urn:org:isocat:schemacat:access:data</uri> |
---|
945 | </import> |
---|
946 | <import> |
---|
947 | <uri>urn:org:isocat:schemacat:site</uri> |
---|
948 | </import> |
---|
949 | <import> |
---|
950 | <uri>urn:org:isocat:sloot</uri> |
---|
951 | </import> |
---|
952 | <import> |
---|
953 | <uri>urn:org:netkernel:client:http</uri> |
---|
954 | </import> |
---|
955 | <import> |
---|
956 | <uri>urn:org:netkernel:xml:saxon</uri> |
---|
957 | </import> |
---|
958 | <import> |
---|
959 | <uri>urn:org:netkernel:mod:security</uri> |
---|
960 | </import> |
---|
961 | </space> |
---|
962 | </mapper> |
---|
963 | </space> |
---|
964 | </overlay> |
---|
965 | <import> |
---|
966 | <private/> |
---|
967 | <uri>urn:org:netkernel:tpt:http</uri> |
---|
968 | </import> |
---|
969 | </rootspace> |
---|
970 | <rootspace name="SCHEMAcat - interface - REST - Documentation Space" public="true" |
---|
971 | uri="urn:org:isocat:schemacat:interface:rest:doc"> |
---|
972 | <fileset> |
---|
973 | <regex>res:/etc/system/(Books|Docs).xml</regex> |
---|
974 | </fileset> |
---|
975 | <fileset> |
---|
976 | <regex>res:/doc/.*</regex> |
---|
977 | </fileset> |
---|
978 | </rootspace> |
---|
979 | <rootspace name="SCHEMAcat - interface - REST - Unit Test Space" public="true" |
---|
980 | uri="urn:org:isocat:schemacat:interface:rest:test"> |
---|
981 | <fileset> |
---|
982 | <regex>res:/etc/system/Tests.xml</regex> |
---|
983 | </fileset> |
---|
984 | <fileset> |
---|
985 | <regex>res:/test/.*</regex> |
---|
986 | </fileset> |
---|
987 | <endpoint> |
---|
988 | <!-- stop any configuration from module under test from polluting address space --> |
---|
989 | <prototype>Limiter</prototype> |
---|
990 | <grammar>res:/etc/<regex type="anything"/> |
---|
991 | </grammar> |
---|
992 | </endpoint> |
---|
993 | <import> |
---|
994 | <!-- import the main space which we are testing --> |
---|
995 | <uri>urn:org:isocat:schemacat:interface:rest</uri> |
---|
996 | </import> |
---|
997 | <import> |
---|
998 | <uri>urn:org:netkernel:client:http</uri> |
---|
999 | </import> |
---|
1000 | <import> |
---|
1001 | <uri>urn:org:netkernel:ext:layer1</uri> |
---|
1002 | </import> |
---|
1003 | </rootspace> |
---|
1004 | </module> |
---|