changeset 245:9697a6b8d2c9

Added ODV-Export to HorizontalCrossSection on Meshes gnv-artifacts/trunk@314 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 10 Nov 2009 14:10:52 +0000
parents 9048bc4b17cd
children b7f69809239c
files gnv-artifacts/ChangeLog gnv-artifacts/doc/conf/products/horizontalcrosssection/conf_mesh.xml gnv-artifacts/doc/conf/queries.properties gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_feed.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_odv.xml
diffstat 6 files changed, 121 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Tue Nov 10 11:48:41 2009 +0000
+++ b/gnv-artifacts/ChangeLog	Tue Nov 10 14:10:52 2009 +0000
@@ -1,5 +1,20 @@
 2009-11-10  Tim Englich  <tim.englich@intevation.de>
 
+	* src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalCrossSectionMeshArtifact):
+	  Added the ODV-Export to the Unit-Testcase for HorizontalCrossSection-Mesh.
+	  Some Refactoring Work done. 
+	* doc/conf/queries.properties: 
+	  Added Query for HorizontalCrossSection ODV-Exports in Meshes.
+	* doc/conf/products/horizontalcrosssection/conf_mesh.xml: 
+	  Added QueryID for ODV-Exports to the Configuration of an 
+	  Mesh-HorizontalCrossSection-Artifacts
+	* src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_feed.xml: 
+	  Changed Datevalue, because the old value was out of range to the Data.
+	* src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_odv.xml: 
+	  Added Out-Request for ODV-Export to the JUnitTest Configuration for 
+	  HorizontalCrossSection Mesh.
+
+2009-11-10  Tim Englich  <tim.englich@intevation.de>
 	* src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalProfileInstantaneousPointArtifact): 
 	  Added the ODV-Export to the Unit-Testcase for HorizontalProfile-InstantaneousPoint.
 	  Some Refactoring Work done.
--- a/gnv-artifacts/doc/conf/products/horizontalcrosssection/conf_mesh.xml	Tue Nov 10 11:48:41 2009 +0000
+++ b/gnv-artifacts/doc/conf/products/horizontalcrosssection/conf_mesh.xml	Tue Nov 10 14:10:52 2009 +0000
@@ -100,6 +100,7 @@
         
         <transition id="horizontalcrosssection_mesh_calculate_results" description="horizontalcrosssection_mesh_calculate_results" transition="de.intevation.gnv.transition.profile.horizontalcrosssection.HorizontalCrossSectionMeshOutputTransition">
             <queryID>horizontalcrosssection_mesh_data</queryID>
+            <queryID-odv>horizontalcrosssection_mesh_odv_data</queryID-odv>
             <inputvalues>
                 <inputvalue name="parameterid" type="Integer" multiselect="false" usedinquery="1" />
                 <inputvalue name="dateid" type="Date" multiselect="false" usedinquery="1" />
--- a/gnv-artifacts/doc/conf/queries.properties	Tue Nov 10 11:48:41 2009 +0000
+++ b/gnv-artifacts/doc/conf/queries.properties	Tue Nov 10 14:10:52 2009 +0000
@@ -890,7 +890,69 @@
           MEDIAN.MESHFACE.KPOSITION = ? \
     order by MEDIAN.MESHFACE.JPOSITION , \
              MEDIAN.MESHFACE.IPOSITION
-             
+horizontalcrosssection_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.TIMEVALUE, \
+           MSV.DATAVALUE , \
+           MSV.PARAMETERID PARAMETER, \
+           MEDIAN.MESHPOINT.JPOSITION, \
+           MEDIAN.MESHPOINT.IPOSITION, \
+           MEDIAN.MESHPOINT.KPOSITION \
+    from MEDIAN.MESHLAYER ML, \
+         MEDIAN.MESHPOINT, \
+         MEDIAN.MESH M, \
+         MEDIAN.SOURCEINFO SI, \
+         MEDIAN.MESHSCALARVALUE MSV \
+    where 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 \
+          M.SOURCEID = SI.SOURCEID AND \
+          MSV.PARAMETERID = ? AND \
+          MSV.TIMEVALUE = ? AND \
+          M.OBJECTID = ? AND \
+          MEDIAN.MESHPOINT.KPOSITION = ? \
+    order by MEDIAN.MESHPOINT.JPOSITION , \
+             MEDIAN.MESHPOINT.IPOSITION
+
+
+
+
+
+select /*+ parallel(timevalue,10) */ \
+        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.TIMEVALUE, \
+        MSV.DATAVALUE , \
+        MSV.PARAMETERID PARAMETER, \
+    from MEDIAN.MESHSCALARVALUE MSV , \
+         MEDIAN.MESHPOINT, \
+         MEDIAN.MESH M, \
+         MEDIAN.SOURCEINFO SI, \
+         MEDIAN.MESHLAYER ML \
+    where MSV.PARTID >= M.PARTIDMIN AND \
+          MSV.PARTID <= M.PARTIDMAX AND \
+          m.SOURCEID = SI.SOURCEID AND \
+          ML.MESHID = MEDIAN.MESHPOINT.MESHID AND \
+          ML.KPOSITION = MEDIAN.MESHPOINT.KPOSITION AND \
+          MSV.PARAMETERID = ? AND \
+          MSV.TIMEVALUE = ? AND \
+          M.OBJECTID = ? AND \
+          MEDIAN.MESHPOINT.KPOSITION = ? \
+    order by MEDIAN.MESHPOINT.FEATUREID, \
+             msv.FEATUREID, \
+             msv.PARAMETERID, \
+             msv.TIMEVALUE
              
 area_filter = SELECT DISTINCT \
        FEATUREID KEY ,\
--- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Tue Nov 10 11:48:41 2009 +0000
+++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Tue Nov 10 14:10:52 2009 +0000
@@ -751,48 +751,24 @@
 
             CallContext cc = createCallContext();
             Document describeDocument = this.readDocument("src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_describe.xml");
-            // Erster Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_feed.xml",
-                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_advance.xml", describeDocument);
-
-            // Zweiter Schritt
-            this
-                    .doNextStep(
+            int steps = 5;
+            
+            for (int i = 1; i <= steps; i++){
+                this.doNextStep(
                             artifact,
                             cc,
-                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_feed.xml",
-                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_advance.xml", describeDocument);
-            // Dritter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_feed.xml",
-                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_advance.xml", describeDocument);
-            // Vierter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_feed.xml",
-                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_advance.xml", describeDocument);
+                            "src/test/ressources/horizontalcrosssection_mesh/" +
+                            "horizontalcrosssection_step_0"+i+"_feed.xml",
+                            "src/test/ressources/horizontalcrosssection_mesh/" +
+                            "horizontalcrosssection_step_0"+i+"_advance.xml", 
+                            describeDocument);
+            }
             
-            // Fünfter Schritt
-            this
-            .doNextStep(
-                    artifact,
-                    cc,
-                    "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_feed.xml",
-                    "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_advance.xml", describeDocument);
-    
             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/horizontalcrosssection_mesh"
@@ -803,22 +779,29 @@
                 fos3 = new FileOutputStream(
                         "src/test/results/horizontalcrosssection_mesh"
                                 + System.currentTimeMillis() + ".csv");
-                artifact
-                        .feed(this.readDocument("src/test/ressources/horizontal" +
-                                                "crosssection_mesh/horizontalcrosssection_step_06_feed.xml"),
+                fos4 = new FileOutputStream(
+                        "src/test/results/horizontalcrosssection_mesh"
+                                + System.currentTimeMillis() + ".odv");
+                artifact.feed(this.readDocument("src/test/ressources/" +
+                                                "horizontalcrosssection_mesh/" +
+                                                "horizontalcrosssection_step_06_feed.xml"),
                               cc);
-                artifact
-                        .out(this.readDocument("src/test/ressources/horizontal" +
-                                               "crosssection_mesh/horizontalcrosssection_step_06_out_statistics.xml"),
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "horizontalcrosssection_mesh/" +
+                                               "horizontalcrosssection_step_06_out_statistics.xml"),
                               fos2, cc);
-                artifact
-                        .out(this.readDocument("src/test/ressources/horizontal" +
-                                               "crosssection_mesh/horizontalcrosssection_step_06_out_chart.xml"),
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "horizontalcrosssection_mesh/" +
+                                               "horizontalcrosssection_step_06_out_chart.xml"),
                               fos, cc);
-                artifact.out(this.readDocument("src/test/ressources/horizontal" +
-                                               "crosssection_mesh/horizontalcrosssection_step_06_out_csv.xml"),
-                             fos3,
-                             cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "horizontalcrosssection_mesh/" +
+                                               "horizontalcrosssection_step_06_out_csv.xml"),
+                             fos3,cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "horizontalcrosssection_mesh/" +
+                                               "horizontalcrosssection_step_06_out_odv.xml"),
+                              fos4,cc);
             } catch (Exception e) {
                 log.error(e, e);
                 fail();
--- a/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_feed.xml	Tue Nov 10 11:48:41 2009 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_feed.xml	Tue Nov 10 14:10:52 2009 +0000
@@ -4,6 +4,6 @@
 	<art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
 	<art:hash value="6292125" />
 	<art:data>
-		<art:input name="dateid" value="2009.10.23 01:00:00" />
+		<art:input name="dateid" value="2009.11.09 00:00:00" />
 	</art:data>
 </art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_odv.xml	Tue Nov 10 14:10:52 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="74baff94-b172-4667-b6d8-db21abeb1b81" />
+    <art:hash value="6292125" />
+	<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