comparison flys-artifacts/doc/conf/meta-data-user.xml @ 1018:d42fa223be48

Datacage: added first user specific config for cross sections. flys-artifacts/trunk@2464 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 04 Aug 2011 15:05:02 +0000
parents 8637756275e5
children aff2a0a29aa3
comparison
equal deleted inserted replaced
1017:8637756275e5 1018:d42fa223be48
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage"> 2 <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage">
3 <datacage> 3 <datacage>
4 <dc:comment> 4 <dc:comment>
5 User specific part 5 User specific part
6 ------------------ 6 ------------------
7 </dc:comment> 7 </dc:comment>
8 <dc:if test="dc:contains($parameters, 'user-id')"> 8 <dc:if test="dc:contains($parameters, 'user-id')">
9 <dc:text>Current user id: ${user-id}</dc:text> 9 <dc:context connection="user">
10 </dc:if> 10 <dc:statement>SELECT id as user_id FROM users WHERE gid = ${user-id}::uuid</dc:statement>
11 <dc:elements>
12 <dc:context>
13 <dc:statement>SELECT id AS collection_id FROM collections WHERE user_id = ${user_id}</dc:statement>
14 <dc:elements>
15 <dc:context>
16 <dc:statement>SELECT a.id AS a_id, a.state AS a_state, a.gid as a_gid FROM
17 collection_items ci JOIN artifacts a ON ci.artifact_id = a.id
18 WHERE collection_id = ${collection_id} AND a.state = ${current-state-id} AND a.gid &lt;&gt; ${artifact-id}::uuid
19 AND EXISTS (SELECT id FROM artifact_data WHERE artifact_id = a.id AND k = 'river' AND v = ${river})
20 </dc:statement>
21 <dc:comment> --- TODO: We only need the 'master' artifacts! --- </dc:comment>
22 <dc:elements>
23 <dc:choose>
24 <dc:when test="$current-state-id = 'state.winfo.waterlevel'">
25 <dc:context>
26 <dc:statement>SELECT id AS out_id FROM outs WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'</dc:statement>
27 <dc:elements>
28 <dc:context>
29 <dc:statement>SELECT name AS facet_name, num as facet_num, description AS facet_description
30 FROM facets WHERE out_id = ${out_id} ORDER BY num ASC, name DESC
31 </dc:statement>
32 <dc:elements>
33 <dc:element name="${facet_name}">
34 <dc:attribute name="description" value="${facet_description}"/>
35 <dc:attribute name="num" value="${facet_num}"/>
36 <dc:attribute name="factory" value="TODO"/>
37 <dc:attribute name="artifact-id" value="${a_gid}"/>
38 </dc:element>
39 </dc:elements>
40 </dc:context>
41 </dc:elements>
42 </dc:context>
43 </dc:when>
44 </dc:choose>
45 </dc:elements>
46 </dc:context>
47 </dc:elements>
48 </dc:context>
49 </dc:elements>
50 </dc:context>
51 </dc:if>
11 </datacage> 52 </datacage>
12 </dc:template> 53 </dc:template>

http://dive4elements.wald.intevation.org