Mercurial > dive4elements > river
comparison flys-artifacts/doc/conf/meta-data-user.xml @ 1043:9c0f981cd22d
Datacage user template: Removed state filter because it was broken. Simplified by joining two contexts.
flys-artifacts/trunk@2504 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 18 Aug 2011 14:13:35 +0000 |
parents | c586b6220f35 |
children | ba840385ad2e |
comparison
equal
deleted
inserted
replaced
1042:8873c43119ca | 1043:9c0f981cd22d |
---|---|
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 <old_calculations> | 9 <old_calculations> |
10 <dc:context connection="user"> | 10 <dc:context connection="user"> |
11 <dc:statement>SELECT id as user_id FROM users WHERE gid = CAST(${user-id} AS uuid)</dc:statement> | 11 <dc:statement>SELECT u.id AS user_id, c.id AS collection_id |
12 FROM collections c JOIN users u ON c.user_id = u.id | |
13 WHERE u.gid = CAST(${user-id} AS uuid) | |
14 ORDER BY c.creation DESC | |
15 </dc:statement> | |
12 <dc:elements> | 16 <dc:elements> |
13 <dc:context> | 17 <dc:context> |
14 <dc:statement>SELECT id AS collection_id FROM collections WHERE user_id = ${user_id}</dc:statement> | 18 <dc:statement>SELECT a.id AS a_id, a.state AS a_state, a.gid AS a_gid, a.creation AS a_creation |
19 FROM collection_items ci JOIN artifacts a ON ci.artifact_id = a.id | |
20 WHERE collection_id = ${collection_id} AND a.gid <> CAST(${artifact-id} AS uuid) | |
21 AND EXISTS (SELECT id FROM artifact_data WHERE artifact_id = a.id AND k = 'river' AND v = ${river}) | |
22 </dc:statement> | |
23 <dc:comment> --- TODO: We only need the 'master' artifacts! --- </dc:comment> | |
15 <dc:elements> | 24 <dc:elements> |
16 <dc:context> | 25 <dc:choose> |
17 <dc:statement>SELECT a.id AS a_id, a.state AS a_state, a.gid AS a_gid, a.creation AS a_creation FROM | 26 <dc:when test="$current-state-id = 'state.winfo.waterlevel'"> |
18 collection_items ci JOIN artifacts a ON ci.artifact_id = a.id | 27 <dc:context> |
19 WHERE collection_id = ${collection_id} AND a.state = ${current-state-id} AND a.gid <> CAST(${artifact-id} AS uuid) | 28 <dc:statement>SELECT id AS out_id FROM outs WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' |
20 AND EXISTS (SELECT id FROM artifact_data WHERE artifact_id = a.id AND k = 'river' AND v = ${river}) | 29 </dc:statement> |
21 ORDER BY a.creation DESC | 30 <dc:elements> |
22 </dc:statement> | |
23 <dc:comment> --- TODO: We only need the 'master' artifacts! --- </dc:comment> | |
24 <dc:elements> | |
25 <dc:choose> | |
26 <dc:when test="$current-state-id = 'state.winfo.waterlevel'"> | |
27 <dc:context> | 31 <dc:context> |
28 <dc:statement>SELECT id AS out_id FROM outs WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'</dc:statement> | 32 <dc:statement>SELECT name AS facet_name, num as facet_num, description AS facet_description |
29 <dc:elements> | 33 FROM facets WHERE out_id = ${out_id} ORDER BY num ASC, name DESC |
30 <dc:context> | 34 </dc:statement> |
31 <dc:statement>SELECT name AS facet_name, num as facet_num, description AS facet_description | 35 <longitudinal_section_columns> |
32 FROM facets WHERE out_id = ${out_id} ORDER BY num ASC, name DESC | 36 <dc:attribute name="description" value="${river} ${a_creation}"/> |
33 </dc:statement> | 37 <dc:elements> |
34 <longitudinal_section_columns> | 38 <dc:element name="${facet_name}"> |
35 <dc:attribute name="description" value="${river} ${a_creation}"/> | 39 <dc:attribute name="description" value="${facet_description}"/> |
36 <dc:elements> | 40 <dc:attribute name="num" value="${facet_num}"/> |
37 <dc:element name="${facet_name}"> | 41 <dc:attribute name="factory" value="TODO"/> |
38 <dc:attribute name="description" value="${facet_description}"/> | 42 <dc:attribute name="artifact-id" value="${a_gid}"/> |
39 <dc:attribute name="num" value="${facet_num}"/> | 43 </dc:element> |
40 <dc:attribute name="factory" value="TODO"/> | 44 </dc:elements> |
41 <dc:attribute name="artifact-id" value="${a_gid}"/> | 45 </longitudinal_section_columns> |
42 </dc:element> | |
43 </dc:elements> | |
44 </longitudinal_section_columns> | |
45 </dc:context> | |
46 </dc:elements> | |
47 </dc:context> | 46 </dc:context> |
48 </dc:when> | 47 </dc:elements> |
49 </dc:choose> | 48 </dc:context> |
50 </dc:elements> | 49 </dc:when> |
51 </dc:context> | 50 </dc:choose> |
52 </dc:elements> | 51 </dc:elements> |
53 </dc:context> | 52 </dc:context> |
54 </dc:elements> | 53 </dc:elements> |
55 </dc:context> | 54 </dc:context> |
56 </old_calculations> | 55 </old_calculations> |