Strabon

changeset 498:65e4d6ffab1a

Now DescribeBean also checks for "query" parameter after checking "SPARQLQuery" parameter to comply with the SPARQL Protocol
author Babis Nikolaou <charnik@di.uoa.gr>
date Mon Jul 23 20:25:23 2012 +0300 (2012-07-23)
parents ff46d93c0c3b
children ef9c43dd2c78
files endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/DescribeBean.java
line diff
     1.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/DescribeBean.java	Mon Jul 23 17:47:07 2012 +0300
     1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/DescribeBean.java	Mon Jul 23 20:25:23 2012 +0300
     1.3 @@ -32,9 +32,7 @@
     1.4  	private StrabonBeanWrapper strabonWrapper;
     1.5  
     1.6      @Override
     1.7 -	public void doGet(HttpServletRequest request, HttpServletResponse response)
     1.8 -	throws ServletException, IOException 
     1.9 -	{
    1.10 +	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    1.11  		doPost(request, response);
    1.12  	}
    1.13  
    1.14 @@ -43,8 +41,16 @@
    1.15  		request.setCharacterEncoding("UTF-8");
    1.16  
    1.17  		String query = request.getParameter("SPARQLQuery");
    1.18 +		
    1.19  		if (query != null) {
    1.20 -			query = URLDecoder.decode(request.getParameter("SPARQLQuery"), "UTF-8");	
    1.21 +			query = URLDecoder.decode(request.getParameter("SPARQLQuery"), "UTF-8");
    1.22 +			
    1.23 +		} else { // check for SPARQL protocol "query" parameter
    1.24 +			query = request.getParameter("query");
    1.25 +			
    1.26 +			if (query != null) {
    1.27 +				query = URLDecoder.decode(request.getParameter("query"), "UTF-8");
    1.28 +			}
    1.29  		}
    1.30  		
    1.31  		// get the RDF format (checks the "format" and then the "accept" parameters)