Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/MapPrintServiceImpl.java @ 4433:5b8919ef601d
Backed out changeset e8a4d2fd25cc
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 07 Nov 2012 12:23:41 +0100 |
parents | 6ef48927df38 |
children | 9fca4d60fb7c |
comparison
equal
deleted
inserted
replaced
4432:e8a4d2fd25cc | 4433:5b8919ef601d |
---|---|
1 package de.intevation.flys.client.server; | 1 package de.intevation.flys.client.server; |
2 | 2 |
3 import de.intevation.artifacts.common.ArtifactNamespaceContext; | 3 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
4 | |
4 import de.intevation.artifacts.common.utils.ClientProtocolUtils; | 5 import de.intevation.artifacts.common.utils.ClientProtocolUtils; |
5 import de.intevation.artifacts.common.utils.JSON; | 6 import de.intevation.artifacts.common.utils.JSON; |
6 import de.intevation.artifacts.common.utils.StringUtils; | 7 import de.intevation.artifacts.common.utils.StringUtils; |
7 import de.intevation.artifacts.common.utils.XMLUtils; | 8 import de.intevation.artifacts.common.utils.XMLUtils; |
9 | |
8 import de.intevation.artifacts.httpclient.exceptions.ConnectionException; | 10 import de.intevation.artifacts.httpclient.exceptions.ConnectionException; |
11 | |
9 import de.intevation.artifacts.httpclient.http.HttpClient; | 12 import de.intevation.artifacts.httpclient.http.HttpClient; |
10 import de.intevation.artifacts.httpclient.http.HttpClientImpl; | 13 import de.intevation.artifacts.httpclient.http.HttpClientImpl; |
14 | |
11 import de.intevation.artifacts.httpclient.http.response.DocumentResponseHandler; | 15 import de.intevation.artifacts.httpclient.http.response.DocumentResponseHandler; |
16 | |
17 import de.intevation.flys.client.shared.model.MapConfig; | |
12 import de.intevation.flys.client.shared.MapUtils; | 18 import de.intevation.flys.client.shared.MapUtils; |
13 import de.intevation.flys.client.shared.model.MapConfig; | 19 |
14 | |
15 import java.io.IOException; | |
16 import java.io.InputStream; | |
17 import java.io.OutputStream; | |
18 import java.io.UnsupportedEncodingException; | |
19 import java.net.URLEncoder; | |
20 import java.util.ArrayList; | |
21 import java.util.Collections; | |
22 import java.util.LinkedHashMap; | |
23 import java.util.List; | |
24 import java.util.Map; | |
25 | |
26 import javax.servlet.ServletException; | |
27 import javax.servlet.http.HttpServlet; | |
28 import javax.servlet.http.HttpServletRequest; | |
29 import javax.servlet.http.HttpServletResponse; | |
30 | |
31 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; | |
32 import org.apache.commons.httpclient.methods.GetMethod; | |
33 import org.apache.log4j.Logger; | |
34 import org.w3c.dom.Document; | |
35 import org.w3c.dom.Element; | |
36 import org.w3c.dom.NodeList; | |
37 /* | 20 /* |
38 import java.io.BufferedInputStream; | 21 import java.io.BufferedInputStream; |
39 import java.io.BufferedOutputStream; | 22 import java.io.BufferedOutputStream; |
40 import java.io.File; | 23 import java.io.File; |
41 import java.io.FileInputStream; | 24 import java.io.FileInputStream; |
42 import java.io.FileOutputStream; | 25 import java.io.FileOutputStream; |
43 */ | 26 */ |
27 import java.io.IOException; | |
28 import java.io.InputStream; | |
29 import java.io.OutputStream; | |
30 import java.io.UnsupportedEncodingException; | |
31 | |
32 import java.net.URLEncoder; | |
33 | |
34 import java.util.ArrayList; | |
35 import java.util.Collections; | |
36 import java.util.LinkedHashMap; | |
37 import java.util.List; | |
38 import java.util.Map; | |
39 | |
40 import javax.servlet.ServletException; | |
41 | |
42 import javax.servlet.http.HttpServlet; | |
43 import javax.servlet.http.HttpServletRequest; | |
44 import javax.servlet.http.HttpServletResponse; | |
45 | |
46 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; | |
47 | |
48 import org.apache.commons.httpclient.methods.GetMethod; | |
49 | |
50 import org.apache.log4j.Logger; | |
51 | |
44 /* Used by direct API call. -> Enforce GPLv3 | 52 /* Used by direct API call. -> Enforce GPLv3 |
45 import org.mapfish.print.MapPrinter; | 53 import org.mapfish.print.MapPrinter; |
46 import org.mapfish.print.output.OutputFactory; | 54 import org.mapfish.print.output.OutputFactory; |
47 import org.mapfish.print.output.OutputFormat; | 55 import org.mapfish.print.output.OutputFormat; |
48 | 56 |
49 import org.mapfish.print.utils.PJsonObject; | 57 import org.mapfish.print.utils.PJsonObject; |
50 */ | 58 */ |
59 | |
60 import org.w3c.dom.Document; | |
61 import org.w3c.dom.Element; | |
62 import org.w3c.dom.NodeList; | |
51 | 63 |
52 public class MapPrintServiceImpl | 64 public class MapPrintServiceImpl |
53 extends HttpServlet | 65 extends HttpServlet |
54 { | 66 { |
55 private static final Logger log = | 67 private static final Logger log = |
357 | 369 |
358 org.apache.commons.httpclient.HttpClient client = | 370 org.apache.commons.httpclient.HttpClient client = |
359 new org.apache.commons.httpclient.HttpClient( | 371 new org.apache.commons.httpclient.HttpClient( |
360 new MultiThreadedHttpConnectionManager()); | 372 new MultiThreadedHttpConnectionManager()); |
361 | 373 |
362 // FIXME: The request is not authenticated. | |
363 // Currently this is not a problem because /flys/map-print | |
364 // is whitelisted in GGInAFilter. | |
365 GetMethod get = new GetMethod(url); | 374 GetMethod get = new GetMethod(url); |
366 int result = client.executeMethod(get); | 375 int result = client.executeMethod(get); |
367 InputStream in = get.getResponseBodyAsStream(); | 376 InputStream in = get.getResponseBodyAsStream(); |
368 | 377 |
369 if (in != null) { | 378 if (in != null) { |