changeset 830:3ab5754e72e3

Extract ODV-Generation into its own method that it is possible to override it in subclasses. gnv-artifacts/trunk@924 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 13 Apr 2010 14:35:30 +0000
parents 95733e564896
children bcdcce146c14
files gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java
diffstat 2 files changed, 70 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java	Tue Apr 13 14:26:21 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java	Tue Apr 13 14:35:30 2010 +0000
@@ -1,72 +1,11 @@
 package de.intevation.gnv.state.profile.verticalcrosssection;
 
-import com.vividsolutions.jts.geom.Coordinate;
-
-import de.intevation.artifacts.CallContext;
-
-import de.intevation.gnv.artifacts.cache.CacheFactory;
-
-import de.intevation.gnv.artifacts.context.GNVArtifactContext;
-
-import de.intevation.gnv.artifacts.ressource.RessourceFactory;
-
-import de.intevation.gnv.chart.Chart;
-import de.intevation.gnv.chart.ChartLabels;
-import de.intevation.gnv.chart.VerticalCrossSectionChart;
-
-import de.intevation.gnv.geobackend.base.Result;
-import de.intevation.gnv.geobackend.base.ResultDescriptor;
-
-import de.intevation.gnv.geobackend.base.query.QueryExecutor;
-import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory;
-
-import de.intevation.gnv.geobackend.base.query.exception.QueryException;
-
-import de.intevation.gnv.geobackend.sde.datasources.RasterObject;
-
-import de.intevation.gnv.jfreechart.PolygonDataset;
-import de.intevation.gnv.jfreechart.PolygonSeries;
-
-import de.intevation.gnv.math.AttributedXYColumns;
-import de.intevation.gnv.math.HeightValue;
-import de.intevation.gnv.math.IJKey;
-import de.intevation.gnv.math.Interpolation3D;
-import de.intevation.gnv.math.LinearMetrics;
-import de.intevation.gnv.math.QueriedXYDepth;
-import de.intevation.gnv.math.XYColumn;
-
-import de.intevation.gnv.raster.Filter;
-import de.intevation.gnv.raster.IsoAttributeGenerator;
-import de.intevation.gnv.raster.IsoPolygonSeriesProducer;
-import de.intevation.gnv.raster.Palette;
-import de.intevation.gnv.raster.PaletteManager;
-import de.intevation.gnv.raster.PolygonDatasetProducer;
-import de.intevation.gnv.raster.Raster;
-import de.intevation.gnv.raster.Vectorizer;
-
-import de.intevation.gnv.state.InputData;
-
-import de.intevation.gnv.state.describedata.KeyValueDescibeData;
-
-import de.intevation.gnv.state.exception.StateException;
-
-import de.intevation.gnv.state.timeseries.TimeSeriesOutputState;
-
-import de.intevation.gnv.statistics.Statistics;
-import de.intevation.gnv.statistics.VerticalCrossSectionStatistics;
-
-import de.intevation.gnv.utils.DistanceCalculator;
-import de.intevation.gnv.utils.StringUtils;
-import de.intevation.gnv.utils.WKTUtils;
-
 import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Paint;
-
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -80,8 +19,49 @@
 import net.sf.ehcache.Element;
 
 import org.apache.log4j.Logger;
+import org.jfree.chart.ChartTheme;
 
-import org.jfree.chart.ChartTheme;
+import com.vividsolutions.jts.geom.Coordinate;
+
+import de.intevation.artifacts.CallContext;
+import de.intevation.gnv.artifacts.cache.CacheFactory;
+import de.intevation.gnv.artifacts.context.GNVArtifactContext;
+import de.intevation.gnv.artifacts.ressource.RessourceFactory;
+import de.intevation.gnv.chart.Chart;
+import de.intevation.gnv.chart.ChartLabels;
+import de.intevation.gnv.chart.VerticalCrossSectionChart;
+import de.intevation.gnv.geobackend.base.Result;
+import de.intevation.gnv.geobackend.base.ResultDescriptor;
+import de.intevation.gnv.geobackend.base.query.QueryExecutor;
+import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory;
+import de.intevation.gnv.geobackend.base.query.exception.QueryException;
+import de.intevation.gnv.geobackend.sde.datasources.RasterObject;
+import de.intevation.gnv.jfreechart.PolygonDataset;
+import de.intevation.gnv.jfreechart.PolygonSeries;
+import de.intevation.gnv.math.AttributedXYColumns;
+import de.intevation.gnv.math.HeightValue;
+import de.intevation.gnv.math.IJKey;
+import de.intevation.gnv.math.Interpolation3D;
+import de.intevation.gnv.math.LinearMetrics;
+import de.intevation.gnv.math.QueriedXYDepth;
+import de.intevation.gnv.math.XYColumn;
+import de.intevation.gnv.raster.Filter;
+import de.intevation.gnv.raster.IsoAttributeGenerator;
+import de.intevation.gnv.raster.IsoPolygonSeriesProducer;
+import de.intevation.gnv.raster.Palette;
+import de.intevation.gnv.raster.PaletteManager;
+import de.intevation.gnv.raster.PolygonDatasetProducer;
+import de.intevation.gnv.raster.Raster;
+import de.intevation.gnv.raster.Vectorizer;
+import de.intevation.gnv.state.InputData;
+import de.intevation.gnv.state.describedata.KeyValueDescibeData;
+import de.intevation.gnv.state.exception.StateException;
+import de.intevation.gnv.state.timeseries.TimeSeriesOutputState;
+import de.intevation.gnv.statistics.Statistics;
+import de.intevation.gnv.statistics.VerticalCrossSectionStatistics;
+import de.intevation.gnv.utils.DistanceCalculator;
+import de.intevation.gnv.utils.StringUtils;
+import de.intevation.gnv.utils.WKTUtils;
 
 /**
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
@@ -174,6 +154,7 @@
     protected Object getChartResult(String uuid, CallContext callContext) {
         log.debug("VerticalCrossSectionOutputState.getChartResult");
         String key = getHash();
+        log.debug("Hash: "+key);
 
         CacheFactory factory = CacheFactory.getInstance();
         if (factory.isInitialized()) {
@@ -685,5 +666,15 @@
     {
         // TODO: Implement a substitution which makes sense.
     }
+
+    @Override
+    protected void createODV(OutputStream outputStream, String uuid,
+                             CallContext callContext) throws IOException,
+                                                     StateException {
+        Object chartResult = this.getChartResult(uuid, callContext);
+        log.debug("Hier gehts weiter");
+    }
+
+
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Tue Apr 13 14:26:21 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Tue Apr 13 14:35:30 2010 +0000
@@ -481,8 +481,7 @@
 
             }
             else if (outputMode.equalsIgnoreCase("odv")) {
-                Collection<Result> odvResult = this.getODVResult(uuid);
-                this.createODV(outputStream, odvResult,uuid);
+                createODV(outputStream, uuid, callContext);
             }
         } catch (IOException e) {
             log.error(e, e);
@@ -498,6 +497,22 @@
 
 
     /**
+     * @param outputStream
+     * @param uuid
+     * @throws IOException
+     * @throws StateException
+     */
+    protected void createODV(OutputStream outputStream, 
+                             String uuid, 
+                             CallContext callContext)
+                                                    throws IOException,
+                                                    StateException {
+        Collection<Result> odvResult = this.getODVResult(uuid);
+        this.createODV(outputStream, odvResult,uuid);
+    }
+
+
+    /**
      * Retrieves the export format (e.g. png, gif, jpeg).
      *
      * @param mime Export format specified by the incoming  request.

http://dive4elements.wald.intevation.org