[Dive4elements-commits] [PATCH 4 of 4] Add the csv export to the GaugeDischargeCurveArtifact

Wald Commits scm-commit at wald.intevation.org
Tue Nov 27 17:43:36 CET 2012


# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1354034599 -3600
# Node ID 319565a48182f01f18a29e55723e41cd69ad5b69
# Parent  b4a95290ec6393d6f2edab9c13d930c89d3ac386
Add the csv export to the GaugeDischargeCurveArtifact

Add the csv export to show the calculation results in the flys client.

diff -r b4a95290ec63 -r 319565a48182 flys-artifacts/doc/conf/artifacts/gaugedischargecurve.xml
--- 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>
diff -r b4a95290ec63 -r 319565a48182 flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java
--- 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);
     }


More information about the Dive4elements-commits mailing list