Mercurial > dive4elements > gnv-client
comparison doc/config-manual/model_of_transitions.tex @ 949:11d8cc2deb92 1.0
merged doc/1.0
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:13:58 +0200 |
parents | 975bb59bb136 |
children |
comparison
equal
deleted
inserted
replaced
899:3f9fc88aec2b | 949:11d8cc2deb92 |
---|---|
1 \section{Model of transitions} | |
2 \subsection{Overview of Subject-Specific Configuration: From FIS, Products, States, | |
3 Transitions and SQL-statements} | |
4 | |
5 The GNV-system provides several expert information systems (FIS). Within a FIS | |
6 users can select products for analysing and visualising different | |
7 subject-specific issues like timeseries diagrams and different types of | |
8 profiles. In order to generate these products, different kind of data out of the | |
9 dataware house is needed. | |
10 | |
11 The configuration is mainly split up into two steps\footnote{Except for | |
12 integrating the MapViewer. There is a third step necessary by configuring | |
13 additional tables in the datawarehouse}: | |
14 \begin{enumerate} | |
15 \item FIS and their according products (Metainformation) | |
16 \item Products with their states, transitions, outputs and SQL-statements | |
17 (Implementation) | |
18 \end{enumerate} | |
19 | |
20 %% TODO to improve: Add a Screenshot of the GNV WebClient marking GUI elements for FIS, | |
21 %% product, states and transitions | |
22 | |
23 Main entry point for the configuration also is the file {\tt conf/conf.xml } | |
24 defining the list of FIS and the according products based on the different | |
25 datamodels in the datawarehouse. | |
26 | |
27 The provided datamodels are: | |
28 | |
29 \begin{enumerate} | |
30 \item ESRI ArcMarineBSH with following subtypes | |
31 \begin{enumerate} | |
32 \item TimeSeriesPoints | |
33 \item MeshFeatures | |
34 \item Measurements/InstantaneousPoints | |
35 \item Marine Features | |
36 \end{enumerate} | |
37 \item ESRI ArcS57, | |
38 \item CONTIS | |
39 \end{enumerate} | |
40 | |
41 Each product configuration consists of a datamodel specific configuration | |
42 organized in a product specific folder in {\tt conf/products} \footnote{The | |
43 special case of a {\tt Horizontales Schnittprofil} is configured in | |
44 {\tt conf/horizontalprofile/conf\_mesh\_cross.xml} }. The directory layout looks | |
45 like this: | |
46 | |
47 \begin{verbatim} | |
48 products/ | |
49 |-- horizontalcrosssection | |
50 | `-- conf_mesh.xml | |
51 |-- horizontalprofile | |
52 | |-- conf_instantaneouspoint.xml | |
53 | |-- conf_mesh.xml | |
54 | `-- conf_mesh_cross.xml | |
55 |-- layer | |
56 | `-- conf.xml | |
57 |-- timeseries | |
58 | |-- conf_mesh.xml | |
59 | |-- conf_timeseriespoint.xml | |
60 | `-- timegap_definition.xml | |
61 |-- verticalcrosssection | |
62 | `-- conf_mesh.xml | |
63 `-- verticalprofile | |
64 |-- conf_instantaneouspoint.xml | |
65 |-- conf_mesh.xml | |
66 `-- conf_timeseriespoint.xml | |
67 \end{verbatim} | |
68 | |
69 The subtypes of the ArcMarineBSH based datamodel are configured in the files below: | |
70 \begin{itemize} | |
71 \item TimeSeriesPoints: {\tt conf\_timeseriespoint.xml} | |
72 \item Mesh: {\tt conf\_mesh.xml} | |
73 \item InstantaneousPoints: {\tt conf\_instantaneouspoint.xml} | |
74 \end{itemize} | |
75 | |
76 Within each of these files, the steps for gathering the values for the | |
77 parameterisation are configured by defining states, transitions and outputs | |
78 (c.f. \ref{ref:config-a-product}). The definition of states, transitions and | |
79 outputs reference the actual SQL-statements via an identifier. The SQL-statements | |
80 are gathered in the file {\tt conf/queries.properties}. | |
81 | |
82 | |
83 \subsection{Background information of the XML configuration} | |
84 | |
85 It is possible to configure the GNV in many ways. | |
86 It is possible to add or remove FIS, add or remove products from a FIS or | |
87 to manipulate the steps which must be prepared until products like | |
88 a diagram or CSV-export can be generated. | |
89 | |
90 The configuration of the provided FIS are divided in three main parts. | |
91 | |
92 \begin{itemize} | |
93 \item Configuration of the list of FIS via {\tt artifact-factories} | |
94 \item Configuration of main {\tt artifacts} which will be instantiated if an | |
95 {\tt artifact-factory} was called. | |
96 \item Configuration of the different {\tt artifacts} which provides products which can be | |
97 served by the FIS. | |
98 \end{itemize} | |
99 | |
100 \subsubsection{Configuration of a FIS} | |
101 The point of entry into the system is to configure an {\tt artifact-factory}. | |
102 Each artifact-factory represents one FIS. | |
103 It is possible to configure several {\tt artifact-factories}, which | |
104 represent the list of FIS in GUI. | |
105 The {\tt artifact-factories} will be configured in the section | |
106 \texttt{/artifact-database/artifact-factories} of the configuration-file. | |
107 | |
108 \begin{lstlisting} | |
109 <artifact-factory name='fis_NEWFISNAME' | |
110 description='Factory to create an artifact to be used with the FIS NEWFISNAME' | |
111 ttl='3600000' | |
112 artifact='de.intevation.artifactdatabase.ProxyArtifact'> | |
113 de.intevation.gnv.artifacts.GNVProductArtifactFactory | |
114 </artifact-factory> | |
115 \end{lstlisting} | |
116 | |
117 At this moment the following attributes of an {\tt artifact-factory} are | |
118 configurable: | |
119 \begin{itemize} | |
120 \item {\tt name}: The name of the {\tt artifact}. Must be unique in one {\tt artifact-server} | |
121 \item {\tt description}: Short description which job the {\tt artifact-factory} has to do. | |
122 \item {\tt ttl}: The time to live: The time using milliseconds an | |
123 {\tt artifact}, created using this factory, can live without any | |
124 user-interaction. | |
125 \item {\tt artifact}: The name of the class of the {\tt artifact} which should be created. | |
126 \end{itemize} | |
127 | |
128 The next listing shows the dependencies between the FIS and the name | |
129 of the {\tt artifact-factory} which belongs to it. | |
130 | |
131 \begin{itemize} | |
132 \item Marnet: {\tt fis\_marnet} | |
133 \item IMIS: {\tt fis\_imis} | |
134 \item STAUN: {\tt fis\_staun} | |
135 \item Modeldata {\tt fis\_modeldata} | |
136 \item Iceclimatology: {\tt fis\_eisklimatologie} | |
137 \item Ice Station Report: {\tt fis\_icestations} | |
138 \item SST: {\tt fis\_sst} | |
139 \item Delphin: {\tt fis\_delphin} | |
140 \item Thermosalinograph: {\tt fis\_thermosalinograph} | |
141 \item Chemusurvey: {\tt fis\_chemusurvey} | |
142 \item GTS: {\tt fis\_gts} | |
143 \item CTD: {\tt fis\_bsh\_ctd} | |
144 \item XBT: {\tt fis\_bsh\_xbt} | |
145 \item SeaCat: {\tt fis\_seacat} | |
146 \item Sea State: {\tt fis\_seastate} | |
147 \item Current Meter: {\tt fis\_currentmeter} | |
148 \item Nauthis: {\tt fis\_nauthis} | |
149 \item Contis: {\tt fis\_contis} | |
150 \item Marine Features: {\tt fis\_marinefeatures} | |
151 \end{itemize} | |
152 | |
153 \subsubsection{Configuration of main Artifact} | |
154 For each {\tt artifact-factory} it is necessary to configure one {\tt artifact} which will be | |
155 created using the factory. | |
156 This {\tt artifact} is the representation of the specific FIS. | |
157 It contains the configuration which products will be served for this FIS. | |
158 | |
159 The {\tt artifacts} are configured in the section {\tt /artifact-database/artifacts} of | |
160 the configurationfile. | |
161 | |
162 \begin{lstlisting} | |
163 <artifact name='fis_NEWFISNAME'> | |
164 <products> | |
165 ... | |
166 </products> | |
167 </artifact> | |
168 \end{lstlisting} | |
169 | |
170 The key is to use the same name for the {\tt artifact} as used for the {\tt artifact-factory}. | |
171 The name has to be unique. | |
172 In the section {\tt /artifact/products} it is possible to define several products as | |
173 explained in the next section. | |
174 | |
175 \subsection{Products to an FIS} | |
176 One FIS can provide several products. | |
177 To do this it is required to configure them as shown below in the section | |
178 {\tt /artifact/products} | |
179 | |
180 \begin{lstlisting} | |
181 <product name= "timeSeries"> | |
182 <artifact-factory name="timeSeries" | |
183 description="Artiefactfactory for Instantiating the Artifact for TimeSeries on TimeSeriesPoints" | |
184 ttl="300000" | |
185 artifact="de.intevation.gnv.timeseries.TimeSeriesArtifact"> | |
186 de.intevation.gnv.artifacts.GNVArtifactFactory | |
187 </artifact-factory> | |
188 <parameters> | |
189 <parameter name="sourceid" | |
190 value="4"/> | |
191 <parameter name="fisname" | |
192 value="fis\_marnet"/> | |
193 </parameters> | |
194 </product> | |
195 \end{lstlisting} | |
196 | |
197 Each {\tt product} is also represented by an {\tt artifact}. In order to | |
198 create this {\tt artifact}, the {\tt artifact-factory} has to be used. | |
199 It is configured in each product | |
200 ({\tt /product/artifact-factory}). | |
201 | |
202 Each product can have several parameters ({\tt | |
203 /product/parameters/parameters}). The {\tt parameter} named {\tt | |
204 sourceid} and {\tt fisname} are required parameters. | |
205 | |
206 The parameter {\tt fisname} contains the key to the name of the FIS. The | |
207 key must be unique. The parameter {\tt sourceid} contains the key to | |
208 identify the FIS in the datawarehouse. ({\tt MEDIAN.SOURCEINFO}) | |
209 | |
210 | |
211 \subsubsection{Configuration of an Product} | |
212 \label{ref:config-a-product} | |
213 The {\tt products} of the different FIS are also modeled as artifact-objects. | |
214 The different products which are currently available are stored in separate | |
215 files in the folder {\tt project}. | |
216 | |
217 In those files the workflow of each product is configured. Each step which is | |
218 required to model a new diagram is represented using a {\tt state} in the | |
219 configuration-file. | |
220 | |
221 %% FIXME: fix wording | |
222 To move between those {\tt states} it is required to model {\tt transitions} which define | |
223 between which states it is possible to move and which conditions must be | |
224 fulfilled. | |
225 | |
226 The last step is called {\tt output-state}. This state is responsible to generate the | |
227 output for the different formats which can be served from the product ({\tt Diagram, | |
228 CSV, ODV, WMS,..}.). | |
229 | |
230 \paragraph{States} | |
231 A {\tt state} is one step which is required to fetch the data for generating e.g. an | |
232 diagram. | |
233 | |
234 For example in each product it is possible to choose one or more parameters. | |
235 | |
236 To configure a state you have to use a XML-fragment as shown below: | |
237 | |
238 \begin{lstlisting} | |
239 <state id="timeseries_parameter" description="timeseries_parameter" state="de.intevation.gnv.state.DefaultState"> | |
240 <queryID>timeseries_parameter</queryID> | |
241 <dataname>parameterid</dataname> | |
242 <data-multiselect>true</data-multiselect> | |
243 <inputvalues> | |
244 ... | |
245 </inputvalues> | |
246 </state> | |
247 \end{lstlisting} | |
248 | |
249 At this moment the following attributes of an {\tt state} are configurable. | |
250 \begin{itemize} | |
251 \item {\tt id}: The name of the artifact. Must be unique in one artifact-server | |
252 \item {\tt description}: Short description which job the artifact-factory has to do. | |
253 \item {\tt queryID}: The id of the query which should be used to fetch the data | |
254 displayed in this state. All queries are defined in the file | |
255 conf/queries.properties | |
256 \item {\tt dataname}: The id of the data which will be displayed in this state. | |
257 The id will be use to localize the description of the data. | |
258 The localization is located in module gnv-artifacts in folder | |
259 src/main/resources. | |
260 \item {\tt data-multiselect}: {\tt true} it is possible to select 1 or more items. | |
261 {\tt false} it is possible to select only one item. | |
262 \item {\tt inputvalues}: The values which can be "feed" to this state and which | |
263 will be used as values in SQL-statements. | |
264 \end{itemize} | |
265 | |
266 \paragraph{Input Values of a State} | |
267 At section {\tt /state/inputvalues} it is possible to add definitions for inputvalues. | |
268 Those values have two meanings for the {\tt state}. | |
269 | |
270 \begin{itemize} | |
271 \item They were used to fill the SQL-statements to fetch the data. | |
272 (Each entry replace one ore more "?" ) | |
273 \item They were used to validate the inputdata which is "feed" to | |
274 the FIS in the current state. | |
275 \end{itemize} | |
276 | |
277 {\bf WARNING: The order of the input-values is significant at which position the value will | |
278 be put into the SQL-statement!} | |
279 | |
280 It is possible to add one inputvalue twice or more often to put its value at | |
281 different positions of the SQL-statement. | |
282 | |
283 \begin{lstlisting} | |
284 <inputvalues> | |
285 <inputvalue name="featureid" type="Integer" multiselect="false" usedinquery="1"/> | |
286 <inputvalue name="fisname" type="String" multiselect="false" usedinquery="0"/> | |
287 <inputvalue name="parameterid" type="Integer" multiselect="true" usedinquery="0"/> | |
288 </inputvalues> | |
289 \end{lstlisting} | |
290 | |
291 \begin{itemize} | |
292 \item {\tt name}: Name of the value that could be feed or should be used in SQL-statment. | |
293 The name must fit to one dataname configured in this state or one other | |
294 state which was visited before. | |
295 \item {\tt type}: The type of the value. This is required for the validation | |
296 of the value. | |
297 This might be String, Integer, Double, Date, Point, LineString, | |
298 Polygon, Coordinate, Geometry and AttributeName. \\ | |
299 Coordinate is a format which accepts geographical coordinates in | |
300 the following Syntax: 56n30 6e20 \\ | |
301 AttributeName marks a stringvalue which will be used in | |
302 SQL-statement without surrounding with "'" in the statement. | |
303 Usage is e.g. for determining the Axis (i or j) in the workflow | |
304 of Horizontalprofiles. | |
305 \item {\tt multiselect}: true if more than on value can be feed or put into the SQL-statement. | |
306 false if one on value will be accepted. | |
307 \item {\tt usedinquery}: Number how often the value should be put into the SQL-statement: | |
308 0: Value will not out into the statement. | |
309 1: Value will put once into the statement, | |
310 2 or more: Value will be put as often as configured | |
311 into the SQL-statement (this is useful if | |
312 inner-selects are used) | |
313 \end{itemize} | |
314 | |
315 The next part will explain the usage of inputvalues. | |
316 | |
317 This SQL-statement is configured to use in the state above, which will fetch | |
318 all parameter-ids with the according german name which are reffered to the given | |
319 TimeSeriesPoint (e.g.Arkona Basin Buoy FeatureID = 100011 ) | |
320 | |
321 | |
322 \begin{lstlisting} | |
323 SELECT DISTINCT | |
324 p.PARAMETERID KEY, | |
325 p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, | |
326 p.GERMANNAME | |
327 FROM MEDIAN.PARAMETER P, | |
328 MEDIAN.TIMESERIES TS, | |
329 MEDIAN.TIMESERIESVALUE TSV, | |
330 MEDIAN.MEASUREMENT M, | |
331 MEDIAN.TIMESERIESPOINT TSP | |
332 WHERE M.FEATUREID = TSP.FEATUREID AND | |
333 M.MEASUREMENTID = TSV.MEASUREMENTID AND | |
334 TS.TIMESERIESID = TSV.TIMESERIESID AND | |
335 P.PARAMETERID = TS.PARAMETERID AND | |
336 TSP.FEATUREID = ? | |
337 ORDER BY P.GERMANNAME | |
338 \end{lstlisting} | |
339 | |
340 Including inputvalues, the example for choosing the FIS ({\tt fisname}) | |
341 and the Station 342 ({\tt featureid}: Arkona Basin Buoy) will look like | |
342 this: | |
343 \begin{itemize} | |
344 \item {\tt featureid}: 100011 (Marnet $\rightarrow$ Arkona Basin Buoy) | |
345 \item {\tt fisname}: fis\_marnet | |
346 \item {\tt parameterid}: not set because it's the value that should be | |
347 chosen in this state. | |
348 \end{itemize} | |
349 | |
350 \begin{lstlisting} | |
351 SELECT DISTINCT | |
352 p.PARAMETERID KEY, | |
353 p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, | |
354 p.GERMANNAME | |
355 FROM MEDIAN.PARAMETER P, | |
356 MEDIAN.TIMESERIES TS, | |
357 MEDIAN.TIMESERIESVALUE TSV, | |
358 MEDIAN.MEASUREMENT M, | |
359 MEDIAN.TIMESERIESPOINT TSP | |
360 WHERE M.FEATUREID = TSP.FEATUREID AND | |
361 M.MEASUREMENTID = TSV.MEASUREMENTID AND | |
362 TS.TIMESERIESID = TSV.TIMESERIESID AND | |
363 P.PARAMETERID = TS.PARAMETERID AND | |
364 TSP.FEATUREID = 100011 | |
365 ORDER BY P.GERMANNAME | |
366 \end{lstlisting} | |
367 | |
368 The value of {\tt featureid} will be inserted into the query because | |
369 the attribute {\tt usedinquery} is set to "1". | |
370 | |
371 The values of the inputvalues {\tt fisname} and {\tt parameterid} will be | |
372 excluded because the attribute {\tt usedinquery} is set to "0" | |
373 | |
374 | |
375 If the attribute {\tt usedinquery} of the inputvalue {\tt featureid} is set to "2" | |
376 this might happen. | |
377 | |
378 \begin{lstlisting} | |
379 <inputvalues> | |
380 <inputvalue name="featureid" type="Integer" multiselect="false" usedinquery="2"/> | |
381 <inputvalue name="fisname" type="String" multiselect="false" usedinquery="0"/> | |
382 <inputvalue name="parameterid" type="Integer" multiselect="true" usedinquery="0"/> | |
383 </inputvalues> | |
384 \end{lstlisting} | |
385 | |
386 \begin{lstlisting} | |
387 SELECT DISTINCT | |
388 ... | |
389 TSP.FEATUREID = ? AND | |
390 TSP.FEATUREID = ? | |
391 ORDER BY P.GERMANNAME | |
392 \end{lstlisting} | |
393 | |
394 This SQL-statement will be modified to | |
395 | |
396 \begin{lstlisting} | |
397 SELECT DISTINCT | |
398 ... | |
399 TSP.FEATUREID = 100011 AND | |
400 TSP.FEATUREID = 100011 | |
401 ORDER BY P.GERMANNAME | |
402 \end{lstlisting} | |
403 | |
404 | |
405 At the next step of the workflow it is nessesary to determine all depths where | |
406 the choosen parameters are measured. | |
407 To do this we might have the following inputvalues: | |
408 | |
409 \begin{lstlisting} | |
410 <inputvalues> | |
411 <inputvalue name="featureid" type="Integer" multiselect="false" usedinquery="2"/> | |
412 <inputvalue name="fisname" type="String" multiselect="false" usedinquery="0"/> | |
413 <inputvalue name="parameterid" type="Integer" multiselect="true" usedinquery="1"/> | |
414 <inputvalue name="measurementid" type="Integer" multiselect="true" usedinquery="0"/> | |
415 </inputvalues> | |
416 \end{lstlisting} | |
417 | |
418 \begin{itemize} | |
419 \item {\tt featureid}: 100011 (Marnet $\rightarrow$ Arkona Basin Buoy) | |
420 \item {\tt fisname}: fis\_marnet | |
421 \item {\tt parameterid}: 2 (Salzgehalt [pSal]) | |
422 \item {\tt measurementid}: not set because it's the value that should be | |
423 chosen in this state. | |
424 \end{itemize} | |
425 | |
426 \begin{lstlisting} | |
427 SELECT DISTINCT | |
428 M.MEASUREMENTID KEY, | |
429 M.ZLOCATION VALUE, | |
430 P.PARAMETERID PARAMETERID | |
431 FROM MEDIAN.MEASUREMENT M, | |
432 MEDIAN.TIMESERIESVALUE TSV, | |
433 MEDIAN.TIMESERIES T, | |
434 MEDIAN.PARAMETER P | |
435 WHERE M.MEASUREMENTID = TSV.MEASUREMENTID AND | |
436 TSV.TIMESERIESID = T.TIMESERIESID AND | |
437 T.PARAMETERID = P.PARAMETERID AND | |
438 M.FEATUREID = ? AND | |
439 M.FEATUREID = ? AND | |
440 P.PARAMETERID IN (?) | |
441 ORDER BY m.ZLOCATION DESC | |
442 \end{lstlisting} | |
443 | |
444 This SQL-statement will be modified to | |
445 | |
446 \begin{lstlisting} | |
447 SELECT DISTINCT | |
448 M.MEASUREMENTID KEY, | |
449 M.ZLOCATION VALUE, | |
450 P.PARAMETERID PARAMETERID | |
451 FROM MEDIAN.MEASUREMENT M, | |
452 MEDIAN.TIMESERIESVALUE TSV, | |
453 MEDIAN.TIMESERIES T, | |
454 MEDIAN.PARAMETER P | |
455 WHERE M.MEASUREMENTID = TSV.MEASUREMENTID AND | |
456 TSV.TIMESERIESID = T.TIMESERIESID AND | |
457 T.PARAMETERID = P.PARAMETERID AND | |
458 M.FEATUREID = 100011 AND | |
459 M.FEATUREID = 100011 AND | |
460 P.PARAMETERID IN (2) | |
461 ORDER BY m.ZLOCATION DESC | |
462 \end{lstlisting} | |
463 | |
464 The queries which are shown above are configurable. | |
465 Configuring takes place in the \\ file \texttt{queries.properties } which will | |
466 be explained in the next paragraph. | |
467 | |
468 \paragraph{Query-configuration (queries.properties)} | |
469 \label{ref:queries.properties} | |
470 | |
471 This file contains key-value-pairs to define SQL-statements. | |
472 All queries will be handle using the prepared-statement-syntax using "?" | |
473 to define a place where an dynamic value should be placed into the statement. | |
474 | |
475 There is one special implementation to support spatial access to the | |
476 {\tt ESRI ArcSDE}-database. This mechanism is used to realize the access to spatial- | |
477 objects. | |
478 | |
479 All queries containing the following literals will be handled separatly | |
480 using the ESRI ArcSDE-API. | |
481 | |
482 \begin{itemize} | |
483 \item {\tt ST\_ASTEXT(SHAPE)}: Will return the geometry as an WellKnowText (WKT) | |
484 \item {\tt ST\_ASTEXT(RASTER)}: Will return the raster in an readable way. | |
485 \item {\tt INTERSECTS(SHAPE,"?")}: Will only return the elements which geometry | |
486 intersects the given geometry ("?" will be | |
487 replace with an WKT) | |
488 \end{itemize} | |
489 | |
490 | |
491 \paragraph{Transitions} | |
492 | |
493 To move between two states it is necessary to configure dependencies | |
494 between the different states. This dependencies are called {\tt | |
495 transitions}. | |
496 | |
497 There are different kinds of {\tt transitions} which can be used. | |
498 \begin{itemize} | |
499 \item Transitions which only link two states | |
500 \item Transition which link two states with a additional condition. | |
501 (e.g. If a region was selected in the Regionfilter or not ) | |
502 \end{itemize} | |
503 | |
504 The listing below shows a transition with an additional condition. | |
505 \begin{lstlisting} | |
506 <transition transition="de.intevation.gnv.transition.ValueCompareTransition"> | |
507 <from state="timeseries_area"/> | |
508 <to state="timeseries_without_geom"/> | |
509 <condition inputvalue="areaid" value="n/n" operator="equal"/> | |
510 </transition> | |
511 \end{lstlisting} | |
512 | |
513 \begin{itemize} | |
514 \item {\tt from}: The {\tt id} of the {\tt state} which you have to come from | |
515 \item {\tt to}: The {\tt id} of the {\tt state} which can be reached. | |
516 \item {\tt condition}: The condition which have to be fulfilled. | |
517 \end{itemize} | |
518 | |
519 At this moment only {\tt EQUAL} and {\tt NOTEQUAL} are supported as | |
520 {\tt condition} for an {\tt ValueCompare\-Transition}. | |
521 | |
522 \paragraph{Outputstate} | |
523 | |
524 The {\tt outputstate} is a special {\tt state} which was created to define | |
525 the different possibilities of outputs for each product. | |
526 An {\tt outputstate} is handled as a {\tt state} which is described above. | |
527 Additionally you are able to configure which kind of outputs should | |
528 be provided. | |
529 | |
530 There are several {\tt outputstates}. Each one is designed to create | |
531 the output for one special product. | |
532 | |
533 \begin{itemize} | |
534 \item TimeSeries: {\tt TimeSeriesOutputState} | |
535 \item Horizontalprofile: {\tt HorizontalProfileOutputState} | |
536 \item Horizontalprofile on Meshes: {\tt HorizontalProfileMeshOutputState} | |
537 \item Verticalcrosssection: {\tt VerticalCrossSectionOutputState} | |
538 \item Verticalprofiles: {\tt VerticalProfileOutputState} | |
539 \item Horizontalcrosssections: {\tt HorizontalCrossSectionMeshOutputState} | |
540 \item Layer: {\tt LayerOutputState} | |
541 \end{itemize} | |
542 | |
543 All these outputstates are implemented in {\tt package de.intevation.gnv.state} | |
544 and its {\tt sub\-packages}. | |
545 | |
546 The fullqualified name of the {\tt outputstate} to the attribute | |
547 {\tt state} is shown below. | |
548 | |
549 An example for an {\tt outputstate}: | |
550 | |
551 \begin{lstlisting} | |
552 <state id="timeseries_calculate_results" description="timeseries_interval" state="de.intevation.gnv.state.timeseries.TimeSeriesOutputState"> | |
553 <queryID>timeseries_chart_data</queryID> | |
554 ... | |
555 <outputsModes> | |
556 <outputsMode name="chart" description="Chartrepresentation of the Values" mime-type="image/png"> | |
557 ... | |
558 </outputsMode> | |
559 </outputsModes> | |
560 </state> | |
561 \end{lstlisting} | |
562 | |
563 At section {\tt /state/outputsModes} it is possible to add one ore more | |
564 {\tt outputmodes} to one state as shown in the next paragraph. | |
565 | |
566 \paragraph{OutputModes} | |
567 | |
568 It is possible to configure several {\tt outputmodes} in one {\tt outputstate}. | |
569 Inserting or deleting the configuration of a special | |
570 {\tt outputmode} will control if an item in the GUI will be displayed. | |
571 | |
572 {\bf | |
573 WARNING: IT MIGHT BE POSSIBLE THAT ONE OR MORE OUTPUTMODES ARE NOT | |
574 SUPPORTED BY AN PRODUCT. IN THAT CASE IT IS NECESSARY TO | |
575 IMPLEMENT THE REQUIRED FUNCTIONALITY BEFORE IT IS POSSIBLE | |
576 TO OFFER THIS OUTPUTMODE. | |
577 } | |
578 | |
579 Currently the following {\tt outputmodes} are supported: | |
580 | |
581 \begin{itemize} | |
582 \item {\tt chart} | |
583 \item {\tt histogram} | |
584 \item {\tt csv} | |
585 \item {\tt odv} | |
586 \item {\tt statistics} | |
587 \item {\tt wms} | |
588 \item {\tt shapefile} | |
589 \end{itemize} | |
590 | |
591 The following example shows how to configure an {\tt outputmode chart}: | |
592 | |
593 \begin{lstlisting} | |
594 <outputsMode name="chart" description="Chartrepresentation of the Values" mime-type="image/png"> | |
595 <parameters> | |
596 <inputvalue name="width" type="Integer" value="600"/> | |
597 <inputvalue name="height" type="Integer" value="400"/> | |
598 <inputvalue name="points" type="Boolean" value="false"/> | |
599 </parameters> | |
600 <exportModes> | |
601 <export name="img" description="IMG-Export der Daten" mime-type="image/png" /> | |
602 <export name="pdf" description="PDF-Export der Daten" mime-type="application/pdf" /> | |
603 <export name="svg" description="SVG-Export der Daten" mime-type="image/svg+xml" /> | |
604 </exportModes> | |
605 </outputsMode> | |
606 \end{lstlisting} | |
607 | |
608 | |
609 \begin{itemize} | |
610 \item {\tt name}: The name of the mode. This must not be changed because it | |
611 is used by the program. | |
612 \item {\tt description}: a short description of this outputmode. | |
613 \item {\tt parameters}: one ore more parameters which will be shown in the | |
614 GUI e.g. for changing the size of an chart. | |
615 \item {\tt exportModes} : one or more formats which can be served. | |
616 \end{itemize} | |
617 | |
618 | |
619 \section{Adding a new FIS} | |
620 In this section it will be explained which steps have to be done to integrate a | |
621 new FIS into the {\tt artifact-server}. This will be done using the configuration for | |
622 a FIS which uses data from the table {\tt MEDIAN.TIMESERIES} section of | |
623 the datawarehouse (e.g. MARNET or STAUN). | |
624 | |
625 For publishing the changes to the {\tt artifact-server}, it needs to be | |
626 restarted. | |
627 | |
628 \subsection{Adding a new Artifact-factory} | |
629 First step is to add a new {\tt artifact-factory} to the configuration conf/conf.xml | |
630 To do this you have to add a new XML-fragment into the section | |
631 /factories/artifact-factories which look like that: | |
632 | |
633 \begin{lstlisting} | |
634 <artifact-factory name='fis_NEWFISNAME' | |
635 description='Factory to create an artifact to be used with the FIS NEWFISNAME' | |
636 ttl='3600000' | |
637 artifact='de.intevation.artifactdatabase.ProxyArtifact'> | |
638 de.intevation.gnv.artifacts.GNVProductArtifactFactory | |
639 </artifact-factory> | |
640 \end{lstlisting} | |
641 | |
642 In this XML-fragment you only have to replace the placeholder {\tt NEWFISNAME} | |
643 with a unique short name for the new FIS. | |
644 | |
645 \paragraph*{Example} | |
646 This example shows how to add a FIS and illustrates the effect on the | |
647 artifact-server's output. | |
648 | |
649 First , the following {\tt artifact-factory} has to be added into the file | |
650 {\tt conf/conf.xml} in section {\tt /artifact-database/artifact-factories} | |
651 adding a new FIS called {\tt justanewfis} to the server: | |
652 | |
653 \begin{lstlisting} | |
654 <artifact-factory name='fis_justanewfis' | |
655 description='Factory to create an artifact to be used with the FIS NEWFISNAME' | |
656 ttl='3600000' | |
657 artifact='de.intevation.artifactdatabase.ProxyArtifact'> | |
658 de.intevation.gnv.artifacts.GNVProductArtifactFactory | |
659 </artifact-factory> | |
660 \end{lstlisting} | |
661 | |
662 Restart the {\tt artifact-database} executing: | |
663 | |
664 \begin{lstlisting} | |
665 /etc/init.d/artifact-server restart | |
666 \end{lstlisting} | |
667 | |
668 Checking if the new FIS is served by the REST-Server | |
669 calling the following command: | |
670 | |
671 \begin{lstlisting} | |
672 curl http://localhost:8181/factories | xmllint --format - | grep fis_justanewfis | |
673 \end{lstlisting} | |
674 | |
675 If the FIS was added, the new {\tt artifact-factory} will be found in the generated | |
676 XML-output. Otherwise no XML-output will be shown. | |
677 | |
678 \subsection{Adding a new Artifact for Artifact-factory} | |
679 The next step is to define the artifact itself. | |
680 For this it is necessary to add an XML-fragment into the section | |
681 {\tt /artifacts} of the main configurationfile {\tt /conf/conf.xml}. | |
682 | |
683 \begin{lstlisting} | |
684 <artifact name='fis_NEWFISNAME'> | |
685 <products> | |
686 ... | |
687 </products> | |
688 </artifact> | |
689 \end{lstlisting} | |
690 | |
691 In this XML-fragment it is also required to replace the placeholder {\tt NEWFISNAME} | |
692 with the name which was used to configure the {\tt artifact-factory}. | |
693 | |
694 Now the {\tt artifact-server} can handle an additional FIS without any products yet. | |
695 | |
696 To prevent needless configuration-work, it is a useful way to clone an | |
697 existing artifact handling the same kind of work. | |
698 | |
699 | |
700 \paragraph*{Example} | |
701 Now will an artifact to the FIS {\tt fis\_justanewfis}, will be configured. | |
702 | |
703 The following XML-fragment has to be added to the file | |
704 {\tt conf/conf.xml} in section {\tt /artifact-database/artifacts}: | |
705 | |
706 \begin{lstlisting} | |
707 <artifact name='fis_justanewfis'> | |
708 <products> | |
709 </products> | |
710 </artifact> | |
711 \end{lstlisting} | |
712 | |
713 Restart the artifact-server | |
714 | |
715 \begin{lstlisting} | |
716 /etc/init.d/artifact-server restart | |
717 \end{lstlisting} | |
718 | |
719 Now it should be possible to choose the artifact. | |
720 | |
721 The listbox in the GUI would be empty. | |
722 \begin{lstlisting} | |
723 curl -d "@sample-documents/create-artifact.xml" http://localhost:8181/create | xmllint --format - | |
724 \end{lstlisting} | |
725 | |
726 \subsection{Adding/Removing Products to the Specific Artifact} | |
727 Next step is, to configure the different products which the FIS should | |
728 be able to provide. To do this it is necessary to copy the | |
729 XML-fragments of the products into the XML-element {\tt products} of the | |
730 previously integrated artifact. | |
731 | |
732 \begin{lstlisting} | |
733 <artifact name='fis_NEWFISNAME'> | |
734 <products> | |
735 <product name= "timeSeries"> | |
736 <artifact-factory name="timeSeries" | |
737 description="Artifactfactory for instantiating the artifact for TimeSeries on TimeSeriesPoints" | |
738 ttl="300000" | |
739 artifact="de.intevation.gnv.timeseries.TimeSeriesArtifact"> | |
740 de.intevation.gnv.artifacts.GNVArtifactFactory | |
741 </artifact-factory> | |
742 <parameters> | |
743 <parameter name="sourceid" | |
744 value="VALUEOFSOURCEID"/> | |
745 <parameter name="fisname" | |
746 value="fis\_NEWFISNAME"/> | |
747 </parameters> | |
748 </product> | |
749 <product name= "verticalProfile"> | |
750 <artifact-factory name="verticalProfile" | |
751 description="Artifactfactory for instantiating the artifact for Verticalprofiles on TimeSeriesPoints" | |
752 ttl="300000" | |
753 artifact="de.intevation.gnv.profile.vertical.VerticalProfileArtifact"> | |
754 de.intevation.gnv.artifacts.GNVArtifactFactory | |
755 </artifact-factory> | |
756 <parameters> | |
757 <parameter name="sourceid" | |
758 value="VALUEOFSOURCEID"/> | |
759 <parameter name="fisname" | |
760 value="fis\_NEWFISNAME"/> | |
761 </parameters> | |
762 </product> | |
763 </products> | |
764 </artifact> | |
765 \end{lstlisting} | |
766 | |
767 In this XML-fragment the placeholders {\tt NEWFISNAME} have to be | |
768 replaced. The source-id \texttt{VALUEOFSOURCEID} with the value for the new | |
769 FIS as defined in the table {\tt MEDIAN.SOURCEINFO} needs to be added. | |
770 | |
771 \paragraph*{Example} | |
772 Adding a product to the new FIS, choosing sourceid of an existing FIS | |
773 (e.g 4 $\rightarrow$ Marnet). | |
774 | |
775 Add the following XML-fragment to the new artifact. | |
776 \begin{lstlisting} | |
777 <product name= "timeSeries"> | |
778 <artifact-factory name="timeSeries" | |
779 description="Artifactfactory for instantiating the artifact for TimeSeries on TimeSeriesPoints" | |
780 ttl="300000" | |
781 artifact="de.intevation.gnv.timeseries.TimeSeriesArtifact"> | |
782 de.intevation.gnv.artifacts.GNVArtifactFactory | |
783 </artifact-factory> | |
784 <parameters> | |
785 <parameter name="sourceid" | |
786 value="4"/> | |
787 <parameter name="fisname" | |
788 value="fis\_justanewfis"/> | |
789 </parameters> | |
790 </product> | |
791 \end{lstlisting} | |
792 | |
793 Restart the artifact-server | |
794 | |
795 \begin{lstlisting} | |
796 /etc/init.d/artifact-server restart | |
797 \end{lstlisting} | |
798 | |
799 If | |
800 \begin{lstlisting} | |
801 curl -d "@sample-documents/create-artifact.xml" http://localhost:8181/create | xmllint --format - | |
802 \end{lstlisting} | |
803 | |
804 is called, the product {\tt timeSeries} should be available for the FIS {\tt justanewfis}. | |
805 | |
806 Now, it should be able to choose the product. | |
807 This product including the definied outputformats should be available in | |
808 the GUI. | |
809 | |
810 \subsection{Adding a new Product} | |
811 To add a new product to the system it is necessary that the required | |
812 artifact representation is implemented in the {\tt sourcecode}. | |
813 Without doing that step it is not possible to create a new product. | |
814 | |
815 All products are configured in separated files that will be included into the | |
816 main configuration using Xlink-references. | |
817 | |
818 First step is to create a new file in the folder {\tt products} and in the | |
819 sub-folder where the product belongs to ({\tt timeseries,verticalprofile, | |
820 horizontalprofile,horizontal\-crosssection,layer,...}) | |
821 | |
822 Then the new product can be referenced in the file {\tt /conf/conf.xml} in the | |
823 section {\tt/artifacts} using the following XML-fragment. | |
824 | |
825 \begin{lstlisting} | |
826 <artifact name="timeSeries" | |
827 xmlns:xlink="http://www.w3.org/1999/xlink" | |
828 xlink:href="${artifacts.config.dir}/products/PATHTOFILE" /> | |
829 \end{lstlisting} | |
830 | |
831 The placeholder {\tt PATHTOFILE} has to be replaced with the relative path and | |
832 the name of the file starting in the folder products. | |
833 | |
834 Then it is possible to add the product to a FIS as explained in the next section. | |
835 Please note that the defined name of the {\tt artifact-factory} has to match to the | |
836 name of the added products which is also designed as an artifact. | |
837 | |
838 \subsection{Adding an additional Product to a FIS} | |
839 To add an additional product to a FIS the XML-fragment which | |
840 represents the product to the artifact-configuration of the FIS in section | |
841 {\tt /artifacts/artifact/products} needs to be added. | |
842 | |
843 \begin{lstlisting} | |
844 <product name= "timeSeries"> | |
845 <artifact-factory name="timeSeries" | |
846 description="Artifactfactory for instantiating the artifact for TimeSeries on TimeSeriesPoints" | |
847 ttl="300000" | |
848 artifact="de.intevation.gnv.timeseries.TimeSeriesArtifact"> | |
849 de.intevation.gnv.artifacts.GNVArtifactFactory | |
850 </artifact-factory> | |
851 <parameters> | |
852 <parameter name="sourceid" | |
853 value="VALUEOFSOURCEID"/> | |
854 <parameter name="fisname" | |
855 value="fis\_NEWFISNAME"/> | |
856 </parameters> | |
857 </product> | |
858 \end{lstlisting} | |
859 | |
860 Please note that the placeholders have to be explained above. |