source: cats/ISOcat/trunk/mod-ISOcat-interface-rest/interface/dcs-check.acc @ 4893

Last change on this file since 4893 was 4893, checked in by Menzo Windhouwer, 10 years ago

A mod-ISOcat-interface-rest/interface/dcs-check.acc
A mod-ISOcat-interface-rest/representations/html/DCS-check.xsl
M mod-ISOcat-interface-rest/etc/XRLLinks.xml

  • added /rest/dcs/<id>/check to the REST API

-- returns a check report for all entries in a DCS

A mod-ISOcat-access-data/access/dcs_check.acc
M mod-ISOcat-access-data/module.xml

  • added an accessor to check all DCs in a DCS

M mod-ISOcat-control-access/etc/GateKeeperPolicy.xml

  • added access control for the DCS check
File size: 4.1 KB
Line 
1<accessor debug="false">
2        <name>/rest/dcs/check</name>
3        <descr>Check the DCs in a DCS.</descr>
4        <param mandatory="true">
5                <name>method</name>
6                <descr>what do we want to do?</descr>
7                <type canonical="true">string</type>
8        </param>
9        <param mandatory="true">
10                <name>dcs</name>
11                <descr>the DCS key</descr>
12                <type canonical="true">string</type>
13        </param>
14        <param>
15                <name>credentials</name>
16                <descr>the user credentials</descr>
17                <source>
18                        <param/>
19                        <default>data:text/plain,guest:guest</default>
20                </source>
21        </param>
22        <param>
23                <name>representation</name>
24                <descr>the requested representation</descr>
25                <type canonical="true">string</type>
26                <source>
27                        <param/>
28                        <default>
29                                <string/>
30                        </default>
31                </source>
32        </param>
33        <param>
34                <name>Accept</name>
35                <descr>the accepted representation</descr>
36                <type canonical="true">string</type>
37                <source>
38                        <param/>
39                        <default>
40                                <string/>
41                        </default>
42                </source>
43        </param>
44        <params/>
45        <idoc>
46            <accessor-debug>
47                <instr>
48                    <type>log</type>
49                    <operand>var:dcs</operand>
50                </instr>
51            </accessor-debug>
52            <!-- determine the requested representation -->
53                <if>
54                        <cond>
55                                <instr>
56                                        <type>sloot.xpath2eval</type>
57                                        <operand>var:representation</operand>
58                                        <operator>
59                                                <xpath>.=''</xpath>
60                                        </operator>
61                                        <target>this:cond</target>
62                                </instr>
63                        </cond>
64                        <then>
65                                <instr>
66                                        <type>sloot.mimeparse</type>
67                                        <accept>var:Accept</accept>
68                                        <types>xml:application/xml html:text/html</types>
69                                        <target>var:representation</target>
70                                </instr>
71                        </then>
72                </if>
73                <choose>
74                        <cond>
75                                <instr>
76                                        <type>sloot.xpath2eval</type>
77                                        <operand>var:method</operand>
78                                        <operator>
79                                                <xpath>.='GET'</xpath>
80                                        </operator>
81                                        <target>this:cond</target>
82                                </instr>
83                        </cond>
84                        <then>
85                            <instr>
86                                <type>ISOcat.manage.dcs</type>
87                                <dcs>var:dcs</dcs>
88                                <credentials>var:credentials</credentials>
89                                <target>var:dcs</target>
90                            </instr>
91                            <accessor-debug>
92                                <instr>
93                                    <type>log</type>
94                                    <operand>var:dcs</operand>
95                                </instr>
96                            </accessor-debug>
97                            <instr>
98                                        <type>ISOcat.manage.dcs.check</type>
99                                        <dcs>var:dcs</dcs>
100                                        <credentials>var:credentials</credentials>
101                                        <target>var:response</target>
102                                </instr>
103                        </then>
104                        <else>
105                                <instr>
106                                        <type>throw</type>
107                                        <operand>
108                                                <ex>
109                                                        <id>ISOcat[METHOD NOT ALLOWED]</id>
110                                                        <message>You can only get this resource.</message>
111                                                </ex>
112                                        </operand>
113                                </instr>
114                        </else>
115                </choose>
116                <choose>
117                        <cond>
118                                <instr>
119                                        <type>sloot.xpath2eval</type>
120                                        <operand>var:representation</operand>
121                                        <operator>
122                                                <xpath>.='xml'</xpath>
123                                        </operator>
124                                        <target>this:cond</target>
125                                </instr>
126                        </cond>
127                        <then>
128                                <instr>
129                                        <type>cast</type>
130                                        <operand>var:response</operand>
131                                        <operator>
132                                                <cast>
133                                                        <mimetype>application/xml</mimetype>
134                                                </cast>
135                                        </operator>
136                                        <target>this:response</target>
137                                </instr>
138                        </then>
139                        <cond>
140                                <instr>
141                                        <type>sloot.xpath2eval</type>
142                                        <operand>var:representation</operand>
143                                        <operator>
144                                                <xpath>.='html'</xpath>
145                                        </operator>
146                                        <target>this:cond</target>
147                                </instr>
148                        </cond>
149                        <then>
150                                <instr>
151                                        <type>xslt2</type>
152                                        <operand>var:response</operand>
153                                        <operator>ffcpl:/representations/html/DCS-check.xsl</operator>
154                                        <props>active:ISOcat.manage.system.properties</props>
155                                        <target>this:response</target>
156                                </instr>
157                                <instr>
158                                        <type>cast</type>
159                                        <operand>this:response</operand>
160                                        <operator>
161                                                <cast>
162                                                        <mimetype>text/html</mimetype>
163                                                </cast>
164                                        </operator>
165                                        <target>this:response</target>
166                                </instr>
167                        </then>
168                        <else>
169                                <instr>
170                                        <type>throw</type>
171                                        <operand>
172                                                <ex>
173                                                        <id>ISOcat[NOT FOUND]</id>
174                                                        <message>This representation isn't supported by this resource.</message>
175                                                </ex>
176                                        </operand>
177                                </instr>
178                        </else>
179                </choose>
180        </idoc>
181        <exception>
182                <debug/>
183                <trace>ffcpl:/trace/dcs-check.exception.xml</trace>
184                <throw/>
185        </exception>
186        <response>
187                <debug>ffcpl:/trace/dcs-check.response.xml</debug>
188        </response>
189</accessor>
190
Note: See TracBrowser for help on using the repository browser.