changeset 4586:319565a48182

Add the csv export to the GaugeDischargeCurveArtifact Add the csv export to show the calculation results in the flys client.
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 27 Nov 2012 17:43:19 +0100 (2012-11-27)
parents b4a95290ec63
children c2ec7f5ac422
files flys-artifacts/doc/conf/artifacts/gaugedischargecurve.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java
diffstat 2 files changed, 30 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/artifacts/gaugedischargecurve.xml	Tue Nov 27 17:41:41 2012 +0100
+++ b/flys-artifacts/doc/conf/artifacts/gaugedischargecurve.xml	Tue Nov 27 17:43:19 2012 +0100
@@ -16,6 +16,11 @@
                         <facet name="at" description="facet.gauge_discharge_curve_export.at"/>
                     </facets>
                 </outputmode>
+                <outputmode name="computed_dischargecurve_export" description="output.computed_dischargecurve_export" mime-type="text/plain" type="export">
+                    <facets>
+                        <facet name="csv" description="facet.computed_dischargecurve_export.csv" />
+                    </facets>
+                </outputmode>
             </outputmodes>
          </state>
     </states>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java	Tue Nov 27 17:41:41 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java	Tue Nov 27 17:43:19 2012 +0100
@@ -51,9 +51,14 @@
         "discharge_curve";
     public static final String GAUGE_DISCHARGE_CURVE_AT_EXPORT_OUT =
         "computed_dischargecurve_at_export";
+    public static final String GAUGE_DISCHARGE_CURVE_CSV_OUT =
+        "computed_dischargecurve_export";
+    public static final String GAUGE_DISCHARGE_CURVE_CSV_FACET =
+        "csv";
 
     private Facet atexportfacet;
     private Facet curvefacet;
+    private Facet csvfacet;
 
     /**
      * Setup initializes the data by extracting the river and gauge from
@@ -119,7 +124,7 @@
                 rivername,
                 gaugename);
 
-        List<Facet> fs = new ArrayList<Facet>(2);
+        List<Facet> fs = new ArrayList<Facet>(3);
         curvefacet = new GaugeDischargeCurveFacet(
                 GAUGE_DISCHARGE_CURVE_FACET, description);
         fs.add(curvefacet);
@@ -133,6 +138,15 @@
                 GAUGE_DISCHARGE_CURVE_AT_EXPORT_FACET, description);
         fs.add(atexportfacet);
 
+        description = Resources.format(callmeta,
+                "facet.computed_dischargecurve_export.csv",
+                "Discharge curve CSV export on gauge",
+                rivername,
+                gaugename);
+        csvfacet = new GaugeDischargeCurveFacet(
+                GAUGE_DISCHARGE_CURVE_CSV_FACET, description);
+        fs.add(csvfacet);
+
         addFacets(STATIC_STATE_NAME, fs);
 
         super.setup(identifier, factory, context, callmeta, data);
@@ -168,6 +182,16 @@
             "export");
         state.addOutput(output);
 
+        fs = new ArrayList<Facet>(1);
+        fs.add(csvfacet);
+        output = new DefaultOutput(
+            GAUGE_DISCHARGE_CURVE_CSV_OUT,
+            "output.computed_dischargecurve_export",
+            "text/plain",
+            fs,
+            "export");
+        state.addOutput(output);
+
         state.setUIProvider(UIPROVIDER);
         setStaticState(state);
     }

http://dive4elements.wald.intevation.org