source: cats/SCHEMAcat/trunk/urn.org.isocat.schemacat.interface.rest/interface/schemas.dpml @ 3485

Last change on this file since 3485 was 3485, checked in by andmor, 11 years ago

Added enpoints to get the schemas (in XML and JSON).
Added endpoint to check authorization.

File size: 1.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<sequence debug="true">
3        <sloot-debug>
4                <log>
5                        <level>INFO</level>
6                        <message>
7                                <literal type="string">[interface.REST] Requested schemas for user id: %1</literal>
8                        </message>
9                        <param>arg:userID</param>
10                </log>
11        </sloot-debug>
12        <if>
13                <cond>
14                        <request>
15                                <identifier>active:isAuthorized</identifier>
16                                <argument name="authorizedIDs">
17                                        <request>
18                                                <identifier>active:sloot.xquery</identifier>
19                                                <argument name="operator">
20                                                        <literal type="xml">
21                                                                <ids>
22                                                                        <id>{$userID}</id>
23                                                                </ids>
24                                                        </literal>
25                                                </argument>
26                                                <argument name="userID">arg:userID</argument>
27                                        </request>
28                                </argument>
29                        </request>
30                </cond>
31                <then>
32                        <request assignment="response">
33                                <identifier>active:org.isocat.schemacat.access.data.user.schemas</identifier>
34                                <argument name="userID">arg:userID</argument>
35                        </request>
36                </then>
37                <else>
38                        <request assignment="response">
39                                <identifier>active:groovy</identifier>
40                                <argument name="operator">
41                                        <!-- TODO: check if this is the proper way to generata a forbidden response -->
42                                        <literal type="string">
43                                                context.createResponseFrom("Forbidden!");
44                                                context.sink("httpResponse:/code", 403);
45                                        </literal>
46                                </argument>
47                        </request>
48                </else>
49        </if>
50        <sloot-debug>
51                <request>
52                        <verb>SINK</verb>
53                        <identifier>res:/debug/org.isocat.schemacat.interface.rest.schemas.response.xml</identifier>
54                        <argument name="primary">this:response</argument>
55                </request>
56        </sloot-debug>
57</sequence>
Note: See TracBrowser for help on using the repository browser.