Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/ChartServiceHelper.java @ 1351:19f621663b7a
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
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 19 Oct 2011 09:35:41 +0000 |
parents | e74bf6bfeeb6 |
children | ab8eb2f544f2 |
comparison
equal
deleted
inserted
replaced
1350:064fb5d181ea | 1351:19f621663b7a |
---|---|
45 ArtifactNamespaceContext.NAMESPACE_PREFIX); | 45 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
46 | 46 |
47 Element attributes = ec.create("attributes"); | 47 Element attributes = ec.create("attributes"); |
48 | 48 |
49 appendChartSize(req, attributes, ec); | 49 appendChartSize(req, attributes, ec); |
50 appendFormat(req, attributes, ec); | |
50 appendXRange(req, attributes, ec); | 51 appendXRange(req, attributes, ec); |
51 appendYRange(req, attributes, ec); | 52 appendYRange(req, attributes, ec); |
52 | 53 |
53 doc.appendChild(attributes); | 54 doc.appendChild(attributes); |
54 | 55 |
145 ec.addAttr(range, "to", to, true); | 146 ec.addAttr(range, "to", to, true); |
146 | 147 |
147 attributes.appendChild(range); | 148 attributes.appendChild(range); |
148 } | 149 } |
149 } | 150 } |
151 | |
152 | |
153 /** | |
154 * This method extracts the format string from request object and appends | |
155 * those format - if existing - to the attribute document used to adjust | |
156 * the chart settings. | |
157 * | |
158 * @param req The request object that might contain the chart format. | |
159 * @param doc The attribute document used to adjust chart settings. | |
160 * @param ec The ElementCreator that might be used to create new Elements. | |
161 */ | |
162 protected static void appendFormat( | |
163 Map<String, String> req, | |
164 Element attributes, | |
165 ElementCreator ec | |
166 | |
167 ) { | |
168 System.out.println("ChartServiceHelper.appendFormat"); | |
169 | |
170 String formatStr = req.get("format"); | |
171 if (formatStr == null || formatStr.length() == 0) { | |
172 return; | |
173 } | |
174 | |
175 Element format = ec.create("format"); | |
176 ec.addAttr(format, "value", formatStr, true); | |
177 | |
178 attributes.appendChild(format); | |
179 } | |
150 } | 180 } |
151 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 181 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |