annotate flys-artifacts/doc/conf/meta-data-user.xml @ 1023:5cb84ceee2a0

Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context> flys-artifacts/trunk@2481 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 10 Aug 2011 10:08:01 +0000
parents 3d36e6000915
children c586b6220f35
rev   line source
1015
9a1a3080ad98 Bring user specific meta data service to life.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
9a1a3080ad98 Bring user specific meta data service to life.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2 <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage">
9a1a3080ad98 Bring user specific meta data service to life.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 <datacage>
1018
d42fa223be48 Datacage: added first user specific config for cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1017
diff changeset
4 <dc:comment>
d42fa223be48 Datacage: added first user specific config for cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1017
diff changeset
5 User specific part
d42fa223be48 Datacage: added first user specific config for cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1017
diff changeset
6 ------------------
d42fa223be48 Datacage: added first user specific config for cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1017
diff changeset
7 </dc:comment>
d42fa223be48 Datacage: added first user specific config for cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1017
diff changeset
8 <dc:if test="dc:contains($parameters, 'user-id')">
1021
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
9 <old_calculations>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
10 <dc:context connection="user">
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
11 <dc:statement>SELECT id as user_id FROM users WHERE gid = CAST(${user-id} AS uuid)</dc:statement>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
12 <dc:elements>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
13 <dc:context>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
14 <dc:statement>SELECT id AS collection_id FROM collections WHERE user_id = ${user_id}</dc:statement>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
15 <dc:elements>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
16 <dc:context>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
17 <dc:statement>SELECT a.id AS a_id, a.state AS a_state, a.gid as a_gid FROM
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
18 collection_items ci JOIN artifacts a ON ci.artifact_id = a.id
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
19 WHERE collection_id = ${collection_id} AND a.state = ${current-state-id} AND a.gid &lt;&gt; CAST(${artifact-id} AS uuid)
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
20 AND EXISTS (SELECT id FROM artifact_data WHERE artifact_id = a.id AND k = 'river' AND v = ${river})
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
21 </dc:statement>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
22 <dc:comment> --- TODO: We only need the 'master' artifacts! --- </dc:comment>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
23 <dc:elements>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
24 <dc:choose>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
25 <dc:when test="$current-state-id = 'state.winfo.waterlevel'">
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
26 <dc:context>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
27 <dc:statement>SELECT id AS out_id FROM outs WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'</dc:statement>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
28 <dc:elements>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
29 <dc:context>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
30 <dc:statement>SELECT name AS facet_name, num as facet_num, description AS facet_description
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
31 FROM facets WHERE out_id = ${out_id} ORDER BY num ASC, name DESC
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
32 </dc:statement>
1023
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
33 <longitudinal_section_columns>
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
34 <dc:attribute name="description" value="${river} TODO: More infos about parameters!"/>
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
35 <dc:elements>
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
36 <dc:element name="${facet_name}">
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
37 <dc:attribute name="description" value="${facet_description}"/>
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
38 <dc:attribute name="num" value="${facet_num}"/>
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
39 <dc:attribute name="factory" value="TODO"/>
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
40 <dc:attribute name="artifact-id" value="${a_gid}"/>
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
41 </dc:element>
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
42 </dc:elements>
5cb84ceee2a0 Datacage: Templates now can nest <dc:elements> into other elements in the body of <dc:context>
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1021
diff changeset
43 </longitudinal_section_columns>
1021
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
44 </dc:context>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
45 </dc:elements>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
46 </dc:context>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
47 </dc:when>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
48 </dc:choose>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
49 </dc:elements>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
50 </dc:context>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
51 </dc:elements>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
52 </dc:context>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
53 </dc:elements>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
54 </dc:context>
3d36e6000915 Added <old_calculations> element
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1019
diff changeset
55 </old_calculations>
1018
d42fa223be48 Datacage: added first user specific config for cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1017
diff changeset
56 </dc:if>
1015
9a1a3080ad98 Bring user specific meta data service to life.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
57 </datacage>
9a1a3080ad98 Bring user specific meta data service to life.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
58 </dc:template>

http://dive4elements.wald.intevation.org