comparison flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java @ 1370:9085cffbb7c4

Made the URL of Artifact server available via ServletContext parameter. flys-client/trunk@3075 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 25 Oct 2011 13:41:05 +0000
parents ec0c81f2c7a4
children 28eb4dfe2cbf
comparison
equal deleted inserted replaced
1369:1fae113b93fd 1370:9085cffbb7c4
29 29
30 private static final Logger logger = 30 private static final Logger logger =
31 Logger.getLogger(MapOutputServiceImpl.class); 31 Logger.getLogger(MapOutputServiceImpl.class);
32 32
33 33
34 public void doOut(Collection collection, String serverUrl) 34 public void doOut(Collection collection)
35 throws ServerException 35 throws ServerException
36 { 36 {
37 String url = (String) getServletContext().getAttribute("server-url");
38
39 logger.info("MapOutputServiceImpl.doOut"); 37 logger.info("MapOutputServiceImpl.doOut");
40 38
39 String url = getServletContext().getInitParameter("server-url");
41 String uuid = collection.identifier(); 40 String uuid = collection.identifier();
42 41
43 try { 42 try {
44 Document request = ClientProtocolUtils.newOutCollectionDocument( 43 Document request = ClientProtocolUtils.newOutCollectionDocument(
45 uuid, "floodmap", "floodmap"); 44 uuid, "floodmap", "floodmap");
46 45
47 HttpClient client = new HttpClientImpl(serverUrl); 46 HttpClient client = new HttpClientImpl(url);
48 InputStream is = client.collectionOut(request, uuid, "floodmap"); 47 InputStream is = client.collectionOut(request, uuid, "floodmap");
49 48
50 Document response = XMLUtils.parseDocument(is); 49 Document response = XMLUtils.parseDocument(is);
51 50
52 logger.debug(XMLUtils.toString(response)); 51 logger.debug(XMLUtils.toString(response));

http://dive4elements.wald.intevation.org