# HG changeset patch # User Ingo Weinzierl # Date 1319016941 0 # Node ID 19f621663b7a0bb19fcb3d9d3282b05b9e917d1d # Parent 064fb5d181ea89f36080531271432fa066f60832 Add the format (png, pdf, svg) string into the xml document which is used for querying charts. flys-client/trunk@3022 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 064fb5d181ea -r 19f621663b7a flys-client/ChangeLog --- a/flys-client/ChangeLog Wed Oct 19 08:02:52 2011 +0000 +++ b/flys-client/ChangeLog Wed Oct 19 09:35:41 2011 +0000 @@ -1,3 +1,8 @@ +2011-10-19 Ingo Weinzierl + + * src/main/java/de/intevation/flys/client/server/ChartServiceHelper.java: + Add the format string into the xml document for querying charts. + 2011-10-19 Ingo Weinzierl * src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java: diff -r 064fb5d181ea -r 19f621663b7a flys-client/src/main/java/de/intevation/flys/client/server/ChartServiceHelper.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/ChartServiceHelper.java Wed Oct 19 08:02:52 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/ChartServiceHelper.java Wed Oct 19 09:35:41 2011 +0000 @@ -47,6 +47,7 @@ Element attributes = ec.create("attributes"); appendChartSize(req, attributes, ec); + appendFormat(req, attributes, ec); appendXRange(req, attributes, ec); appendYRange(req, attributes, ec); @@ -147,5 +148,34 @@ attributes.appendChild(range); } } + + + /** + * This method extracts the format string from request object and appends + * those format - if existing - to the attribute document used to adjust + * the chart settings. + * + * @param req The request object that might contain the chart format. + * @param doc The attribute document used to adjust chart settings. + * @param ec The ElementCreator that might be used to create new Elements. + */ + protected static void appendFormat( + Map req, + Element attributes, + ElementCreator ec + + ) { + System.out.println("ChartServiceHelper.appendFormat"); + + String formatStr = req.get("format"); + if (formatStr == null || formatStr.length() == 0) { + return; + } + + Element format = ec.create("format"); + ec.addAttr(format, "value", formatStr, true); + + attributes.appendChild(format); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :