changeset 299:d6c75171f1e9

Pass the xml document of the request to OutputTransition for more information about output formats of charts (png,jpeg). gnv-artifacts/trunk@353 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 19 Nov 2009 17:54:18 +0000 (2009-11-19)
parents 80f7c5dc09c6
children 6a3a02e004d9
files gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java
diffstat 3 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java	Thu Nov 19 15:30:27 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java	Thu Nov 19 17:54:18 2009 +0000
@@ -440,7 +440,7 @@
 
             if (current != null && current instanceof OutputTransition) {
                 ((OutputTransition) current)
-                        .out(this.readOutputType(format), this.parseInputData(
+                        .out(format, this.parseInputData(
                                 format, "/action/out/params/input"),
                                 outputStream, super.identifier, context.getMeta());
             }
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransition.java	Thu Nov 19 15:30:27 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransition.java	Thu Nov 19 17:54:18 2009 +0000
@@ -6,6 +6,8 @@
 import java.io.OutputStream;
 import java.util.Collection;
 
+import org.w3c.dom.Document;
+
 import de.intevation.artifacts.CallMeta;
 import de.intevation.gnv.transition.exception.TransitionException;
 
@@ -23,7 +25,7 @@
      * @return The Bytecode of the Result
      * @throws TransitionException
      */
-    public void out(String outputMode, Collection<InputData> inputData,
+    public void out(Document format, Collection<InputData> inputData,
                     OutputStream outputStream, String uuid, CallMeta callMeta)
                                                                               throws TransitionException;
 
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java	Thu Nov 19 15:30:27 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java	Thu Nov 19 17:54:18 2009 +0000
@@ -13,6 +13,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import javax.imageio.ImageIO;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerException;
@@ -33,9 +34,11 @@
 import de.intevation.artifacts.CallMeta;
 import de.intevation.artifacts.PreferredLocale;
 import de.intevation.gnv.artifacts.ressource.RessourceFactory;
+import de.intevation.gnv.chart.TestChart;
 import de.intevation.gnv.chart.ChartFactory;
 import de.intevation.gnv.chart.ChartLabels;
 import de.intevation.gnv.chart.ChartStyle;
+import de.intevation.gnv.chart.TimeSeriesChart;
 import de.intevation.gnv.chart.exception.TechnicalChartException;
 import de.intevation.gnv.exports.DefaultExport;
 import de.intevation.gnv.exports.DefaultProfile;
@@ -159,10 +162,11 @@
      *      java.util.Collection, java.io.OutputStream, java.lang.String,
      *      de.intevation.artifacts.CallMeta)
      */
-    public void out(String outputMode, Collection<InputData> inputData,
+    public void out(Document format, Collection<InputData> inputData,
                     OutputStream outputStream, String uuid, CallMeta callMeta)
                                                                               throws TransitionException {
         log.debug("TimeSeriesOutputTransition.out");
+        String outputMode = Config.getStringXPath(format, "action/out/@name");
         try {
 
             this.advance(uuid, callMeta); // TODO This hsould only be done if it is nessessary

http://dive4elements.wald.intevation.org