Strabon

changeset 175:f986c0fce749

asynchronous stuff really suck
author Michael Sioutis
date Tue May 22 15:44:19 2012 +0300 (2012-05-22)
parents 2ecb0d2877a8
children 1d7ebafc223f
files endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java
line diff
     1.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Tue May 22 15:14:43 2012 +0300
     1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Tue May 22 15:44:19 2012 +0300
     1.3 @@ -122,10 +122,10 @@
     1.4  			hive.setFormat("HTML");
     1.5  			response.setContentType("text/html; charset=UTF-8");			
     1.6  		} else if (reqAccept.contains("application/vnd.google-earth.kml+xml")) {
     1.7 -			response.setContentType("application/vnd.google-earth.kml+xml; charset=UTF-8");
     1.8 +			response.setContentType("application/vnd.google-earth.kml+xml");
     1.9  			hive.setFormat("KML");
    1.10  		} else if (reqAccept.contains("application/vnd.google-earth.kmz")) {
    1.11 -			response.setContentType("application/vnd.google-earth.kmz; charset=UTF-8");
    1.12 +			response.setContentType("application/vnd.google-earth.kmz");
    1.13  			hive.setFormat("KMZ");
    1.14  		} else if (reqAccept.contains("application/sparql-results+xml")) {			
    1.15  			response.setContentType("application/sparql-results+xml; charset=UTF-8");
    1.16 @@ -134,10 +134,11 @@
    1.17  			response.setContentType("text/xml; charset=UTF-8");
    1.18  			hive.setFormat("XML");
    1.19  		} else if (reqFormat.equalsIgnoreCase("KML")) {
    1.20 -			response.setContentType("application/vnd.google-earth.kml+xml; charset=UTF-8");
    1.21 +			response.setContentType("text/plain; charset=UTF-8");
    1.22 +                        response.setHeader("Content-Disposition","attachment;filename=pico.kml");
    1.23  			hive.setFormat("KML");
    1.24  		} else if (reqFormat.equalsIgnoreCase("KMZ")) {
    1.25 -			response.setContentType("application/vnd.google-earth.kmz; charset=UTF-8");
    1.26 +			response.setContentType("application/vnd.google-earth.kmz");
    1.27  			hive.setFormat("KMZ");
    1.28  		} else if (reqFormat.equalsIgnoreCase("SPARQLRESULTS"))  {
    1.29  			response.setContentType("application/sparql-results+xml; charset=UTF-8");
    1.30 @@ -198,11 +199,11 @@
    1.31  				answer = e.getMessage();
    1.32  			}
    1.33  
    1.34 -			//response.setContentType("text/plain; charset=UTF-8");
    1.35 +                        //response.setContentType("text/plain");
    1.36 +			//response.setCharacterEncoding("UTF-8");
    1.37                          response.setStatus(status_code);
    1.38 -                        response.setHeader("Content-Disposition","attachment; filename=pico.kml");
    1.39  			if (status_code == HttpServletResponse.SC_OK) {
    1.40 -                                response.setContentLength(answer.length());
    1.41 +                                //response.setContentLength(answer.length());
    1.42  				//response.getWriter().append(answer.toString());
    1.43                                  out.append(answer.toString());
    1.44                                  //out.flush();