Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java @ 1735:5966a20fc72c
Enabled support for PDF and SVG chart exports.
flys-artifacts/trunk@3023 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 19 Oct 2011 09:43:04 +0000 |
parents | bdb05dc9b763 |
children | 41ba2276d785 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java Tue Oct 18 15:34:07 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java Wed Oct 19 09:43:04 2011 +0000 @@ -48,11 +48,17 @@ /** The default chart height, if no other height is set.*/ public static final int DEFAULT_CHART_HEIGHT = 400; + /** The default chart format, if no other height is set.*/ + public static final String DEFAULT_CHART_FORMAT = "png"; + /** The XPath that points to the chart size of the incoming request * document.*/ public static final String XPATH_CHART_SIZE = "/art:action/art:attributes/art:size"; + public static final String XPATH_CHART_FORMAT = + "/art:action/art:attributes/art:format/@art:value"; + public static final String XPATH_CHART_X_RANGE = "/art:action/art:attributes/art:xrange"; @@ -165,6 +171,19 @@ } + protected String getFormat() { + String format = (String) XMLUtils.xpath( + request, + XPATH_CHART_FORMAT, + XPathConstants.STRING, + ArtifactNamespaceContext.INSTANCE); + + return format == null || format.length() == 0 + ? DEFAULT_CHART_FORMAT + : format; + } + + protected Range getDomainAxisRange() { Element xrange = (Element)XMLUtils.xpath( request,