changeset 2259:0dcb8326be08

Add a not-yet-looked-at CSV facet for Reference Curve. flys-artifacts/trunk@3914 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 06 Feb 2012 10:15:41 +0000
parents ea173e4c07c7
children 22bac691d414
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ReferenceCurveState.java
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Feb 06 08:36:26 2012 +0000
+++ b/flys-artifacts/ChangeLog	Mon Feb 06 10:15:41 2012 +0000
@@ -1,3 +1,8 @@
+2012-02-06  Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/states/ReferenceCurveState.java:
+	  Add CSV facet (not yet evaluated).
+
 2012-02-06  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/HistoricalDischargeCurveExporter.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ReferenceCurveState.java	Mon Feb 06 08:36:26 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ReferenceCurveState.java	Mon Feb 06 10:15:41 2012 +0000
@@ -8,6 +8,7 @@
 import de.intevation.flys.artifacts.WINFOArtifact;
 
 import de.intevation.flys.artifacts.model.CalculationResult;
+import de.intevation.flys.artifacts.model.DataFacet;
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.ReferenceCurveFacet;
 import de.intevation.flys.artifacts.model.ReportFacet;
@@ -24,7 +25,7 @@
 extends      DefaultState
 implements   FacetTypes
 {
-    private static Logger log = Logger.getLogger(ReferenceCurveState.class);
+    private static Logger logger = Logger.getLogger(ReferenceCurveState.class);
 
     public ReferenceCurveState() {
     }
@@ -37,11 +38,12 @@
         List<Facet>  facets,
         Object       old
     ) {
-
         if (!(artifact instanceof WINFOArtifact)) {
             return null;
         }
 
+        String id = getID();
+
         WINFOArtifact winfo = (WINFOArtifact)artifact;
 
         CalculationResult res = old instanceof CalculationResult
@@ -62,6 +64,9 @@
 
         if (wws.length > 0) {
             // TODO: Add CSV/PDF facets.
+            logger.debug("Adding CSV data facet.");
+            Facet csv = new DataFacet (CSV, "CSV data", ComputeType.ADVANCE, hash, id);
+            facets.add(csv);
         }
 
         if (res.getReport().hasProblems()) {

http://dive4elements.wald.intevation.org