changeset 241:8500529d82af

Added ODV-Export to VerticalProfiles gnv-artifacts/trunk@309 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 09 Nov 2009 15:24:41 +0000
parents 76897b73db4e
children 5925739d25ac
files gnv-artifacts/ChangeLog gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml gnv-artifacts/doc/conf/queries.properties gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_out_odv.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_odv.xml
diffstat 7 files changed, 154 insertions(+), 153 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Mon Nov 09 14:20:27 2009 +0000
+++ b/gnv-artifacts/ChangeLog	Mon Nov 09 15:24:41 2009 +0000
@@ -1,3 +1,19 @@
+2009-11-09  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (TIMESERIES_ODV_PROFILE_NAMES): 
+	  Changed the Order of Columnlookup for ODV-Exports and added column "Depth" to the Export
+	* src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testTimeSeriesMeshArtifact): 
+	  Added the ODV-Export to the Unit-Testcase for TimeSeries-Mesh.
+	  Some Refactoring Work done.
+	* doc/conf/queries.properties: 
+	  Added Query for VerticalProfile ODV-Exports in Meshes
+	* doc/conf/products/verticalprofile/conf_mesh.xml: 
+	  Added QueryID for ODV-Exports to the Configuration of an 
+	  Mesh-VerticalProfile-Artifacts
+	* src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_odv.xml, 
+	  src/test/ressources/verticalprofile/verticalprofile_step_06_out_odv.xml: 
+	  Added Out-request for ODV-Export to the JUnitTest Configuration for VerticalProfiles.
+	
 2009-11-09  Tim Englich  <tim.englich@intevation.de>
 
     * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testTimeSeriesMeshArtifact): 
--- a/gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml	Mon Nov 09 14:20:27 2009 +0000
+++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml	Mon Nov 09 15:24:41 2009 +0000
@@ -144,6 +144,7 @@
        
        <transition id="verticalprofile_mesh_calculate_results" description="verticalprofile_mesh_calculate_results" transition="de.intevation.gnv.transition.profile.vertical.VerticalProfileOutputTransition">
            <queryID>verticalprofile_mesh_chart_data</queryID>
+           <queryID-odv>verticalprofile_mesh_odv_data</queryID-odv>
            <inputvalues>
                <inputvalue name="parameterid" type="Integer" multiselect="true" usedinquery="1"/>
                <inputvalue name="dateid" type="Date" multiselect="true" usedinquery="1"/>
--- a/gnv-artifacts/doc/conf/queries.properties	Mon Nov 09 14:20:27 2009 +0000
+++ b/gnv-artifacts/doc/conf/queries.properties	Mon Nov 09 15:24:41 2009 +0000
@@ -437,6 +437,44 @@
             msv.TIMEVALUE, \
             ml.UPPERZLOCATION
             
+verticalprofile_mesh_odv_data=select SI.NAME CRUISE, \
+        m.MESHID || '-' || MEDIAN.MESHPOINT.IPOSITION || '-' || MEDIAN.MESHPOINT.JPOSITION STATION, \
+        '*' TYPE, \
+        ST_ASTEXT(SHAPE), \
+        0 BOTDEPTH, \
+        (((ML.UPPERZLOCATION + ML.LOWERZLOCATION) / 2)*-1) DEPTH, \
+        msv.DATAVALUE , \
+        msv.PARAMETERID PARAMETER, \
+        msv.TIMEVALUE , \
+    from MEDIAN.MESHLAYER ml, \
+         MEDIAN.MESHPOINT, \
+         MEDIAN.MESH m, \
+         MEDIAN.MESHSCALARVALUE msv, \
+         MEDIAN.SOURCEINFO SI, \
+    where m.SOURCEID = SI.SOURCEID AND \
+          msv.FEATUREID = MEDIAN.MESHPOINT. FEATUREID AND \
+          ml.KPOSITION = MEDIAN.MESHPOINT.KPOSITION and \
+          ml.MESHID = MEDIAN.MESHPOINT.MESHID and \
+          m.MESHID = MEDIAN.MESHPOINT.MESHID AND \
+          m.PARTIDMIN <= msv.PARTID AND \
+          m.PARTIDMAX >= msv.PARTID AND \
+          msv.PARAMETERID in (?) AND \
+          msv.TIMEVALUE in (?) AND \
+          m.OBJECTID = ? AND \
+          MEDIAN.MESHPOINT.FEATUREID in \
+                          ( select FEATUREID \
+                            from MEDIAN.MESHPOINT mp, \
+                                 MEDIAN.MESH m \
+                             where m.OBJECTID = ? AND \
+                                   mp.MESHID = m.MESHID  AND \
+                                  IPOSITION = (select IPOSITION from MEDIAN.MESHPOINT where FEATUREID = ?) and \
+                                  JPOSITION = (select JPOSITION from MEDIAN.MESHPOINT where FEATUREID = ?)) AND \
+          MEDIAN.MESHPOINT.KPOSITION <= ? AND \
+          MEDIAN.MESHPOINT.KPOSITION >= ? \
+    order by msv.PARAMETERID, \
+             msv.TIMEVALUE, \
+             ml.UPPERZLOCATION
+            
 #############################################
 #############################################
 ##### Vertikalprofil InstantaneousPoint #####
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java	Mon Nov 09 14:20:27 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java	Mon Nov 09 15:24:41 2009 +0000
@@ -98,11 +98,11 @@
     public static final String [] TIMESERIES_ODV_PROFILE_NAMES = {
           "CRUISE",
           "STATION",
+          "TIMEVALUE",
           "TYPE",
           "SHAPE",
           "BOTDEPTH",
-          //"DEPTH",
-          "TIMEVALUE",
+          "DEPTH"
           //"DATAVALUE",
           //"PARAMETER",
           //"MEASUREMENTID",
@@ -117,7 +117,8 @@
         "Date/Time",
         "Longitude [deegrees_east]",
         "Latitude [deegrees_north]",
-        "Bot. Depth [m]"
+        "Bot. Depth [m]",
+        "Depth [m]"
     };
 
     /**
--- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Mon Nov 09 14:20:27 2009 +0000
+++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Mon Nov 09 15:24:41 2009 +0000
@@ -298,52 +298,25 @@
             CallContext cc = createCallContext();
 
             Document describeDocument = this.readDocument("src/test/ressources/verticalprofile/verticalprofile_describe.xml");
-            // Erster Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/verticalprofile/verticalprofile_step_01_feed.xml",
-                            "src/test/ressources/verticalprofile/verticalprofile_step_02_advance.xml", describeDocument);
-
-            // Zweiter Schritt
-            this
-                    .doNextStep(
+            int steps = 5;
+            
+            for (int i = 1; i <= steps; i++){
+                this.doNextStep(
                             artifact,
                             cc,
-                            "src/test/ressources/verticalprofile/verticalprofile_step_02_feed.xml",
-                            "src/test/ressources/verticalprofile/verticalprofile_step_02_advance.xml", describeDocument);
-
-            // Dritter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/verticalprofile/verticalprofile_step_03_feed.xml",
-                            "src/test/ressources/verticalprofile/verticalprofile_step_03_advance.xml", describeDocument);
-            
-            // Vierter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/verticalprofile/verticalprofile_step_04_feed.xml",
-                            "src/test/ressources/verticalprofile/verticalprofile_step_04_advance.xml", describeDocument);
-            
-         // Fünfter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/verticalprofile/verticalprofile_step_05_feed.xml",
-                            "src/test/ressources/verticalprofile/verticalprofile_step_05_advance.xml", describeDocument);
-
+                            "src/test/ressources/verticalprofile/" +
+                            "verticalprofile_step_0"+i+"_feed.xml",
+                            "src/test/ressources/verticalprofile/" +
+                            "verticalprofile_step_0"+i+"_advance.xml", 
+                            describeDocument);
+            }
 
             // Vierter Schritt
             Document outputData = artifact.describe(describeDocument,cc);
             FileOutputStream fos = null;
             FileOutputStream fos2 = null;
             FileOutputStream fos3 = null;
+            FileOutputStream fos4 = null;
             try {
                 fos = new FileOutputStream("src/test/results/verticalprofile"
                                            + System.currentTimeMillis()
@@ -354,26 +327,29 @@
                 fos3 = new FileOutputStream("src/test/results/verticalprofile"
                                             + System.currentTimeMillis()
                                             + ".csv");
-                artifact
-                        .feed(
-                                this
-                                        .readDocument("src/test/ressources/verticalprofile/verticalprofile_step_06_feed.xml"),
-                                cc);
-                artifact
-                        .out(
-                                this
-                                        .readDocument("src/test/ressources/verticalprofile/verticalprofile_step_06_out_statistics.xml"),
-                                fos2, cc);
-                artifact
-                        .out(
-                                this
-                                        .readDocument("src/test/ressources/verticalprofile/verticalprofile_step_06_out_chart.xml"),
-                                fos, cc);
-                artifact
-                        .out(
-                                this
-                                        .readDocument("src/test/ressources/verticalprofile/verticalprofile_step_06_out_csv.xml"),
-                                fos3, cc);
+                fos4 = new FileOutputStream("src/test/results/verticalprofile"
+                        + System.currentTimeMillis()
+                        + ".odv");
+                artifact.feed(this.readDocument("src/test/ressources/" +
+                                                "verticalprofile/" +
+                                                "verticalprofile_step_06_feed.xml"),
+                              cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "verticalprofile/" +
+                                               "verticalprofile_step_06_out_statistics.xml"),
+                             fos2, cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "verticalprofile/" +
+                                               "verticalprofile_step_06_out_chart.xml"),
+                             fos, cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "verticalprofile/" +
+                                               "verticalprofile_step_06_out_csv.xml"),
+                             fos3, cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "verticalprofile/" +
+                                               "verticalprofile_step_06_out_odv.xml"),
+                            fos4, cc);
             } catch (Exception e) {
                 log.error(e, e);
                 fail();
@@ -385,6 +361,8 @@
                     fos2.close();
                     fos3.flush();
                     fos3.close();
+                    fos4.flush();
+                    fos4.close();
                 } catch (Exception e) {
                     log.error(e, e);
                 }
@@ -409,86 +387,28 @@
             log.debug("VerticalProfile-Artifact is available");
 
             CallContext cc = createCallContext();
-            Document describeDocument = this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_describe.xml");
-            // Erster Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_feed.xml",
-                            "src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_advance.xml", describeDocument);
-
-            // Zweiter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_feed.xml",
-                            "src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_advance.xml", describeDocument);
-
-            // Dritter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_feed.xml",
-                            "src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_advance.xml", describeDocument);
-
-            // Vierter Schritt
-            this
-                    .doNextStep(
+            Document describeDocument = this.readDocument("src/test/ressources/" +
+                                                          "verticalprofile_mesh/" +
+                                                          "verticalprofile_describe.xml");
+            
+            int steps = 9;
+            
+            for (int i = 1; i <= steps; i++){
+                this.doNextStep(
                             artifact,
                             cc,
-                            "src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_feed.xml",
-                            "src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_advance.xml", describeDocument);
-
-            // Fünfter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_feed.xml",
-                            "src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_advance.xml", describeDocument);
-            
-            // Sechster Schritt
-            this
-            .doNextStep(
-                    artifact,
-                    cc,
-                    "src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_feed.xml",
-                    "src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_advance.xml", describeDocument);
-            
-            // Siebter Schritt
-            this
-            .doNextStep(
-                    artifact,
-                    cc,
-                    "src/test/ressources/verticalprofile_mesh/verticalprofile_step_07_feed.xml",
-                    "src/test/ressources/verticalprofile_mesh/verticalprofile_step_07_advance.xml", describeDocument);
-            
-           // Achter Schritt
-            this
-            .doNextStep(
-                    artifact,
-                    cc,
-                    "src/test/ressources/verticalprofile_mesh/verticalprofile_step_08_feed.xml",
-                    "src/test/ressources/verticalprofile_mesh/verticalprofile_step_08_advance.xml", describeDocument);
-
-            
-           // Neunter Schritt
-            this
-            .doNextStep(
-                    artifact,
-                    cc,
-                    "src/test/ressources/verticalprofile_mesh/verticalprofile_step_09_feed.xml",
-                    "src/test/ressources/verticalprofile_mesh/verticalprofile_step_09_advance.xml", describeDocument);
-
-
+                            "src/test/ressources/verticalprofile_mesh/" +
+                            "verticalprofile_step_0"+i+"_feed.xml",
+                            "src/test/ressources/verticalprofile_mesh/" +
+                            "verticalprofile_step_0"+i+"_advance.xml", 
+                            describeDocument);
+            }
             // 10. Schritt
             Document outputData = artifact.describe(describeDocument,cc);
             FileOutputStream fos = null;
             FileOutputStream fos2 = null;
             FileOutputStream fos3 = null;
+            FileOutputStream fos4 = null;
             try {
                 fos = new FileOutputStream(
                         "src/test/results/verticalprofile_mesh"
@@ -499,26 +419,29 @@
                 fos3 = new FileOutputStream(
                         "src/test/results/verticalprofile_mesh"
                                 + System.currentTimeMillis() + ".csv");
-                artifact
-                        .feed(
-                                this
-                                        .readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_feed.xml"),
+                fos4 = new FileOutputStream(
+                        "src/test/results/verticalprofile_mesh"
+                                + System.currentTimeMillis() + ".odv");
+                artifact.feed(this.readDocument("src/test/ressources/" +
+                                                "verticalprofile_mesh/" +
+                                                "verticalprofile_step_10_feed.xml"),
                                 cc);
-                artifact
-                        .out(
-                                this
-                                        .readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_statistics.xml"),
-                                fos2, cc);
-                artifact
-                        .out(
-                                this
-                                        .readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_chart.xml"),
-                                fos, cc);
-                artifact
-                        .out(
-                                this
-                                        .readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_csv.xml"),
-                                fos3, cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "verticalprofile_mesh/" +
+                                               "verticalprofile_step_10_out_statistics.xml"),
+                             fos2, cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "verticalprofile_mesh/" +
+                                               "verticalprofile_step_10_out_chart.xml"),
+                             fos, cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                              "verticalprofile_mesh/" +
+                                              "verticalprofile_step_10_out_csv.xml"),
+                             fos3, cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "verticalprofile_mesh/" +
+                                               "verticalprofile_step_10_out_odv.xml"),
+                             fos4, cc);
             } catch (Exception e) {
                 log.error(e, e);
                 fail();
@@ -530,6 +453,8 @@
                     fos2.close();
                     fos3.flush();
                     fos3.close();
+                    fos4.flush();
+                    fos4.close();
                 } catch (Exception e) {
                     log.error(e, e);
                 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_out_odv.xml	Mon Nov 09 15:24:41 2009 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="out" />
+	<art:uuid value="4319eb60-5419-4ce9-80b2-3ffac5b50146" />
+	<art:hash value="11096221" />
+	<art:out name="odv">
+		<art:out value="text/plain" />
+		<art:params />
+	</art:out>
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_odv.xml	Mon Nov 09 15:24:41 2009 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="out" />
+	<art:uuid value="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<art:out name="odv">
+		<art:out value="text/plain" />
+		<art:params />
+	</art:out>
+</art:action>
\ No newline at end of file

http://dive4elements.wald.intevation.org