annotate gwt-client/src/main/java/org/dive4elements/river/client/server/ChartServiceHelper.java @ 9104:07d51fd4864c

Added metadata subtitle to all chart export
author gernotbelger
date Tue, 29 May 2018 11:35:44 +0200
parents 238fc722f87a
children 4809e23ffd27
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
6 * documentation coming with Dive4Elements River for details.
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.server;
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import java.util.Map;
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import org.w3c.dom.Document;
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import org.w3c.dom.Element;
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
1367
ab8eb2f544f2 Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1351
diff changeset
16 import org.apache.log4j.Logger;
ab8eb2f544f2 Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1351
diff changeset
17
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
18 import org.dive4elements.artifacts.common.ArtifactNamespaceContext;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
19 import org.dive4elements.artifacts.common.utils.XMLUtils;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
20 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator;
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 /**
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 */
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 public class ChartServiceHelper {
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
28 private static final Logger log =
1367
ab8eb2f544f2 Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1351
diff changeset
29 Logger.getLogger(ChartServiceHelper.class);
ab8eb2f544f2 Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1351
diff changeset
30
ab8eb2f544f2 Replaced stdout and stderr logging with log4j loggers in server classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1351
diff changeset
31
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 /** The default chart width if no value is specified in the request.*/
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 public static final int DEFAULT_CHART_WIDTH = 600;
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 /** The default chart height if no value is specified in the request.*/
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 public static final int DEFAULT_CHART_HEIGHT = 400;
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 private ChartServiceHelper() {
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 }
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 /**
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 * This method returns a document which might contain parameters to adjust
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 * chart settings. The document is created using the information that are
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 * contained in the request object.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 *
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 * @param req The request document.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 *
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 * @return a document to adjust chart settings.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 */
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 protected static Document getChartAttributes(Map<String, String> req) {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
52 log.debug("ChartServiceHelper.getChartAttributes");
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 Document doc = XMLUtils.newDocument();
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 ElementCreator ec = new ElementCreator(
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 doc,
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 ArtifactNamespaceContext.NAMESPACE_URI,
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 ArtifactNamespaceContext.NAMESPACE_PREFIX);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 Element attributes = ec.create("attributes");
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 appendChartSize(req, attributes, ec);
1351
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
64 appendFormat(req, attributes, ec);
9104
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
65 appendExport(req, attributes, ec);
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 appendXRange(req, attributes, ec);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 appendYRange(req, attributes, ec);
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
68 appendCurrentKm(req, attributes, ec);
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 doc.appendChild(attributes);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 return doc;
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 }
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 /**
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 * This method extracts the size (width/height) of a chart from request
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 * object and append those values - if they exist - to the attribute
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 * document used to adjust chart settings.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 *
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 * @param req The request object that might contain the chart size.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 * @param attributes The attributes element used to adjust chart settings.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 * @param ec The ElementCreator that might be used to create new Elements.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 */
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85 protected static void appendChartSize(
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 Map<String, String> req,
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 Element attributes,
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 ElementCreator ec)
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
90 log.debug("ChartServiceHelper.appendChartSize");
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 Element size = ec.create("size");
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 String width = req.get("width");
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 String height = req.get("height");
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 if (width == null || height == null) {
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98 width = String.valueOf(DEFAULT_CHART_WIDTH);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 height = String.valueOf(DEFAULT_CHART_HEIGHT);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 }
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102 ec.addAttr(size, "width", width, true);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 ec.addAttr(size, "height", height, true);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
104
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 attributes.appendChild(size);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 }
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 /**
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 * This method extracts the x range for the chart from request object and
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 * appends those range - if it exists - to the attribute document used to
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 * adjust the chart settings.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 *
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 * @param req The request object that might contain the chart size.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 * @param doc The attribute document used to adjust chart settings.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 * @param ec The ElementCreator that might be used to create new Elements.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 */
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 protected static void appendXRange(
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119 Map<String, String> req,
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 Element attributes,
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 ElementCreator ec)
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122 {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
123 log.debug("ChartServiceHelper.appendXRange");
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125 Element range = ec.create("xrange");
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127 String from = req.get("minx");
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 String to = req.get("maxx");
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 if (from != null && to != null) {
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 ec.addAttr(range, "from", from, true);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
132 ec.addAttr(range, "to", to, true);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
134 attributes.appendChild(range);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
135 }
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 }
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
137
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
139 /**
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
140 * This method extracts the x range for the chart from request object and
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
141 * appends those range - if it exists - to the attribute document used to
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
142 * adjust the chart settings.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
143 *
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
144 * @param req The request object that might contain the chart size.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
145 * @param doc The attribute document used to adjust chart settings.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
146 * @param ec The ElementCreator that might be used to create new Elements.
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
147 */
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
148 protected static void appendYRange(
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149 Map<String, String> req,
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150 Element attributes,
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151 ElementCreator ec)
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152 {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
153 log.debug("ChartServiceHelper.appendYRange");
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
154
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
155 Element range = ec.create("yrange");
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
156
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
157 String from = req.get("miny");
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
158 String to = req.get("maxy");
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
159
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
160 if (from != null && to != null) {
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
161 ec.addAttr(range, "from", from, true);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
162 ec.addAttr(range, "to", to, true);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
163
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
164 attributes.appendChild(range);
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
165 }
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
166 }
1351
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
167
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
168
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
169 /**
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
170 * This method extracts the format string from request object and appends
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
171 * those format - if existing - to the attribute document used to adjust
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
172 * the chart settings.
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
173 *
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
174 * @param req The request object that might contain the chart format.
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
175 * @param doc The attribute document used to adjust chart settings.
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
176 * @param ec The ElementCreator that might be used to create new Elements.
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
177 */
9104
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
178 private static void appendFormat(
1351
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
179 Map<String, String> req,
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
180 Element attributes,
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
181 ElementCreator ec
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
182
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
183 ) {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
184 log.debug("ChartServiceHelper.appendFormat");
1351
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
185
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
186 String formatStr = req.get("format");
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
187 if (formatStr == null || formatStr.length() == 0) {
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
188 return;
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
189 }
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
190
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
191 Element format = ec.create("format");
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
192 ec.addAttr(format, "value", formatStr, true);
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
193
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
194 attributes.appendChild(format);
19f621663b7a Add the format (png, pdf, svg) string into the xml document which is used for querying charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 549
diff changeset
195 }
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
196
9104
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
197 /**
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
198 * This method extracts the export string from request object and appends
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
199 * those format - if existing - to the attribute document used to adjust
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
200 * the chart settings.
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
201 *
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
202 * @param req The request object that might contain the chart export flag.
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
203 * @param doc The attribute document used to adjust chart settings.
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
204 * @param ec The ElementCreator that might be used to create new Elements.
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
205 */
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
206 private static void appendExport( final Map<String, String> req, final Element attributes, final ElementCreator ec ) {
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
207
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
208 final String exportStr = req.get("export");
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
209 if (exportStr == null || exportStr.isEmpty())
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
210 return;
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
211
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
212 final Element format = ec.create("export");
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
213 ec.addAttr(format, "value", exportStr, true);
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
214
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
215 attributes.appendChild(format);
07d51fd4864c Added metadata subtitle to all chart export
gernotbelger
parents: 8203
diff changeset
216 }
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
217
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
218 /**
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
219 * This method extracts the current km for the chart from request object and
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
220 * appends this km - if it exists - to the attribute document used to
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
221 * adjust the chart settings.
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
222 *
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
223 * @param req The request object that might contain the chart size.
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
224 * @param doc The attribute document used to adjust chart settings.
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
225 * @param ec The ElementCreator that might be used to create new Elements.
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
226 */
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
227 protected static void appendCurrentKm(
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
228 Map<String, String> req,
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
229 Element attributes,
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
230 ElementCreator ec)
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
231 {
8203
238fc722f87a sed 's/logger/log/g' src/**/*.java
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5993
diff changeset
232 log.debug("ChartServiceHelper.appendCurrentKm");
2906
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
233
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
234 Element currentKm = ec.create("currentKm");
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
235
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
236 String km = req.get("km");
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
237
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
238 if (km != null) {
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
239 ec.addAttr(currentKm, "km", km, true);
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
240
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
241 attributes.appendChild(currentKm);
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
242 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
243 }
1780841d79af Added navigation to fix analysis charts.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1367
diff changeset
244
549
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
245 }
e74bf6bfeeb6 Use the same code to create the attribute document for the chart creation in ChartOutputService and ChartInfoService.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
246 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org