comparison flys-client/src/main/java/de/intevation/flys/client/server/ChartServiceHelper.java @ 1367:ab8eb2f544f2

Replaced stdout and stderr logging with log4j loggers in server classes. flys-client/trunk@3069 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 25 Oct 2011 12:31:15 +0000
parents 19f621663b7a
children 1780841d79af
comparison
equal deleted inserted replaced
1366:d0eb2202ffbe 1367:ab8eb2f544f2
2 2
3 import java.util.Map; 3 import java.util.Map;
4 4
5 import org.w3c.dom.Document; 5 import org.w3c.dom.Document;
6 import org.w3c.dom.Element; 6 import org.w3c.dom.Element;
7
8 import org.apache.log4j.Logger;
7 9
8 import de.intevation.artifacts.common.ArtifactNamespaceContext; 10 import de.intevation.artifacts.common.ArtifactNamespaceContext;
9 import de.intevation.artifacts.common.utils.XMLUtils; 11 import de.intevation.artifacts.common.utils.XMLUtils;
10 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; 12 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator;
11 13
12 14
13 /** 15 /**
14 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 16 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
15 */ 17 */
16 public class ChartServiceHelper { 18 public class ChartServiceHelper {
19
20 private static final Logger logger =
21 Logger.getLogger(ChartServiceHelper.class);
22
17 23
18 /** The default chart width if no value is specified in the request.*/ 24 /** The default chart width if no value is specified in the request.*/
19 public static final int DEFAULT_CHART_WIDTH = 600; 25 public static final int DEFAULT_CHART_WIDTH = 600;
20 26
21 /** The default chart height if no value is specified in the request.*/ 27 /** The default chart height if no value is specified in the request.*/
33 * @param req The request document. 39 * @param req The request document.
34 * 40 *
35 * @return a document to adjust chart settings. 41 * @return a document to adjust chart settings.
36 */ 42 */
37 protected static Document getChartAttributes(Map<String, String> req) { 43 protected static Document getChartAttributes(Map<String, String> req) {
38 System.out.println("ChartServiceHelper.getChartAttributes"); 44 logger.debug("ChartServiceHelper.getChartAttributes");
39 45
40 Document doc = XMLUtils.newDocument(); 46 Document doc = XMLUtils.newDocument();
41 47
42 ElementCreator ec = new ElementCreator( 48 ElementCreator ec = new ElementCreator(
43 doc, 49 doc,
69 protected static void appendChartSize( 75 protected static void appendChartSize(
70 Map<String, String> req, 76 Map<String, String> req,
71 Element attributes, 77 Element attributes,
72 ElementCreator ec) 78 ElementCreator ec)
73 { 79 {
74 System.out.println("ChartServiceHelper.appendChartSize"); 80 logger.debug("ChartServiceHelper.appendChartSize");
75 81
76 Element size = ec.create("size"); 82 Element size = ec.create("size");
77 83
78 String width = req.get("width"); 84 String width = req.get("width");
79 String height = req.get("height"); 85 String height = req.get("height");
102 protected static void appendXRange( 108 protected static void appendXRange(
103 Map<String, String> req, 109 Map<String, String> req,
104 Element attributes, 110 Element attributes,
105 ElementCreator ec) 111 ElementCreator ec)
106 { 112 {
107 System.out.println("ChartServiceHelper.appendXRange"); 113 logger.debug("ChartServiceHelper.appendXRange");
108 114
109 Element range = ec.create("xrange"); 115 Element range = ec.create("xrange");
110 116
111 String from = req.get("minx"); 117 String from = req.get("minx");
112 String to = req.get("maxx"); 118 String to = req.get("maxx");
132 protected static void appendYRange( 138 protected static void appendYRange(
133 Map<String, String> req, 139 Map<String, String> req,
134 Element attributes, 140 Element attributes,
135 ElementCreator ec) 141 ElementCreator ec)
136 { 142 {
137 System.out.println("ChartServiceHelper.appendYRange"); 143 logger.debug("ChartServiceHelper.appendYRange");
138 144
139 Element range = ec.create("yrange"); 145 Element range = ec.create("yrange");
140 146
141 String from = req.get("miny"); 147 String from = req.get("miny");
142 String to = req.get("maxy"); 148 String to = req.get("maxy");
163 Map<String, String> req, 169 Map<String, String> req,
164 Element attributes, 170 Element attributes,
165 ElementCreator ec 171 ElementCreator ec
166 172
167 ) { 173 ) {
168 System.out.println("ChartServiceHelper.appendFormat"); 174 logger.debug("ChartServiceHelper.appendFormat");
169 175
170 String formatStr = req.get("format"); 176 String formatStr = req.get("format");
171 if (formatStr == null || formatStr.length() == 0) { 177 if (formatStr == null || formatStr.length() == 0) {
172 return; 178 return;
173 } 179 }

http://dive4elements.wald.intevation.org