Strabon

changeset 634:95f6f0d699a4

added default prefixes in the query text area in endpoint
author Babis Nikolaou <charnik@di.uoa.gr>
date Thu Oct 11 14:53:50 2012 +0200 (2012-10-11)
parents 3a946fc8f0f8
children 0f2fe2d2f251
files endpoint/WebContent/WEB-INF/beans.xml endpoint/WebContent/query.jsp endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java
line diff
     1.1 --- a/endpoint/WebContent/WEB-INF/beans.xml	Thu Oct 11 14:45:22 2012 +0300
     1.2 +++ b/endpoint/WebContent/WEB-INF/beans.xml	Thu Oct 11 14:53:50 2012 +0200
     1.3 @@ -59,6 +59,24 @@
     1.4              <value>1000</value>
     1.5          </constructor-arg>
     1.6          
     1.7 +        <constructor-arg type="java.lang.String" >
     1.8 +            <!-- Default prefixes -->
     1.9 +            <value><![CDATA[PREFIX lgd:<http://linkedgeodata.org/triplify/>
    1.10 +PREFIX lgdgeo:<http://www.w3.org/2003/01/geo/wgs84_pos#>
    1.11 +PREFIX lgdont:<http://linkedgeodata.org/ontology/>
    1.12 +PREFIX geonames:<http://www.geonames.org/ontology#>
    1.13 +PREFIX clc: <http://geo.linkedopendata.gr/corine/ontology#>
    1.14 +PREFIX gag: <http://teleios.di.uoa.gr/ontologies/gagKallikratis.rdf#>
    1.15 +PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
    1.16 +PREFIX dlr: <http://www.earthobservatory.eu/ontologies/dlrOntology-v2.owl#>
    1.17 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
    1.18 +PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    1.19 +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    1.20 +PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    1.21 +]]>
    1.22 +</value>
    1.23 +        </constructor-arg>
    1.24 +        
    1.25          <constructor-arg>
    1.26               <list>
    1.27               	<list>
     2.1 --- a/endpoint/WebContent/query.jsp	Thu Oct 11 14:45:22 2012 +0300
     2.2 +++ b/endpoint/WebContent/query.jsp	Thu Oct 11 14:53:50 2012 +0200
     2.3 @@ -64,8 +64,15 @@
     2.4  	});
     2.5  </script>
     2.6  	<%
     2.7 +	// get the reference to StrabonBeanWrapper
     2.8 +	StrabonBeanWrapper strabonWrapper;
     2.9 +	ServletContext context;
    2.10 +	context = getServletContext();
    2.11 +	WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(context);
    2.12 +	strabonWrapper=(StrabonBeanWrapper) applicationContext.getBean("strabonBean");
    2.13 +	
    2.14  	// get query parameter or attribute (the attribute comes from ConnectionBean)
    2.15 -	String query = "";
    2.16 +	String query = strabonWrapper.getPrefixes();
    2.17  	if (request.getParameter("query") != null) {
    2.18  		query = request.getParameter("query");
    2.19  		
    2.20 @@ -206,11 +213,6 @@
    2.21  		<div class="container">
    2.22  		<div id="accordion">
    2.23  		<%
    2.24 -					StrabonBeanWrapper strabonWrapper;
    2.25 -							ServletContext context;
    2.26 -							context = getServletContext();
    2.27 -							WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(context);
    2.28 -							strabonWrapper=(StrabonBeanWrapper) applicationContext.getBean("strabonBean");
    2.29  							
    2.30  							Iterator <StrabonBeanWrapperConfiguration> entryListIterator = strabonWrapper.getEntries().iterator();
    2.31  							boolean first = true;
     3.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java	Thu Oct 11 14:45:22 2012 +0300
     3.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java	Thu Oct 11 14:53:50 2012 +0200
     3.3 @@ -47,6 +47,7 @@
     3.4  	private String password;
     3.5  	private String dbBackend;
     3.6  	private int maxLimit;
     3.7 +	private String prefixes;
     3.8  	
     3.9  	private Strabon strabon = null;
    3.10  	
    3.11 @@ -54,7 +55,8 @@
    3.12  	private List<StrabonBeanWrapperConfiguration> entries;
    3.13  
    3.14  	public StrabonBeanWrapper(String databaseName, String user, String password, 
    3.15 -			int port, String serverName, boolean checkForLockTable, String dbBackend, int maxLimit, List<List<String>> args) {
    3.16 +			int port, String serverName, boolean checkForLockTable, String dbBackend, 
    3.17 +			int maxLimit, String prefixes, 	List<List<String>> args) {
    3.18  		this.serverName = serverName;
    3.19  		this.port = port;
    3.20  		this.databaseName = databaseName;
    3.21 @@ -63,6 +65,7 @@
    3.22  		this.checkForLockTable = checkForLockTable;
    3.23  		this.dbBackend = dbBackend;
    3.24  		this.maxLimit = maxLimit;
    3.25 +		this.prefixes = prefixes;
    3.26  		this.entries = new ArrayList<StrabonBeanWrapperConfiguration>(args.size());
    3.27  		
    3.28  		Iterator<List<String>> entryit = args.iterator();
    3.29 @@ -375,6 +378,10 @@
    3.30  		}
    3.31  		return limitedQuery;
    3.32  	}
    3.33 +	
    3.34 +	public String getPrefixes() {
    3.35 +		return prefixes;
    3.36 +	}
    3.37  
    3.38  }
    3.39