comparison gwt-client/src/main/java/org/dive4elements/river/client/server/ChartOutputServiceImpl.java @ 7136:fd8b27cdf498

issue971: Let ChartOutputServiceImpl interprete an "encoding" parameter.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 25 Sep 2013 11:48:54 +0200
parents 7c3cab9330c4
children 6b278187ed9d
comparison
equal deleted inserted replaced
7135:7c3cab9330c4 7136:fd8b27cdf498
50 try { 50 try {
51 OutputStream out = resp.getOutputStream(); 51 OutputStream out = resp.getOutputStream();
52 52
53 String url = getServletContext().getInitParameter("server-url"); 53 String url = getServletContext().getInitParameter("server-url");
54 54
55 String uuid = req.getParameter("uuid"); 55 String uuid = req.getParameter("uuid");
56 String type = req.getParameter("type"); 56 String type = req.getParameter("type");
57 String locale = req.getParameter("locale"); 57 String locale = req.getParameter("locale");
58 String encoding = req.getParameter("encoding");
58 59
59 prepareHeader(req, resp); 60 prepareHeader(req, resp);
60 61
61 Document request = ClientProtocolUtils.newOutCollectionDocument( 62 Document request = ClientProtocolUtils.newOutCollectionDocument(
62 uuid, type, type, 63 uuid, type, type,
63 ChartServiceHelper.getChartAttributes(prepareChartAttributes(req))); 64 ChartServiceHelper.getChartAttributes(prepareChartAttributes(req)));
64 65
65 HttpClient client = new HttpClientImpl(url, locale); 66 HttpClient client = new HttpClientImpl(url, locale);
67
68 if (encoding != null) {
69 try {
70 client.setOutEncoding(
71 java.nio.charset.Charset.forName(encoding));
72 }
73 catch(java.nio.charset.UnsupportedCharsetException e) {
74 logger.warn("Unsupported encoding: " + encoding);
75 }
76 }
66 client.collectionOut(request, uuid, "chart", out); 77 client.collectionOut(request, uuid, "chart", out);
67 78
68 out.close(); 79 out.close();
69 out.flush(); 80 out.flush();
70 } 81 }

http://dive4elements.wald.intevation.org