Mercurial > dive4elements > gnv-client
comparison doc/config-manual/model_of_transitions.tex @ 920:63bc0044ff72
Fixed some typos. Do some document-styling
doc/trunk@1055 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 04 May 2010 14:10:35 +0000 |
parents | 29a4a1a99a22 |
children | 4615bc4dc822 |
comparison
equal
deleted
inserted
replaced
919:29a4a1a99a22 | 920:63bc0044ff72 |
---|---|
15 \item FIS and their according products (Metainformation) | 15 \item FIS and their according products (Metainformation) |
16 \item products with their states, transitions, outputs and SQL-statements | 16 \item products with their states, transitions, outputs and SQL-statements |
17 (Implementation) | 17 (Implementation) |
18 \end{enumerate} | 18 \end{enumerate} |
19 | 19 |
20 %% TODO: Add a screenshoot of the GNV WebClient marking GUI elements for FIS, | 20 %% TODO: Add a Screenshot of the GNV WebClient marking GUI elements for FIS, |
21 %% product, states and transitions | 21 %% product, states and transitions |
22 | 22 |
23 Main entry point for the configuration is the file \verb+ conf/conf.xml + | 23 Main entry point for the configuration is the file \verb+ conf/conf.xml + |
24 defining the list of FIS and the according products based on the different | 24 defining the list of FIS and the according products based on the different |
25 datamodels in the datawarehouse. The provided datamodels are: | 25 datamodels in the datawarehouse. The provided datamodels are: |
71 \item InstantaneousPoints: conf\_instantaneouspoint.xml | 71 \item InstantaneousPoints: conf\_instantaneouspoint.xml |
72 \end{itemize} | 72 \end{itemize} |
73 | 73 |
74 Within each of these files, the steps for gathering the values for the | 74 Within each of these files, the steps for gathering the values for the |
75 parameterisation are configured by defining states, transitions and outputs | 75 parameterisation are configured by defining states, transitions and outputs |
76 (c.f. \ref{ref:config-a-product}). The defintion of states, transitions and | 76 (c.f. \ref{ref:config-a-product}). The definition of states, transitions and |
77 outputs reference the actual SQL-statements via identifier. The SQL-statements | 77 outputs reference the actual SQL-statements via identifier. The SQL-statements |
78 are gathered in the file \verb+conf/queries.txt+. | 78 are gathered in the file \verb+conf/queries.txt+. |
79 | 79 |
80 | 80 |
81 \subsection{General principle of model of transitions} | 81 \subsection{General principle of model of transitions} |
82 | 82 |
83 It is possible to configure the GNV in many ways. | 83 It is possible to configure the GNV in many ways. |
84 It is possible to add or remove FIS, add or remove Products from a FIS or | 84 It is possible to add or remove FIS, add or remove Products from a FIS or |
85 to manipulate the steps which must be gone until a product can be create | 85 to manipulate the steps which must be gone until a product can be create |
86 a diagramm or generate an CSV-Export. | 86 a diagram or generate an CSV-Export. |
87 | 87 |
88 The configuration of the provided FIS are devided in three main parts. | 88 The configuration of the provided FIS are divided in three main parts. |
89 | 89 |
90 \begin{itemize} | 90 \begin{itemize} |
91 \item Configuration of the list of FIS via Artifactfactories | 91 \item Configuration of the list of FIS via Artifactfactories |
92 \item Configuration of main Artifacts which will be instantiated if an | 92 \item Configuration of main Artifacts which will be instantiated if an |
93 Artifactfactory was called. | 93 Artifactfactory was called. |
94 \item Configuration of the different Artifacts which provides Products which can be | 94 \item Configuration of the different Artifacts which provides Products which can be |
95 served by the FIS. | 95 served by the FIS. |
96 \end{itemize} | 96 \end{itemize} |
97 | 97 |
98 \subsubsection{Configuration of a FIS} | 98 \subsubsection{Configuration of a FIS} |
99 The Point of Enty into the system is to configure an Artifactfactory. | 99 The Point of Entry into the system is to configure an Artifactfactory. |
100 Each Artifactfactory represents one FIS. | 100 Each Artifactfactory represents one FIS. |
101 It is possible to configure several Artifactfactories. | 101 It is possible to configure several Artifactfactories. |
102 The Artifactfactories will be configured in the Section | 102 The Artifactfactories will be configured in the Section |
103 /artifact-database/artifact-factories of the Configurationfile. | 103 /artifact-database/artifact-factories of the Configurationfile. |
104 | 104 |
109 artifact='de.intevation.artifactdatabase.ProxyArtifact'> | 109 artifact='de.intevation.artifactdatabase.ProxyArtifact'> |
110 de.intevation.gnv.artifacts.GNVProductArtifactFactory | 110 de.intevation.gnv.artifacts.GNVProductArtifactFactory |
111 </artifact-factory> | 111 </artifact-factory> |
112 \end{lstlisting} | 112 \end{lstlisting} |
113 | 113 |
114 At this moment the following Attributes of an Artifact-Factory are configurabel. | 114 At this moment the following Attributes of an Artifact-Factory are configurable. |
115 \begin{itemize} | 115 \begin{itemize} |
116 \item name: The Name of the Artifact. Must be unique in one Artifact-Server | 116 \item name: The Name of the Artifact. Must be unique in one Artifact-Server |
117 \item description: Short description which Job the Artifactfactory has to do. | 117 \item description: Short description which Job the Artifactfactory has to do. |
118 \item ttl: The Time to Live: The Time using Milliseconds an Artifact, created using this | 118 \item ttl: The Time to Live: The Time using Milliseconds an Artifact, created using this |
119 factory, can live without any Userinteraction. | 119 factory, can live without any User interaction. |
120 \item artifact: The Name of the Class of the Artifact which should be created. | 120 \item artifact: The Name of the Class of the Artifact which should be created. |
121 \end{itemize} | 121 \end{itemize} |
122 | 122 |
123 The next listing shows the dependencies between the FIS and the Name | 123 The next listing shows the dependencies between the FIS and the Name |
124 of the Artifactfactory which belongs to it. | 124 of the Artifactfactory which belongs to it. |
147 | 147 |
148 \subsubsection{Configuration of main Artifact} | 148 \subsubsection{Configuration of main Artifact} |
149 For each Artifact-Factory it is necessary to configure one Artifact which will be | 149 For each Artifact-Factory it is necessary to configure one Artifact which will be |
150 created using the Factory. | 150 created using the Factory. |
151 This Artifact is the representation of the specific FIS. | 151 This Artifact is the representation of the specific FIS. |
152 It contains the Configuration which products will be serverd for ths FIS. | 152 It contains the Configuration which products will be served for this FIS. |
153 | 153 |
154 The Artifacts are configured in the Section /artifact-database/artifacts of | 154 The Artifacts are configured in the Section /artifact-database/artifacts of |
155 the Configurationfile. | 155 the Configurationfile. |
156 | 156 |
157 \begin{lstlisting} | 157 \begin{lstlisting} |
203 | 203 |
204 | 204 |
205 \subsubsection{Configuration of an Product} | 205 \subsubsection{Configuration of an Product} |
206 \label{ref:config-a-product} | 206 \label{ref:config-a-product} |
207 The Products of the different FIS are also modeled as Artifact-Objects. | 207 The Products of the different FIS are also modeled as Artifact-Objects. |
208 The different Products which are currently avaliable are stored in separate | 208 The different Products which are currently available are stored in separate |
209 Files in the Folder project. | 209 Files in the Folder project. |
210 | 210 |
211 In those Files the Workflow of each product is configured. Each step which is | 211 In those Files the Workflow of each product is configured. Each step which is |
212 required to model a new Diagramm is represented using a state in the | 212 required to model a new diagram is represented using a state in the |
213 Configuration-File. | 213 Configuration-File. |
214 | 214 |
215 To move between those States it is required to model Transitions which define | 215 To move between those States it is required to model Transitions which define |
216 between which States it is possible to move and which conditions must be | 216 between which States it is possible to move and which conditions must be |
217 fulfilled. | 217 fulfilled. |
218 | 218 |
219 The Last step is called OutputState. This State is responsible to generate the | 219 The Last step is called OutputState. This State is responsible to generate the |
220 output for the different Formats which can be served from the Product (Diagramm, | 220 output for the different Formats which can be served from the Product (Diagram, |
221 CSV, ODV, WMS,...). | 221 CSV, ODV, WMS,...). |
222 | 222 |
223 \paragraph{States} | 223 \paragraph{States} |
224 A state is one Step which is required to fetch the Data for generating e.g. an | 224 A state is one Step which is required to fetch the Data for generating e.g. an |
225 Diagramm. | 225 Diagram. |
226 | 226 |
227 For example in each Product it is Possible to choose one or more Parameters. | 227 For example in each Product it is Possible to choose one or more Parameters. |
228 | 228 |
229 To configure a State you have to use a XML-Fragment as shown below: | 229 To configure a State you have to use a XML-Fragment as shown below: |
230 | 230 |
237 ... | 237 ... |
238 </inputvalues> | 238 </inputvalues> |
239 </state> | 239 </state> |
240 \end{lstlisting} | 240 \end{lstlisting} |
241 | 241 |
242 At this moment the following Attributes of an Artifact-Factory are configurabel. | 242 At this moment the following Attributes of an Artifact-Factory are configurable. |
243 \begin{itemize} | 243 \begin{itemize} |
244 \item id: The Name of the Artifact. Must be unique in one Artifact-Server | 244 \item id: The Name of the Artifact. Must be unique in one Artifact-Server |
245 \item description: Short description which Job the Artifactfactory has to do. | 245 \item description: Short description which Job the Artifactfactory has to do. |
246 \item queryID: The ID of the Query which should be used to fetch the Data | 246 \item queryID: The ID of the Query which should be used to fetch the Data |
247 displayed in this state. //TODO: Reference to queries.properties | 247 displayed in this state. All Queries are defined in the File |
248 \item dataname: The ID of the Data which will be displaied in this State. | 248 conf/queries.properties |
249 \item dataname: The ID of the Data which will be displayed in this State. | |
249 The ID will be use to localize the description of the Data. | 250 The ID will be use to localize the description of the Data. |
250 \item data-multiselect: true it is possible to select 1 or more Items. | 251 \item data-multiselect: true it is possible to select 1 or more Items. |
251 false ist is possible to select only one Item. | 252 false it is possible to select only one Item. |
252 \item inputvalues: The Values which can be "feed" to this State and which | 253 \item inputvalues: The Values which can be "feed" to this State and which |
253 will be used as Values in SQL-statements. | 254 will be used as Values in SQL-statements. |
254 \end{itemize} | 255 \end{itemize} |
255 | 256 |
256 \paragraph{Input Values of a State} | 257 \paragraph{Input Values of a State} |
266 | 267 |
267 WARNING: The Order of the InputValues is significant at which position the Value will | 268 WARNING: The Order of the InputValues is significant at which position the Value will |
268 be put into the SQL-Statement. | 269 be put into the SQL-Statement. |
269 | 270 |
270 It is possible to add one InputValue twice or more often to put its value at | 271 It is possible to add one InputValue twice or more often to put its value at |
271 different positions of the SQl-Statement. | 272 different positions of the SQL-statement. |
272 | 273 |
273 \begin{lstlisting} | 274 \begin{lstlisting} |
274 <inputvalues> | 275 <inputvalues> |
275 <inputvalue name="featureid" type="Integer" multiselect="false" usedinquery="1"/> | 276 <inputvalue name="featureid" type="Integer" multiselect="false" usedinquery="1"/> |
276 <inputvalue name="fisname" type="String" multiselect="false" usedinquery="0"/> | 277 <inputvalue name="fisname" type="String" multiselect="false" usedinquery="0"/> |
277 <inputvalue name="parameterid" type="Integer" multiselect="true" usedinquery="0"/> | 278 <inputvalue name="parameterid" type="Integer" multiselect="true" usedinquery="0"/> |
278 </inputvalues> | 279 </inputvalues> |
279 \end{lstlisting} | 280 \end{lstlisting} |
280 | 281 |
281 \begin{itemize} | 282 \begin{itemize} |
282 \item name: Name of the Value that could be feed or should be used in SQl-statment. | 283 \item name: Name of the Value that could be feed or should be used in SQL-statment. |
283 The name must fit to one dataname configured in this State or one other | 284 The name must fit to one dataname configured in this State or one other |
284 State which was visited before. | 285 State which was visited before. |
285 \item type: The type of the Value. This is required for the Validation | 286 \item type: The type of the Value. This is required for the Validation |
286 of the Value. | 287 of the Value. |
287 This might be String, Integer, Double, Date, Point, LineString, | 288 This might be String, Integer, Double, Date, Point, LineString, |
288 Polygon, Coordinate, Geometry and AttributeName. | 289 Polygon, Coordinate, Geometry and AttributeName. |
289 \item multiselect: true if more than on Value can be feed or put into the SQl-statement. | 290 \item multiselect: true if more than on Value can be feed or put into the SQL-statement. |
290 false if one on Value will be accepted. | 291 false if one on Value will be accepted. |
291 \item usedinquery: Number how often the value should be put into the SQL-Statement: | 292 \item usedinquery: Number how often the value should be put into the SQL-Statement: |
292 0: Value will not out into the Statement. | 293 0: Value will not out into the Statement. |
293 1: Value will put once into the Staement, | 294 1: Value will put once into the Statement, |
294 2 or more: Value will be put as often as configured | 295 2 or more: Value will be put as often as configured |
295 into the SQL-Statement (this is useful if | 296 into the SQL-Statement (this is useful if |
296 Inner-Selects are used) | 297 Inner-Selects are used) |
297 \end{itemize} | 298 \end{itemize} |
298 | 299 |
299 The next part will explain the usage of inputvalues. | 300 The next part will explain the usage of inputvalues. |
300 | 301 |
301 This SQL-statment is configured to use in the State above. | 302 This SQL-statement is configured to use in the State above. |
302 | 303 |
303 \begin{lstlisting} | 304 \begin{lstlisting} |
304 SELECT DISTINCT | 305 SELECT DISTINCT |
305 p.PARAMETERID KEY, | 306 p.PARAMETERID KEY, |
306 p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, | 307 p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, |
423 This dependencies are called. Transitions. | 424 This dependencies are called. Transitions. |
424 | 425 |
425 There are different Kind of Transitions which can be used. | 426 There are different Kind of Transitions which can be used. |
426 \begin{itemize} | 427 \begin{itemize} |
427 \item Transitions which only link two States | 428 \item Transitions which only link two States |
428 \item Transition which link two States with a aditional Condition. | 429 \item Transition which link two States with a additional Condition. |
429 (e.g. If a region was selected in the Regionfilter or not ) | 430 (e.g. If a region was selected in the Regionfilter or not ) |
430 \end{itemize} | 431 \end{itemize} |
431 | 432 |
432 The listing below shows a Transition with an additional Condition. | 433 The listing below shows a Transition with an additional Condition. |
433 \begin{lstlisting} | 434 \begin{lstlisting} |
466 \end{itemize} | 467 \end{itemize} |
467 | 468 |
468 All these Outputstates are Implemented in package de.intevation.gnv.state | 469 All these Outputstates are Implemented in package de.intevation.gnv.state |
469 and its subpackages. | 470 and its subpackages. |
470 | 471 |
471 You have to put the fullqulified name of the Outputstate to the Attribute State | 472 You have to put the fullqualified name of the Outputstate to the Attribute State |
472 as shown below. | 473 as shown below. |
473 | 474 |
474 You can configure an OutputState as shown below: | 475 You can configure an OutputState as shown below: |
475 | 476 |
476 \begin{lstlisting} | 477 \begin{lstlisting} |
498 WARNING: IT MIGHT BE POSSIBLE THAT ONE OR MORE OUTPUTMODES ARE NOT | 499 WARNING: IT MIGHT BE POSSIBLE THAT ONE OR MORE OUTPUTMODES ARE NOT |
499 SUPPORTED BY AN PRODUCT. IN THAT CASE IT IS NECESSARY TO | 500 SUPPORTED BY AN PRODUCT. IN THAT CASE IT IS NECESSARY TO |
500 IMPLEMENT THE REQUIRED FUNCTIONALITY BEFORE IT IS POSSIBLE | 501 IMPLEMENT THE REQUIRED FUNCTIONALITY BEFORE IT IS POSSIBLE |
501 TO OFFER THIS OUTPUTMODE. | 502 TO OFFER THIS OUTPUTMODE. |
502 | 503 |
503 Currently the following outputmodes are supported: | 504 Currently the following OutputModes are supported: |
504 | 505 |
505 \begin{itemize} | 506 \begin{itemize} |
506 \item chart | 507 \item chart |
507 \item histogram | 508 \item histogram |
508 \item csv | 509 \item csv |
531 | 532 |
532 // TODO add simple OutputMode e.g. for CSV?? | 533 // TODO add simple OutputMode e.g. for CSV?? |
533 | 534 |
534 \begin{itemize} | 535 \begin{itemize} |
535 \item name: The name of the Mode. This must not be changed because it is used | 536 \item name: The name of the Mode. This must not be changed because it is used |
536 by the Programm. | 537 by the Program. |
537 \item description: a short description of this OutputMode. | 538 \item description: a short description of this OutputMode. |
538 \item parameters: one ore more parameters which will be shown in the GUI e.g. | 539 \item parameters: one ore more parameters which will be shown in the GUI e.g. |
539 for changing the Size of an Chart. | 540 for changing the Size of an Chart. |
540 \item exportModes: one or more formats which can be served. | 541 \item exportModes: one or more formats which can be served. |
541 \end{itemize} | 542 \end{itemize} |
569 | 570 |
570 \paragraph{Example} | 571 \paragraph{Example} |
571 This Example shows how to add an FIS and which effects it took to the | 572 This Example shows how to add an FIS and which effects it took to the |
572 REST-Server. | 573 REST-Server. |
573 | 574 |
574 At first we add the follwing Artifactfactory into the file conf/conf.xml | 575 At first we add the following Artifactfactory into the file conf/conf.xml |
575 in Section /artifact-database/artifact-factories which add a new | 576 in Section /artifact-database/artifact-factories which add a new |
576 FIS called justanewfis to the Server: | 577 FIS called justanewfis to the Server: |
577 | 578 |
578 \begin{lstlisting} | 579 \begin{lstlisting} |
579 <artifact-factory name='fis\_justanewfis' | 580 <artifact-factory name='fis\_justanewfis' |
582 artifact='de.intevation.artifactdatabase.ProxyArtifact'> | 583 artifact='de.intevation.artifactdatabase.ProxyArtifact'> |
583 de.intevation.gnv.artifacts.GNVProductArtifactFactory | 584 de.intevation.gnv.artifacts.GNVProductArtifactFactory |
584 </artifact-factory> | 585 </artifact-factory> |
585 \end{lstlisting} | 586 \end{lstlisting} |
586 | 587 |
587 Then we restart the Artifact-database executing the followinig command: | 588 Then we restart the Artifact-database executing the following command: |
588 | 589 |
590 \begin{lstlisting} | |
589 /etc/init.d/artifactdb restart | 591 /etc/init.d/artifactdb restart |
592 \end{lstlisting} | |
590 | 593 |
591 Then we check if the new FIS is served by the REST-Server | 594 Then we check if the new FIS is served by the REST-Server |
592 calling the following command: | 595 calling the following command: |
593 | 596 |
597 \begin{lstlisting} | |
594 curl http://localhost:8181/factories | xmllint --format - | grep fis\_justanewfis | 598 curl http://localhost:8181/factories | xmllint --format - | grep fis\_justanewfis |
599 \end{lstlisting} | |
595 | 600 |
596 If the FIS was added the new Artifactfactory will be found in the generated | 601 If the FIS was added the new Artifactfactory will be found in the generated |
597 XML-Output and it will be shown. | 602 XML-Output and it will be shown. |
598 Otherwise no XML-Output will be shown. | 603 Otherwise no XML-Output will be shown. |
599 | 604 |
607 ... | 612 ... |
608 </products> | 613 </products> |
609 </artifact> | 614 </artifact> |
610 \end{lstlisting} | 615 \end{lstlisting} |
611 | 616 |
612 In this XML- Fragment it is also required to replave the placeholder NEWFISNAME | 617 In this XML- Fragment it is also required to replace the placeholder NEWFISNAME |
613 with the name which was used to configure the Artifact-Factory. | 618 with the name which was used to configure the Artifact-Factory. |
614 | 619 |
615 Now the ArtifactServer can serv an additional FIS without any Products yet. | 620 Now the ArtifactServer can handle an additional FIS without any Products yet. |
616 | 621 |
617 To prevent needless Configuration-Work it is useful way to clone an Artifact | 622 To prevent needless Configuration-Work it is useful way to clone an Artifact |
618 which handle the same Kind of work as the new FIS. | 623 which handle the same Kind of work as the new FIS. |
619 | 624 |
620 | 625 |
691 \paragraph{Example} | 696 \paragraph{Example} |
692 Now we will add a Product to the new FIS. | 697 Now we will add a Product to the new FIS. |
693 To let the Products work we will choose a Product which | 698 To let the Products work we will choose a Product which |
694 will contain the sourceid of an existing FIS (e.g 4 Marnet). | 699 will contain the sourceid of an existing FIS (e.g 4 Marnet). |
695 | 700 |
696 At first add the following XMl-Fragment to the new Artifact. | 701 At first add the following XML-Fragment to the new Artifact. |
697 \begin{lstlisting} | 702 \begin{lstlisting} |
698 <product name= "timeSeries"> | 703 <product name= "timeSeries"> |
699 <artifact-factory name="timeSeries" | 704 <artifact-factory name="timeSeries" |
700 description="Artiefactfactory for Instantiating the Artifact for TimeSeries on TimeSeriesPoints" | 705 description="Artiefactfactory for Instantiating the Artifact for TimeSeries on TimeSeriesPoints" |
701 ttl="300000" | 706 ttl="300000" |
720 If we call | 725 If we call |
721 \begin{lstlisting} | 726 \begin{lstlisting} |
722 curl -d "@sample-documents/create-artifact.xml" http://localhost:8181/create | xmllint --format - | 727 curl -d "@sample-documents/create-artifact.xml" http://localhost:8181/create | xmllint --format - |
723 \end{lstlisting} | 728 \end{lstlisting} |
724 | 729 |
725 The Product timeSeries should be available for ths FIS justanewfis. | 730 The Product timeSeries should be available for the FIS justanewfis. |
726 | 731 |
727 Now we should be able to choose the Product. | 732 Now we should be able to choose the Product. |
728 This Product should work and you should be able to generate even the defined | 733 This Product should work and you should be able to generate even the defined |
729 Outputformats. | 734 Outputformats. |
730 | 735 |
731 \subsubsection{Putting SourceID to specific Artifact} | |
732 \subsection{Adding a new Product} | 736 \subsection{Adding a new Product} |
733 To add a new Product to the System it is necessary that the required | 737 To add a new Product to the System it is necessary that the required |
734 Artifactrepresentation is Implemented in the SourceCode. | 738 Artifact representation is Implemented in the SourceCode. |
735 Without doing that step it is not possible to create a new Product. | 739 Without doing that step it is not possible to create a new Product. |
736 | 740 |
737 All Products are configured in separate Files that will be included into the | 741 All Products are configured in separate Files that will be included into the |
738 Mainconfiguration using Xlink-References. | 742 main configuration using Xlink-References. |
739 | 743 |
740 First Step is to create a new File in the Folder products and there in the | 744 First Step is to create a new File in the Folder products and there in the |
741 subfolder where the Product belongs to (timeseries,verticalprofile, | 745 sub-folder where the Product belongs to (timeseries,verticalprofile, |
742 horizontalprofile,horizontalcrosssection,layer,...) | 746 horizontalprofile,horizontalcrosssection,layer,...) |
743 | 747 |
744 Then you have tor reference this File in the File /conf/conf.xml in the Section | 748 Then you have tor reference this File in the File /conf/conf.xml in the Section |
745 /artifacts using the following XML-Fragment. | 749 /artifacts using the following XML-Fragment. |
746 | 750 |