annotate artifacts/doc/datacage.txt @ 9316:72b3270e1568

U-Info salix line with regional and supraregional scenario calculation and chart display
author mschaefer
date Thu, 26 Jul 2018 17:28:32 +0200
parents 806fa23dffb3
children
rev   line source
3038
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
1 This document describes how the datacage configuration works, from a user
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
2 perspective. Some rather technical details are omitted and mechanisms
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
3 simplified.
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
4
3033
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
5 The datacages behaviour is defined in the file conf/meta-data.xml .
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
6
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
7 The datacage serves two purposes.
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
8 It handles automatic 'recommendations', which are instructions
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
9 sent by the client to add newly created artifacts to the collection.
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10 From a user perspective, these artifacts mainly represent curves or data
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
11 points in the resulting diagrams.
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12 The second task is to let the user add already existing artifacts (i.e.
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13 previous calculations) or new artifacts with access to related data.
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 Irrelevant of the type of elements (recommendations or user picked data) the
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16 datacage can iterate over possible artifacts by accessing its own database.
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
17 Thus, to create a list of matching entries, database queries are used.
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
18
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
19 In meta-data.xml, database queries are defined as <dc:statement> elements,
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
20 for example
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
21 <dc:statement>
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22 SELECT id AS prot_id,
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
23 description AS prot_description
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
24 FROM wsts WHERE kind = 1 AND river_id = ${river_id}
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
25 </dc:statement>
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
26
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
27 As can be seen from the example, the datacage configuration file can maintain
aba4104f41c9 Added stub for datacage configuration documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28 its own stack of variables (${river_id} in above example).
3038
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
29
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
30 The database query will usually deliver one or many results, over which is
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
31 iterated using the <dc:elements> elements.
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
32
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
33 Information from this results can be used for two goals.
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
34 It can be taken as output, in which
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
35 case the client will either request the creation of these artifacts (considering
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
36 recommendations), or shown by the client in a the 'datacage widget',
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
37 the graphical representation of data which can be added in the current
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
38 context. The later is seen when the user clicks on the Datacage button in
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
39 a diagram.
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
40 Or information can be used to feed a second (or third...) database query.
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
41 Following above example:
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
42
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
43 <dc:statement>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
44 SELECT id AS prot_id,
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
45 description AS prot_description
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
46 FROM wsts WHERE kind = 1 AND river_id = ${river_id}
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
47 </dc:statement>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
48 <dc:elements>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
49 <additional>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
50 <dc:attribute name="name" value="${prot_description}"/>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
51 <dc:context>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
52 <dc:statement>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
53 SELECT id AS prot_column_id,
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
54 name AS prot_column_name,
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
55 position AS prot_rel_pos
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
56 FROM wst_columns WHERE wst_id = ${prot_id}
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
57 ORDER by position
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
58 </dc:statement>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
59 <!-- ... -->
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
60
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
61 In both cases, an <dc:elements> element makes database queries available.
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
62 Also
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
63 note how the variables are defined in the first query and reused in the second
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
64 query (${prot_it}).
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
65
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
66 Any alement not prefixed with "dc" represents a (sub-) node in the resulting
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
67 tree. The client will display these nodes and maybe subnodes in the datacage
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
68 widget - <additional> in above example. The elements name is translated by
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
69 the client.
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
70
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
71 While iterating the final results, <dc:attributes> have to be specified
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
72 to define how the artifact is to be created.
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
73
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
74 <dc:elements>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
75 <column>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
76 <dc:attribute name="name" value="${prot_column_name}"/>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
77 <dc:attribute name="ids" value="additionals-wstv-${prot_rel_pos}-${prot_id}"/>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
78 <dc:attribute name="factory" value="staticwkms"/>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
79 </column>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
80 </dc:elements>
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
81
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
82 The "name" attribute is what is to be displayed in the client, the "ids" are given
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
83 to the server and pass important information about the chosen data.
6a37a0134409 Added accidentally ommitted changed to datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3033
diff changeset
84 The "factory" is chosen according to the type of data displayed.
3041
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
85
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
86 So far, three other elements have not yet been mentioned: <dc:comment>,
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
87 <dc:if> and the <dc:when><dc:otherwise> structure.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
88 <dc:comment> is an element to allow comments. Choose these over standard
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
89 <!-- --> xml comments, because they are not transferred to the client.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
90 <dc:if> and <dc:when> allow control (rather: definition) flow within
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
91 the configuration and work in analogy to the XSL-elements <xsl:if>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
92 and <xsl:when>.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
93
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
94 When dealing with the behaviour specification of the datacage, multiple
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
95 interpretations for the term "context" are possible.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
96 A <dc:context> element essentially means a database binding. Thus each
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
97 query (<dc:statement>) needs to be nested in its own context.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
98 Furthermore, two types of databases with own bindings exist:
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
99 The "system" (default for <dc:context>, <dc:context connection="system">)
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
100 context allows queries related to the backend database with existing
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
101 data (e.g. measurements).
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
102 The "user" context (<dc:context connection="user">) allows queries against
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
103 the database which stores information about already existing artifacts and
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
104 calculations.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
105
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
106 Another connotation for the term "context" is the situation from which
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
107 the datacage is queried. The standard case is a from the datacage widget.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
108 When the user opens the datacage from the graphical client, this is done
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
109 from one of possible multiple diagrams.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
110 When the datacage is queried, it gets as an argument the "out" of
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
111 the current artifact. The out corresponds to the diagram type.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
112
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
113 For example the inner block of
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
114
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
115 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')">
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
116 <longitudinal_section>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
117 <dc:call-macro name="annotations"/>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
118 </longitudinal_section>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
119 </dc:if>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
120
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
121 will only be executed if called from the datacage within a
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
122 longitudinal_section diagram.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
123
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
124 In the given example another concept of the datacage configuration is
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
125 encountered: Macros.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
126
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
127 Macros help to avoid duplication of parts of the document. As the datacage
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
128 of some diagrams should include the same type of data, the same query should
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
129 be executed in multiple situations.
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
130
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
131 Therefore a macro can be defined, like in
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
132
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
133 <dc:macro name="basedata_4_heightmarks-wq">
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
134 <heightmarks>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
135 <dc:context>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
136 <dc:statement>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
137 SELECT id AS prot_id,
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
138 description AS prot_description
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
139 FROM wsts WHERE kind = 4 AND river_id = ${river_id}
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
140 </dc:statement>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
141 <dc:elements>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
142 <!-- ... -->
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
143 </dc:macro>
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
144
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
145 and invoked from another location within the document, e.g. with
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
146
eabecbdd5ade More datacage conf doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3038
diff changeset
147 <dc:call-macro name="basedata_4_heightmarks"/>
6082
806fa23dffb3 Add some debugging tips
Andre Heinecke <aheinecke@intevation.de>
parents: 5838
diff changeset
148
806fa23dffb3 Add some debugging tips
Andre Heinecke <aheinecke@intevation.de>
parents: 5838
diff changeset
149 Debugging Tips:
806fa23dffb3 Add some debugging tips
Andre Heinecke <aheinecke@intevation.de>
parents: 5838
diff changeset
150 - You can send a message to the Log (log level info) during the evaluation
806fa23dffb3 Add some debugging tips
Andre Heinecke <aheinecke@intevation.de>
parents: 5838
diff changeset
151 of the datacage by using the <dc:message> element.
806fa23dffb3 Add some debugging tips
Andre Heinecke <aheinecke@intevation.de>
parents: 5838
diff changeset
152 For example to activate a basic macro tracing you could do something like:
806fa23dffb3 Add some debugging tips
Andre Heinecke <aheinecke@intevation.de>
parents: 5838
diff changeset
153 %s@\(<dc:macro name="\)\(.*\)\(".*>\)@\1\2\3\r<dc:message>\2</dc:message>
806fa23dffb3 Add some debugging tips
Andre Heinecke <aheinecke@intevation.de>
parents: 5838
diff changeset
154 - To dump the variables that are currently on the stack you can use the
806fa23dffb3 Add some debugging tips
Andre Heinecke <aheinecke@intevation.de>
parents: 5838
diff changeset
155 dc:dump-variables() fuction.
806fa23dffb3 Add some debugging tips
Andre Heinecke <aheinecke@intevation.de>
parents: 5838
diff changeset
156 For example:
806fa23dffb3 Add some debugging tips
Andre Heinecke <aheinecke@intevation.de>
parents: 5838
diff changeset
157 <dc:message>{dc:dump-variables()}</dc:message>

http://dive4elements.wald.intevation.org