Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/server/FixingsKMChartServiceImpl.java @ 6040:cbdf839008a7
Add a new function to create a GaugeDischarge+MainValueArtifact collection.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 16 May 2013 16:31:09 +0200 |
parents | ea9eef426962 |
children | 0a5239a1e46e |
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; |
2488
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
11 import org.dive4elements.artifacts.common.utils.XMLUtils; |
2488
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
13 import org.dive4elements.artifacts.httpclient.http.HttpClient; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
14 import org.dive4elements.artifacts.httpclient.http.HttpClientImpl; |
2488
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
16 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
17 |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
18 import org.dive4elements.artifacts.httpclient.http.response.StreamResponseHandler; |
2488
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 import java.io.IOException; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 import java.io.InputStream; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 import java.io.OutputStream; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 import javax.servlet.http.HttpServlet; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 import javax.servlet.http.HttpServletRequest; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 import javax.servlet.http.HttpServletResponse; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 import org.apache.log4j.Logger; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 import org.w3c.dom.Document; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 import org.w3c.dom.Element; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 import org.w3c.dom.NodeList; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 public class FixingsKMChartServiceImpl |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 extends HttpServlet |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 private static final Logger log = |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 Logger.getLogger(FixingsKMChartServiceImpl.class); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 public static final String SERVICE_NAME = "fixings-km-chart"; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 public FixingsKMChartServiceImpl() { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 public void doGet(HttpServletRequest req, HttpServletResponse resp) { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 log.info("FixingsKMChartServiceImpl.doGet"); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 String url = getServletContext().getInitParameter("server-url"); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 String locale = req.getParameter("locale"); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 String filter = req.getParameter("filter"); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 if (filter == null || filter.length() == 0) { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 log.warn("Missing 'filter' parameter."); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 return; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
58 if (locale == null || locale.length() == 0) { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
59 locale = "de"; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
60 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 Document filterDoc = XMLUtils.jsonToXML(filter); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 if (filterDoc == null) { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
65 log.warn("Creating filter document failed."); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
66 return; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
67 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
68 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 InputStream in; |
2905
51ed89b754ae
FLYS client: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2493
diff
changeset
|
70 |
2488
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 try { |
2493
f905c936ffff
Added the XSL transformation to generate the fixings overview.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2488
diff
changeset
|
72 HttpClient client = new HttpClientImpl(url, locale); |
2488
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
73 in = (InputStream)client.callService( |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
74 url, // XXX: Why? The URL is passed by construction already. |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
75 SERVICE_NAME, |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
76 filterDoc, |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
77 new StreamResponseHandler()); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
78 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 catch (ConnectionException ce) { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 log.error(ce); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 return; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 |
2493
f905c936ffff
Added the XSL transformation to generate the fixings overview.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2488
diff
changeset
|
84 resp.setHeader("Content-Type", guessMIMEType(filterDoc)); |
f905c936ffff
Added the XSL transformation to generate the fixings overview.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2488
diff
changeset
|
85 |
2488
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
86 try { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
87 OutputStream out = resp.getOutputStream(); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
88 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
89 byte [] buf = new byte[4096]; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
90 int i = -1; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
91 while ((i = in.read(buf)) >= 0) { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
92 out.write(buf, 0, i); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
93 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 out.flush(); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 catch (IOException ioe) { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 log.error(ioe); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 finally { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 try { in.close(); } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 catch (IOException ioe) { /* ignored */ } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
105 protected static String guessMIMEType(Document document) { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 NodeList formats = document.getElementsByTagName("format"); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 String format = "png"; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
110 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 if (formats.getLength() > 0) { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
112 String type = ((Element)formats.item(0)).getAttribute("type"); |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
113 if (type.length() > 0) { |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 format = type; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
116 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
117 |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 return "image/" + format; |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 } |
88d44cae592e
Added new proxy servlet to bridge the fixing km chart requests to the artefact server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |