Strabon

changeset 150:4b3b6ea7513f

Modified how StrabonWrapper is being initialized (see new beans.xml).
author Kostis Kyzirakos <kkyzir@di.uoa.gr>
date Sun May 13 13:45:11 2012 +0200 (2012-05-13)
parents dcc954610d83
children 362c84669d89
files endpoint/WebContent/WEB-INF/beans.xml endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java
line diff
     1.1 --- a/endpoint/WebContent/WEB-INF/beans.xml	Thu May 10 18:39:47 2012 +0300
     1.2 +++ b/endpoint/WebContent/WEB-INF/beans.xml	Sun May 13 13:45:11 2012 +0200
     1.3 @@ -1,41 +1,63 @@
     1.4  <?xml version="1.0" encoding="UTF-8"?>
     1.5 -<beans xmlns="http://www.springframework.org/schema/beans"
     1.6 -	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
     1.7 -	xsi:schemaLocation="http://www.springframework.org/schema/beans 
     1.8 +<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     1.9 +    xmlns:jaxws="http://cxf.apache.org/jaxws"
    1.10 +    xmlns="http://www.springframework.org/schema/beans"
    1.11 +    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    1.12  						http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
    1.13 -						http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
    1.14 -	<import resource="classpath:META-INF/cxf/cxf.xml" />
    1.15 -	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    1.16 -	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    1.17 +						http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd" >
    1.18  
    1.19 -	<bean id="strabonBean" class="eu.earthobservatory.org.StrabonEndpoint.StrabonBeanWrapper" destroy-method="destroy">
    1.20 -		<constructor-arg type="java.lang.String">
    1.21 -			<!-- Database name -->
    1.22 -			<value>endpoint</value>
    1.23 -		</constructor-arg>
    1.24 -		<constructor-arg type="java.lang.String">
    1.25 -			<!-- Username -->
    1.26 -			<value>kkyzir</value>
    1.27 -		</constructor-arg>
    1.28 -		<constructor-arg type="java.lang.String">
    1.29 -			<!-- Password -->
    1.30 -			<value>postgresql</value>
    1.31 -		</constructor-arg>
    1.32 -		<constructor-arg type="int">
    1.33 -			<!-- Port -->
    1.34 -			<value>5432</value>
    1.35 -		</constructor-arg>
    1.36 -		<constructor-arg type="java.lang.String">
    1.37 -			<!-- Database server -->
    1.38 -			<value>localhost</value>
    1.39 -		</constructor-arg>
    1.40 -		<constructor-arg type="boolean">
    1.41 -			<!-- Check for locks and remove them (in case of a crash) -->
    1.42 -			<value>true</value>
    1.43 -		</constructor-arg>
    1.44 -		<constructor-arg type="java.lang.String">
    1.45 -			<!-- Query1 -->
    1.46 -			<value><![CDATA[# Discovering raw data and products
    1.47 +    <import resource="classpath:META-INF/cxf/cxf.xml" />
    1.48 +
    1.49 +    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    1.50 +
    1.51 +    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    1.52 +
    1.53 +    <bean
    1.54 +        id="strabonBean"
    1.55 +        class="eu.earthobservatory.org.StrabonEndpoint.StrabonBeanWrapper"
    1.56 +        destroy-method="destroy" >
    1.57 +
    1.58 +        <constructor-arg type="java.lang.String" >
    1.59 +            <!-- Database name -->
    1.60 +            <value>endpoint</value>
    1.61 +        </constructor-arg>
    1.62 +
    1.63 +        <constructor-arg type="java.lang.String" >
    1.64 +            <!-- Username -->
    1.65 +            <value>kkyzir</value>
    1.66 +        </constructor-arg>
    1.67 +
    1.68 +        <constructor-arg type="java.lang.String" >
    1.69 +            <!-- Password -->
    1.70 +            <value>postgresql</value>
    1.71 +        </constructor-arg>
    1.72 +
    1.73 +        <constructor-arg type="int" >
    1.74 +            <!-- Port -->
    1.75 +            <value>5432</value>
    1.76 +        </constructor-arg>
    1.77 +
    1.78 +        <constructor-arg type="java.lang.String" >
    1.79 +            <!-- Database server -->
    1.80 +            <value>localhost</value>
    1.81 +        </constructor-arg>
    1.82 +
    1.83 +        <constructor-arg type="boolean" >
    1.84 +            <!-- Check for locks and remove them (in case of a crash) -->
    1.85 +            <value>true</value>
    1.86 +        </constructor-arg>
    1.87 +
    1.88 +         <constructor-arg>
    1.89 +             <list>
    1.90 +	             <list>
    1.91 +	                 <!-- Bean -->
    1.92 +	                <value>Query</value> 
    1.93 +	                <!-- Format -->
    1.94 +	                <value>HTML</value>   
    1.95 +	                <!-- Label -->
    1.96 +	                <value>Query 1: Discover raw data and products</value> 
    1.97 +	                <!-- Statement -->
    1.98 +	                <value><![CDATA[# Discovering raw data and products
    1.99  PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   1.100  PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   1.101  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   1.102 @@ -50,21 +72,26 @@
   1.103  PREFIX gn: <http://www.geonames.org/ontology#>
   1.104  
   1.105  SELECT ?filename
   1.106 -WHERE {
   1.107 -?file rdf:type noa:ShpFile .
   1.108 -	 ?file noa:hasFilename ?filename .
   1.109 -	 ?file noa:hasAcquisitionTime ?sensingTime .
   1.110 +WHERE {?file rdf:type noa:ShpFile ;
   1.111 +	         noa:hasFilename ?filename ;
   1.112 +	         noa:hasAcquisitionTime ?sensingTime .
   1.113  	 FILTER( str(?sensingTime) >= "2007-08-26T12:00:00" ) .
   1.114  	 FILTER( str(?sensingTime) <= "2007-08-26T12:30:00" ) .
   1.115  	 ?file noa:isDerivedFromSensor ?sensor .
   1.116  	 FILTER( str(?sensor) = "MSG2" ) .
   1.117  	 ?file noa:producedFromProcessingChain ?chain .
   1.118 -	 FILTER( str(?chain) = "StaticThresholds" ) . }
   1.119 -]]></value>
   1.120 -		</constructor-arg>
   1.121 -		<constructor-arg type="java.lang.String">
   1.122 -			<!-- Query2 -->
   1.123 -			<value><![CDATA[# Get all hotspots 
   1.124 +	 FILTER( str(?chain) = "StaticThresholds" ) . 
   1.125 +}]]></value>
   1.126 +	            </list>
   1.127 +	            <list>
   1.128 +	                <!-- Bean -->
   1.129 +	                <value>Query</value> 
   1.130 +	                <!-- Format -->
   1.131 +	                <value>KMZMAP</value>
   1.132 +	                <!-- Label -->
   1.133 +	                <value>Query 2: Discover Hotspots</value> 
   1.134 +	                <!-- Statement -->
   1.135 +	                <value><![CDATA[# Get all hotspots 
   1.136  # - in Pelloponesus 
   1.137  # - at 2007-08-24
   1.138  PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   1.139 @@ -94,10 +121,16 @@
   1.140  	FILTER(?hAcqTime = "2007-08-24T14:45:00"^^xsd:dateTime) .
   1.141  	FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)) . 
   1.142  }]]></value>
   1.143 -		</constructor-arg>
   1.144 -		<constructor-arg type="java.lang.String">
   1.145 -			<!-- Query3 -->
   1.146 -			<value><![CDATA[# Delete hotspots that lie in sea
   1.147 +	            </list>
   1.148 +				<list>
   1.149 +	                <!-- Bean -->
   1.150 +	                 <value>Update</value>
   1.151 +	                <!-- Format -->
   1.152 +	                <value>HTML</value>
   1.153 +	                <!-- Label -->
   1.154 +	                <value>Update A: Remove hotspots in sea</value> 
   1.155 +	                <!-- Statement -->
   1.156 +	                <value><![CDATA[# Delete hotspots that lie in sea
   1.157  PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   1.158  PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   1.159  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   1.160 @@ -111,27 +144,32 @@
   1.161  PREFIX lgdo: <http://linkedgeodata.org/ontology/>
   1.162  PREFIX gn: <http://www.geonames.org/ontology#>
   1.163  DELETE {?h ?property ?object}
   1.164 -WHERE {
   1.165 -	?h 	rdf:type noa:Hotspot;
   1.166 -		noa:hasAcquisitionTime ?hAcqTime;
   1.167 -		noa:producedFromProcessingChain ?hChain;
   1.168 -		noa:hasGeometry ?hGeo;
   1.169 -		?property ?object.
   1.170 -		FILTER(str(?hChain) = "StaticThresholds").
   1.171 -		FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)).
   1.172 -		FILTER("2007-08-24T14:45:00"^^xsd:dateTime = ?hAcqTime).
   1.173 -		OPTIONAL {
   1.174 -			?c rdf:type noa:Coastline;
   1.175 -			noa:hasGeometry ?cGeo.
   1.176 -			FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?cGeo)).
   1.177 -			FILTER(strdf:anyInteract(?hGeo, ?cGeo)) . 
   1.178 -		}
   1.179 -		FILTER(!bound(?c)).
   1.180 - }]]></value>
   1.181 -		</constructor-arg>
   1.182 -		<constructor-arg type="java.lang.String">
   1.183 -			<!-- Query4 -->
   1.184 -			<value><![CDATA[# Refine the geometry of hotspots that partially lie in sea
   1.185 +WHERE { ?h 	rdf:type noa:Hotspot;
   1.186 +            noa:hasAcquisitionTime ?hAcqTime;
   1.187 +            noa:producedFromProcessingChain ?hChain;
   1.188 +            noa:hasGeometry ?hGeo;
   1.189 +            ?property ?object.
   1.190 +        FILTER(str(?hChain) = "StaticThresholds").
   1.191 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)).
   1.192 +        FILTER("2007-08-24T14:45:00"^^xsd:dateTime = ?hAcqTime).
   1.193 +        OPTIONAL {
   1.194 +            ?c rdf:type noa:Coastline;
   1.195 +               noa:hasGeometry ?cGeo.
   1.196 +            FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?cGeo)).
   1.197 +            FILTER(strdf:anyInteract(?hGeo, ?cGeo)) . 
   1.198 +        }
   1.199 +        FILTER(!bound(?c)). 
   1.200 +}]]></value>
   1.201 +	            </list>
   1.202 +	            <list>
   1.203 +	                <!-- Bean -->
   1.204 +	                <value>Update</value> 
   1.205 +	                <!-- Format -->
   1.206 +	                <value>HTML</value>
   1.207 +	                <!-- Label -->
   1.208 +	                <value>Update B: Refine hotspots in sea</value>
   1.209 +	                <!-- Statement -->
   1.210 +	                <value><![CDATA[# Refine the geometry of hotspots that partially lie in sea
   1.211  PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   1.212  PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   1.213  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   1.214 @@ -149,25 +187,30 @@
   1.215  INSERT { ?h noa:hasGeometry ?dif}
   1.216  WHERE {
   1.217  SELECT DISTINCT ?h ?hGeo (strdf:intersection(?hGeo, strdf:union(?cGeo)) AS ?dif)
   1.218 -WHERE {
   1.219 -	?h 	rdf:type noa:Hotspot;
   1.220 -		noa:hasAcquisitionTime ?hAcqTime;
   1.221 -		noa:producedFromProcessingChain ?hChain;
   1.222 -		noa:hasGeometry ?hGeo.
   1.223 -		FILTER("2007-08-24T14:45:00"^^xsd:dateTime = ?hAcqTime).
   1.224 -		FILTER(str(?hChain) = "StaticThresholds").
   1.225 -		FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)).
   1.226 -		?c rdf:type noa:Coastline ;
   1.227 -		noa:hasGeometry ?cGeo .
   1.228 -		FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?cGeo)).
   1.229 -		FILTER(strdf:anyInteract(?hGeo, ?cGeo)).}
   1.230 -		GROUP BY ?h ?hGeo
   1.231 -		HAVING strdf:overlap(?hGeo, strdf:union(?cGeo)) 
   1.232 +WHERE { ?h rdf:type noa:Hotspot;
   1.233 +           noa:hasAcquisitionTime ?hAcqTime;
   1.234 +           noa:producedFromProcessingChain ?hChain;
   1.235 +           noa:hasGeometry ?hGeo.
   1.236 +        FILTER("2007-08-24T14:45:00"^^xsd:dateTime = ?hAcqTime).
   1.237 +        FILTER(str(?hChain) = "StaticThresholds").
   1.238 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)).
   1.239 +        ?c rdf:type noa:Coastline ;
   1.240 +           noa:hasGeometry ?cGeo .
   1.241 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?cGeo)).
   1.242 +        FILTER(strdf:anyInteract(?hGeo, ?cGeo)).}
   1.243 +        GROUP BY ?h ?hGeo
   1.244 +        HAVING strdf:overlap(?hGeo, strdf:union(?cGeo)) 
   1.245  }]]></value>
   1.246 -		</constructor-arg>
   1.247 -		<constructor-arg type="java.lang.String">
   1.248 -			<!-- Query5 -->
   1.249 -			<value><![CDATA[#Get all coniferous forests in Peloponnese
   1.250 +	            </list>
   1.251 +	            <list>
   1.252 +	                <!-- Bean -->
   1.253 +	                <value>Query</value> 
   1.254 +	                <!-- Format -->
   1.255 +	                <value>KMZMAP</value>
   1.256 +	                <!-- Label -->
   1.257 +	                <value>Query 3: Discover coniferous forests</value> 
   1.258 +	                <!-- Statement -->
   1.259 +	                <value><![CDATA[#Get all coniferous forests in Peloponnese
   1.260  PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   1.261  PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   1.262  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   1.263 @@ -182,17 +225,23 @@
   1.264  PREFIX gn: <http://www.geonames.org/ontology#>
   1.265  
   1.266  SELECT ?a ?aGeo
   1.267 -WHERE{?a rdf:type clc:Area;
   1.268 -clc:hasLandUse ?aLandUse;
   1.269 -noa:hasGeometry ?aGeo.
   1.270 -?aLandUse rdf:type ?aLandUseType.
   1.271 -FILTER(?aLandUseType = clc:ConiferousForest).
   1.272 -FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^strdf:WKT,?aGeo)). 
   1.273 +WHERE{ ?a rdf:type clc:Area;
   1.274 +          clc:hasLandUse ?aLandUse;
   1.275 +          noa:hasGeometry ?aGeo.
   1.276 +       ?aLandUse rdf:type ?aLandUseType.
   1.277 +       FILTER(?aLandUseType = clc:ConiferousForest).
   1.278 +       FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^strdf:WKT,?aGeo)). 
   1.279  }]]></value>
   1.280 -		</constructor-arg>
   1.281 -		<constructor-arg type="java.lang.String">
   1.282 -			<!-- Query6 -->
   1.283 -            <value><![CDATA[# Get all municipalities of Pelloponnese
   1.284 +	            </list>
   1.285 +	            <list>
   1.286 +	                <!-- Bean -->
   1.287 +	                <value>Query</value> 
   1.288 +	                <!-- Format -->
   1.289 +	                <value>KMZMAP</value>
   1.290 +	                <!-- Label -->
   1.291 +	                <value>Query 4: Discover primary roads</value> 
   1.292 +	                <!-- Statement -->
   1.293 +	                <value><![CDATA[# Get all municipalities of Pelloponnese
   1.294  PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   1.295  PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   1.296  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   1.297 @@ -206,17 +255,22 @@
   1.298  PREFIX lgdo: <http://linkedgeodata.org/lontology/>
   1.299  PREFIX gn: <http://www.geonames.org/ontology#>
   1.300  
   1.301 -SELECT ?d ?dGeo
   1.302 -WHERE { 
   1.303 -	?d a gag:Dhmos; 
   1.304 -		strdf:hasGeometry ?dGeo; 
   1.305 -		rdfs:label ?dLabel. 
   1.306 -FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?dGeo)).
   1.307 +SELECT  ?d ?dGeo
   1.308 +WHERE { ?d rdf:type gag:Dhmos; 
   1.309 +           strdf:hasGeometry ?dGeo; 
   1.310 +           rdfs:label ?dLabel. 
   1.311 +           FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?dGeo)). 
   1.312  }]]></value>
   1.313 -		</constructor-arg>
   1.314 -		<constructor-arg type="java.lang.String">
   1.315 -			<!-- Query7 -->
   1.316 -            <value><![CDATA[# Get all primary roads in Pelloponnese
   1.317 +	            </list>
   1.318 +	            <list>
   1.319 +	                <!-- Bean -->
   1.320 +	                <value>Query</value> 
   1.321 +	                <!-- Format -->
   1.322 +	                <value>KMZMAP</value>
   1.323 +	                <!-- Label -->
   1.324 +	                <value>Query 5: Get all primary roads in Pelloponnese</value> 
   1.325 +	                <!-- Statement -->
   1.326 +	                <value><![CDATA[# Get all primary roads in Pelloponnese
   1.327  PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   1.328  PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   1.329  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   1.330 @@ -230,18 +284,22 @@
   1.331  PREFIX lgdo: <http://linkedgeodata.org/ontology/>
   1.332  PREFIX gn: <http://www.geonames.org/ontology#>
   1.333  
   1.334 -SELECT ?r ?rGeo
   1.335 -WHERE {
   1.336 -?r rdf:type ?rType ;
   1.337 -   noa:hasGeometry ?rGeo .
   1.338 -FILTER(?rType = lgdo:Primary) .
   1.339 -FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05,21.027 38.36))"^^strdf:WKT, ?rGeo) ).
   1.340 -}
   1.341 -]]></value>
   1.342 -		</constructor-arg>
   1.343 -		<constructor-arg type="java.lang.String">
   1.344 -			<!-- Query8 -->
   1.345 -            <value><![CDATA[# Get all hotspots 
   1.346 +SELECT  ?r ?rGeo
   1.347 +WHERE { ?r rdf:type ?rType ;
   1.348 +           noa:hasGeometry ?rGeo .
   1.349 +        FILTER(?rType = lgdo:Primary) .
   1.350 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05,21.027 38.36))"^^strdf:WKT, ?rGeo) ). 
   1.351 +}]]></value>
   1.352 +	            </list>
   1.353 +	            <list>
   1.354 +	                <!-- Bean -->
   1.355 +	                <value>Query</value> 
   1.356 +	                <!-- Format -->
   1.357 +	                <value>KMZMAP</value>
   1.358 +	                <!-- Label -->
   1.359 +	                <value>Query 6: Discover hotspots</value> 
   1.360 +	                <!-- Statement -->
   1.361 +	                <value><![CDATA[# Get all hotspots 
   1.362  # - in Pelloponesus 
   1.363  # - at 2007-08-24
   1.364  PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   1.365 @@ -257,29 +315,34 @@
   1.366  PREFIX lgdo: <http://linkedgeodata.org/ontology/>
   1.367  PREFIX gn: <http://www.geonames.org/ontology#>
   1.368  
   1.369 -SELECT ?h ?hAcqTime ?hConfidence ?hConfirmation ?hProvider ?hSensor ?hSatellite (strdf:transform(?hGeo, <http://www.opengis.net/def/crs/EPSG/0/4326>) as ?geo) 
   1.370 +SELECT  ?h ?hAcqTime (strdf:transform(?hGeo, <http://www.opengis.net/def/crs/EPSG/0/4326>) as ?geo) 
   1.371  WHERE { ?h 	rdf:type noa:Hotspot;
   1.372 -			noa:hasGeometry ?hGeo;
   1.373 -			noa:hasAcquisitionTime ?hAcqTime;
   1.374 -			noa:hasConfidence ?hConfidence;
   1.375 -			noa:isProducedBy ?hProvider;
   1.376 -			noa:hasConfirmation ?hConfirmation;
   1.377 -			noa:isDerivedFromSensor ?hSensor;
   1.378 -			noa:isDerivedFromSatellite ?hSatellite ;
   1.379 -			noa:producedFromProcessingChain ?hChain .
   1.380 -	FILTER(str(?hChain) = "StaticThresholds").
   1.381 -	FILTER(?hAcqTime = "2007-08-24T14:45:00"^^xsd:dateTime) .
   1.382 -	FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)) . 
   1.383 +            noa:hasGeometry ?hGeo;
   1.384 +            noa:hasAcquisitionTime ?hAcqTime;
   1.385 +            noa:producedFromProcessingChain ?hChain .
   1.386 +        FILTER(str(?hChain) = "StaticThresholds").
   1.387 +        FILTER(?hAcqTime = "2007-08-24T14:45:00"^^xsd:dateTime) .
   1.388 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)) . 
   1.389 +        ?a rdf:type clc:Area;
   1.390 +           clc:hasLandUse ?aLandUse;
   1.391 +           noa:hasGeometry ?aGeo.
   1.392 +        ?aLandUse rdf:type ?aLandUseType.
   1.393 +        FILTER(?aLandUseType = clc:Forest).
   1.394 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^strdf:WKT,?aGeo)). 
   1.395 +        FILTER(strdf:overlap(?aGeo, ?hGeo)) . 
   1.396  }]]></value>
   1.397 -		</constructor-arg>
   1.398 -                <constructor-arg type="java.lang.String">
   1.399 -                        <!-- Default format -->
   1.400 -                        <value><![CDATA[format=KMZMAP]]></value>
   1.401 -                </constructor-arg>
   1.402 -	</bean>
   1.403 -
   1.404 -<!-- 	<bean id="queryBean" class="eu.earthobservatory.org.StrabonEndpoint.QueryBean"> -->
   1.405 -<!-- 		<property name="strabon" ref="strabonBean" /> -->
   1.406 -<!-- 	</bean> -->
   1.407 -
   1.408 -</beans>
   1.409 +	            </list>
   1.410 +<!-- 	            <list> -->
   1.411 +<!-- 	                Bean -->
   1.412 +<!-- 	                <value>Query</value>  -->
   1.413 +<!-- 	                Format -->
   1.414 +<!-- 	                <value>KMZMAP</value> -->
   1.415 +<!-- 	                Label -->
   1.416 +<!-- 	                <value></value>  -->
   1.417 +<!-- 	                Statement -->
   1.418 +<!-- 	                <value></value> -->
   1.419 +<!-- 	            </list> -->
   1.420 +            </list>
   1.421 +         </constructor-arg>
   1.422 +    </bean>
   1.423 +</beans>
   1.424 \ No newline at end of file
     2.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Thu May 10 18:39:47 2012 +0300
     2.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Sun May 13 13:45:11 2012 +0200
     2.3 @@ -12,7 +12,11 @@
     2.4  import java.net.URLEncoder;
     2.5  import java.security.SecureRandom;
     2.6  import java.util.Date;
     2.7 +import java.util.HashMap;
     2.8 +import java.util.Hashtable;
     2.9  import java.util.Iterator;
    2.10 +import java.util.List;
    2.11 +import java.util.Map;
    2.12  import java.util.zip.ZipEntry;
    2.13  import java.util.zip.ZipOutputStream;
    2.14  
    2.15 @@ -31,6 +35,8 @@
    2.16  import org.springframework.web.context.WebApplicationContext;
    2.17  import org.springframework.web.context.support.WebApplicationContextUtils;
    2.18  
    2.19 +import eu.earthobservatory.org.StrabonEndpoint.StrabonBeanWrapper.Entry;
    2.20 +
    2.21  
    2.22  public class QueryBean extends HttpServlet {
    2.23  
    2.24 @@ -231,7 +237,7 @@
    2.25  			if (hive.getSPARQLQuery() != null)
    2.26  				out.write(hive.getSPARQLQuery());
    2.27  
    2.28 -			appendHTML2(out);
    2.29 +			appendHTML2(out, hive.getFormat());
    2.30  
    2.31  			out.append("</table></td></tr></table>");
    2.32  
    2.33 @@ -313,7 +319,7 @@
    2.34  			if (hive.getSPARQLQuery() != null)
    2.35  				out.write(hive.getSPARQLQuery());
    2.36  
    2.37 -			appendHTML2(out);
    2.38 +			appendHTML2(out, hive.getFormat());
    2.39  
    2.40  			out.append("</table></td></tr></table>");
    2.41  
    2.42 @@ -381,7 +387,7 @@
    2.43  			if (hive.getSPARQLQuery() != null)
    2.44  				out.write(hive.getSPARQLQuery());
    2.45  
    2.46 -			appendHTML2(out);
    2.47 +			appendHTML2(out, hive.getFormat());
    2.48  
    2.49  			String answer = "";
    2.50  			if (hive.getSPARQLQuery() != null) {
    2.51 @@ -540,17 +546,34 @@
    2.52  		out.println("<td style=\"border: 1px dashed #bbbbbb;\"><textarea name=\"SPARQLQuery\" rows=\"15\" cols=\"100\">");
    2.53  	}
    2.54  
    2.55 -	protected static void appendHTML2(PrintWriter out) {
    2.56 +	protected static void appendHTML2(PrintWriter out, String format) {
    2.57  		out.println("</textarea></td>");
    2.58  		//		out.println("<td style=\"border: 1px dashed #bbbbbb;\"><input type=\"radio\" name=\"format\" value=\"KML\">KML<br/>");
    2.59  		//		out.println("<input type=\"radio\" name=\"format\" value=\"HTML\">HTML</td>");
    2.60  		out.println("<td style=\"border: 1px dashed #bbbbbb;\"><center>Output Format:<br/><select name=\"format\">");
    2.61 -		out.println("	<option value=\"KMZMAP\">HTML with google maps (kmz)</option>");
    2.62 -		out.println("	<option value=\"KMLMAP\">HTML with google maps (kml)</option>");
    2.63 -		out.println("	<option value=\"HTML\">HTML</option>");
    2.64 -		out.println("	<option value=\"KML\">KML</option>");
    2.65 -		out.println("	<option value=\"XML\">XML</option>");
    2.66 -		out.println("	<option value=\"GEOJSON\">GeoJSON</option>");
    2.67 +		
    2.68 +		Map<String, String> selections = new HashMap<String, String>();
    2.69 +		selections.put("KMZMAP", "HTML with google maps (kmz)");
    2.70 +		selections.put("KMLMAP", "HTML with google maps (kml)");
    2.71 +		selections.put("HTML", "HTML");
    2.72 +		//selections.put("KMZ", "KZM file");
    2.73 +		selections.put("KML", "KML file");
    2.74 +		selections.put("XML", "XML");
    2.75 +		selections.put("GEOJSON", "GeoJSON");
    2.76 +		
    2.77 +		Iterator <String> it = selections.keySet().iterator();
    2.78 +		
    2.79 +		while (it.hasNext()) {
    2.80 +			String key = it.next();
    2.81 +			String value = selections.get(key);
    2.82 +			out.print("<option ");
    2.83 +			if (key.equalsIgnoreCase(format))
    2.84 +				out.print("selected");
    2.85 +			
    2.86 +			out.println(" value=\"" + key + "\">" + value + "</option>");
    2.87 +		}
    2.88 +		
    2.89 +		
    2.90  		out.println("</select></center></td>");
    2.91  		out.println("</tr>");
    2.92  		out.println("<tr>");
    2.93 @@ -579,14 +602,27 @@
    2.94  
    2.95  	protected static void appendHTMLQ(PrintWriter out, StrabonBeanWrapper strabonWrapper) throws UnsupportedEncodingException {
    2.96  		out.println("<tr><td width=\"90\">");
    2.97 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery1(), "UTF-8")+ "&" + strabonWrapper.getFormat() + "\">&nbsp;&middot;&nbsp;Query 1</a></br> ");		
    2.98 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery2(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 2</a></br> ");
    2.99 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery3(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 3</a></br> ");
   2.100 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery4(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 4</a></br> ");
   2.101 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery5(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 5</a></br> ");
   2.102 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery6(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 6</a></br> ");
   2.103 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery7(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 7</a></br>");
   2.104 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery8(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 8</a> ");
   2.105 +		List<Entry> entries = strabonWrapper.getEntries();
   2.106 +		Iterator<Entry> it = entries.iterator();
   2.107 +		while (it.hasNext()) {
   2.108 +			Entry entry = it.next();
   2.109 +			out.println(createLink(entry));
   2.110 +		}
   2.111  		out.println("</td></tr> ");
   2.112  	}
   2.113 +	
   2.114 +	private static String createLink(Entry entry) throws UnsupportedEncodingException {
   2.115 +		StringBuffer buf = new StringBuffer(1024);
   2.116 +		buf.append("<a href=\"");
   2.117 +		buf.append(entry.getBean());
   2.118 +		buf.append("?SPARQLQuery=");
   2.119 +		buf.append(URLEncoder.encode(entry.getStatement(), "UTF-8"));
   2.120 +		buf.append("&format=");
   2.121 +		buf.append(entry.getFormat());
   2.122 +		buf.append("\">&nbsp;&middot;&nbsp;");
   2.123 +		buf.append(entry.getLabel());
   2.124 +		buf.append("</a><br/>");
   2.125 +		
   2.126 +		return buf.toString();
   2.127 +	}
   2.128  }
     3.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java	Thu May 10 18:39:47 2012 +0300
     3.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java	Sun May 13 13:45:11 2012 +0200
     3.3 @@ -3,8 +3,13 @@
     3.4  import java.io.IOException;
     3.5  import java.io.StringReader;
     3.6  import java.net.URL;
     3.7 +import java.sql.Array;
     3.8  import java.sql.SQLException;
     3.9 +import java.util.ArrayList;
    3.10 +import java.util.Iterator;
    3.11 +import java.util.List;
    3.12  
    3.13 +import org.hsqldb.lib.Collection;
    3.14  import org.openrdf.model.Resource;
    3.15  import org.openrdf.query.MalformedQueryException;
    3.16  import org.openrdf.query.QueryEvaluationException;
    3.17 @@ -16,73 +21,150 @@
    3.18  import eu.earthobservatory.runtime.postgis.Strabon;
    3.19  
    3.20  public class StrabonBeanWrapper implements org.springframework.beans.factory.DisposableBean {
    3.21 +	public class Entry {
    3.22 +		private String label;
    3.23 +		private String bean;
    3.24 +		private String statement;
    3.25 +		private String format;
    3.26 +
    3.27 +		public Entry(String label, String bean, String statement, String format) {
    3.28 +			this.label = label;
    3.29 +			this.bean = bean;
    3.30 +			this.statement = statement;
    3.31 +			this.format = format;
    3.32 +		}
    3.33 +		public String getLabel() {
    3.34 +			return label;
    3.35 +		}
    3.36 +		public void setLabel(String label) {
    3.37 +			this.label = label;
    3.38 +		}
    3.39 +		public String getBean() {
    3.40 +			return bean;
    3.41 +		}
    3.42 +		public void setBean(String bean) {
    3.43 +			this.bean = bean;
    3.44 +		}
    3.45 +		public String getStatement() {
    3.46 +			return statement;
    3.47 +		}
    3.48 +		public void setStatement(String statement) {
    3.49 +			this.statement = statement;
    3.50 +		}
    3.51 +		public String getFormat() {
    3.52 +			return format;
    3.53 +		}
    3.54 +		public void setFormat(String format) {
    3.55 +			this.format = format;
    3.56 +		}
    3.57 +	}
    3.58 +
    3.59  	private String serverName;
    3.60  	private int port;
    3.61  	private String databaseName;
    3.62  	private String user;
    3.63  	private String password;
    3.64 -	
    3.65 +
    3.66  	private Strabon strabon = null;
    3.67  	private boolean checkForLockTable;
    3.68 -	private String query1;
    3.69 -	private String query2;
    3.70 -	private String query3;
    3.71 -	private String query4;
    3.72 -	private String query5;
    3.73 -	private String query6;
    3.74 -	private String query7;
    3.75 -	private String query8;
    3.76 -	private String format;
    3.77 -	
    3.78 +	private List<Entry> entries;
    3.79 +
    3.80  	public StrabonBeanWrapper() {
    3.81  		this.strabon = null;
    3.82  	}
    3.83 -	
    3.84 +
    3.85  	public StrabonBeanWrapper(Strabon strabon) {
    3.86  		this.strabon = strabon;
    3.87  	}
    3.88 -	
    3.89 -	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, String query1, String query2, String query3, String query4, String query5, String query6, String query7, String query8) {
    3.90 +
    3.91 +//	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, String query1, String query2, String query3, String query4, String query5, String query6, String query7, String query8) {
    3.92 +//		this.serverName = serverName;
    3.93 +//		this.port = port;
    3.94 +//		this.databaseName = databaseName;
    3.95 +//		this.user = user;
    3.96 +//		this.password = password;
    3.97 +//		this.checkForLockTable = checkForLockTable;
    3.98 +//		//this.strabon = new Strabon(databaseName, user, password, port, serverName, checkForLockTable);
    3.99 +//		this.query1 = query1;/
   3.100 +//		this.query2 = query2;
   3.101 +//		this.query3 = query3;
   3.102 +//		this.query4 = query4;
   3.103 +//		this.query5 = query5;
   3.104 +//		this.query6 = query6;
   3.105 +//		this.query7 = query7;
   3.106 +//		this.query8 = query8;
   3.107 +//		format = "format=HTML";
   3.108 +//		init();
   3.109 +//	}
   3.110 +//
   3.111 +//	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, String query1, String query2, String query3, String query4, String query5, String query6, String query7, String query8, String format) {
   3.112 +//		this.serverName = serverName;
   3.113 +//		this.port = port;
   3.114 +//		this.databaseName = databaseName;
   3.115 +//		this.user = user;
   3.116 +//		this.password = password;
   3.117 +//		this.checkForLockTable = checkForLockTable;
   3.118 +//		//this.strabon = new Strabon(databaseName, user, password, port, serverName, checkForLockTable);
   3.119 +//		this.query1 = query1;
   3.120 +//		this.query2 = query2;
   3.121 +//		this.query3 = query3;
   3.122 +//		this.query4 = query4;
   3.123 +//		this.query5 = query5;
   3.124 +//		this.query6 = query6;
   3.125 +//		this.query7 = query7;
   3.126 +//		this.query8 = query8;
   3.127 +//		this.format = format;
   3.128 +//
   3.129 +//		init();
   3.130 +//	}
   3.131 +
   3.132 +	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, List<List> args) {
   3.133  		this.serverName = serverName;
   3.134  		this.port = port;
   3.135  		this.databaseName = databaseName;
   3.136  		this.user = user;
   3.137  		this.password = password;
   3.138  		this.checkForLockTable = checkForLockTable;
   3.139 -		//this.strabon = new Strabon(databaseName, user, password, port, serverName, checkForLockTable);
   3.140 -		this.query1 = query1;
   3.141 -		this.query2 = query2;
   3.142 -		this.query3 = query3;
   3.143 -		this.query4 = query4;
   3.144 -		this.query5 = query5;
   3.145 -		this.query6 = query6;
   3.146 -		this.query7 = query7;
   3.147 -		this.query8 = query8;
   3.148 -		format = "format=HTML";
   3.149 +		this.entries = new ArrayList<StrabonBeanWrapper.Entry>(args.size());
   3.150 +		
   3.151 +		Iterator<List> entryit = args.iterator();
   3.152 +		
   3.153 +		while (entryit.hasNext()) {
   3.154 +			List list = entryit.next();
   3.155 +			Iterator<String> it = list.iterator();
   3.156 +			
   3.157 +			while (it.hasNext()) {
   3.158 +				int items = 0;
   3.159 +				String label = "", bean = "'", statement = "", format = ""; 
   3.160 +	
   3.161 +				if (it.hasNext()) {
   3.162 +					bean = it.next();
   3.163 +					items++;
   3.164 +				}
   3.165 +				if (it.hasNext()) {
   3.166 +					format = it.next();
   3.167 +					items++;
   3.168 +				}
   3.169 +				if (it.hasNext()) {
   3.170 +					label = it.next();
   3.171 +					items++;
   3.172 +				}
   3.173 +				if (it.hasNext()) {
   3.174 +					statement = it.next();
   3.175 +					items++;
   3.176 +				}
   3.177 +				
   3.178 +				
   3.179 +				if (items == 4) {
   3.180 +					Entry entry = new Entry(label, bean, statement, format);
   3.181 +					this.entries.add(entry);
   3.182 +				}
   3.183 +			}
   3.184 +		}
   3.185 +
   3.186  		init();
   3.187  	}
   3.188 -	
   3.189 -	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, String query1, String query2, String query3, String query4, String query5, String query6, String query7, String query8, String format) {
   3.190 -		this.serverName = serverName;
   3.191 -		this.port = port;
   3.192 -		this.databaseName = databaseName;
   3.193 -		this.user = user;
   3.194 -		this.password = password;
   3.195 -		this.checkForLockTable = checkForLockTable;
   3.196 -		//this.strabon = new Strabon(databaseName, user, password, port, serverName, checkForLockTable);
   3.197 -		this.query1 = query1;
   3.198 -		this.query2 = query2;
   3.199 -		this.query3 = query3;
   3.200 -		this.query4 = query4;
   3.201 -		this.query5 = query5;
   3.202 -		this.query6 = query6;
   3.203 -		this.query7 = query7;
   3.204 -		this.query8 = query8;
   3.205 -		this.format = format;
   3.206 -		
   3.207 -		init();
   3.208 -	}
   3.209 -	
   3.210 +
   3.211  	private boolean init() {
   3.212  		if (this.strabon == null) {
   3.213  			try {
   3.214 @@ -96,10 +178,10 @@
   3.215  				return false;
   3.216  			}
   3.217  		}
   3.218 -		
   3.219 +
   3.220  		return true;
   3.221  	}
   3.222 -	
   3.223 +
   3.224  	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName) throws SQLException, ClassNotFoundException {
   3.225  		this.strabon = new Strabon(databaseName, user, password, port, serverName, true);
   3.226  	}
   3.227 @@ -115,35 +197,35 @@
   3.228  	public void destroy() throws Exception {
   3.229  		strabon.close();
   3.230  	}
   3.231 -	
   3.232 -	
   3.233 -	
   3.234 +
   3.235 +
   3.236 +
   3.237  	public Object query(String queryString, String answerFormatStrabon) throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, ClassNotFoundException {
   3.238  		if ((this.strabon == null) && (!init())) {
   3.239  			throw new RepositoryException("Could not connect to Strabon.");
   3.240  		} 
   3.241 -		
   3.242 +
   3.243  		return strabon.query(queryString, answerFormatStrabon, strabon.getSailRepoConnection());
   3.244  	}
   3.245 -	
   3.246 +
   3.247  	public Object update(String updateString, String answerFormatStrabon) throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, ClassNotFoundException {
   3.248  		if ((this.strabon == null) && (!init())) {
   3.249  			throw new RepositoryException("Could not connect to Strabon.");
   3.250  		} 
   3.251 -		
   3.252 -    	//String newQueryString = TemporalWrapper.rebuildQuery(queryString);
   3.253 -    	
   3.254 -    	System.out.println("================================================================");
   3.255 -    	System.out.println("Update:");
   3.256 -    	System.out.println(updateString);
   3.257 -    	System.out.println("================================================================");
   3.258 -    	System.out.println("Answer format: " + answerFormatStrabon);
   3.259 -    	System.out.println("================================================================");
   3.260 -    	//System.out.println("Rewritten query:");
   3.261 -    	//System.out.println(newQueryString);
   3.262 -    	//System.out.println("================================================================");
   3.263 -		
   3.264 -   		//return strabon.query(newQueryString, answerFormatStrabon, strabon.getSailRepoConnection());
   3.265 +
   3.266 +		//String newQueryString = TemporalWrapper.rebuildQuery(queryString);
   3.267 +
   3.268 +		System.out.println("================================================================");
   3.269 +		System.out.println("Update:");
   3.270 +		System.out.println(updateString);
   3.271 +		System.out.println("================================================================");
   3.272 +		System.out.println("Answer format: " + answerFormatStrabon);
   3.273 +		System.out.println("================================================================");
   3.274 +		//System.out.println("Rewritten query:");
   3.275 +		//System.out.println(newQueryString);
   3.276 +		//System.out.println("================================================================");
   3.277 +
   3.278 +		//return strabon.query(newQueryString, answerFormatStrabon, strabon.getSailRepoConnection());
   3.279  		strabon.update(updateString, strabon.getSailRepoConnection());
   3.280  		return "OK!";
   3.281  	}
   3.282 @@ -169,26 +251,26 @@
   3.283  		if ((this.strabon == null) && (!init())) {
   3.284  			throw new RepositoryException("Could not connect to Strabon.");
   3.285  		}
   3.286 -		
   3.287 +
   3.288  		// get sail connection
   3.289  		SailRepositoryConnection conn = strabon.getSailRepoConnection();
   3.290 -		
   3.291 +
   3.292  		try {
   3.293  			// store data
   3.294  			if (url) {
   3.295  				conn.add(new URL(source_data), "", format, new Resource[1]);
   3.296 -				
   3.297 +
   3.298  			} else {
   3.299  				conn.add(new StringReader(source_data), "", format, new Resource[1]);
   3.300  			}
   3.301 -			
   3.302 +
   3.303  		} catch (Exception e) {
   3.304  			throw e;
   3.305  		}
   3.306 -		
   3.307 -    	return true;
   3.308 +
   3.309 +		return true;
   3.310  	}
   3.311 -	
   3.312 +
   3.313  	private String getDetails() {
   3.314  		String details = "-----------------------------------------\n";
   3.315  		details += "Connection details:\n";
   3.316 @@ -202,78 +284,90 @@
   3.317  		return details;
   3.318  	}
   3.319  
   3.320 -	public String getQuery1() {
   3.321 -		return query1;
   3.322 -	}
   3.323 -
   3.324 -	public void setQuery1(String query1) {
   3.325 -		this.query1 = query1;
   3.326 -	}
   3.327 -
   3.328 -	public String getQuery2() {
   3.329 -		return query2;
   3.330 -	}
   3.331 -
   3.332 -	public void setQuery2(String query2) {
   3.333 -		this.query2 = query2;
   3.334 -	}
   3.335 -
   3.336 -	public String getQuery3() {
   3.337 -		return query3;
   3.338 -	}
   3.339 -
   3.340 -	public void setQuery3(String query3) {
   3.341 -		this.query3 = query3;
   3.342 +//	public String getQuery1() {
   3.343 +//		return query1;
   3.344 +//	}
   3.345 +//
   3.346 +//	public void setQuery1(String query1) {
   3.347 +//		this.query1 = query1;
   3.348 +//	}
   3.349 +//
   3.350 +//	public String getQuery2() {
   3.351 +//		return query2;
   3.352 +//	}
   3.353 +//
   3.354 +//	public void setQuery2(String query2) {
   3.355 +//		this.query2 = query2;
   3.356 +//	}
   3.357 +//
   3.358 +//	public String getQuery3() {
   3.359 +//		return query3;
   3.360 +//	}
   3.361 +//
   3.362 +//	public void setQuery3(String query3) {
   3.363 +//		this.query3 = query3;
   3.364 +//	}
   3.365 +//
   3.366 +//	public String getQuery4() {
   3.367 +//		return query4;
   3.368 +//	}
   3.369 +//
   3.370 +//	public void setQuery4(String query4) {
   3.371 +//		this.query4 = query4;
   3.372 +//	}
   3.373 +//
   3.374 +//	public String getQuery5() {
   3.375 +//		return query5;
   3.376 +//	}
   3.377 +//
   3.378 +//	public void setQuery5(String query5) {
   3.379 +//		this.query5 = query5;
   3.380 +//	}
   3.381 +//
   3.382 +//	public String getQuery6() {
   3.383 +//		return query6;
   3.384 +//	}
   3.385 +//
   3.386 +//	public void setQuery6(String query6) {
   3.387 +//		this.query6 = query6;
   3.388 +//	}
   3.389 +//
   3.390 +//	public String getQuery7() {
   3.391 +//		return query7;
   3.392 +//	}
   3.393 +//
   3.394 +//	public void setQuery7(String query7) {
   3.395 +//		this.query7 = query7;
   3.396 +//	}
   3.397 +//	public String getQuery8() {
   3.398 +//		return query8;
   3.399 +//	}
   3.400 +//
   3.401 +//	public void setQuery8(String query8) {
   3.402 +//		this.query8 = query8;
   3.403 +//	}
   3.404 +//
   3.405 +//	public String getFormat() {
   3.406 +//		return format;
   3.407 +//	}
   3.408 +//
   3.409 +//	public void setFormat(String format) {
   3.410 +//		this.format = format;
   3.411 +//	}
   3.412 +	public List<Entry> getEntries() {
   3.413 +		return this.entries;
   3.414  	}
   3.415  	
   3.416 -	public String getQuery4() {
   3.417 -		return query4;
   3.418 -	}
   3.419 -
   3.420 -	public void setQuery4(String query4) {
   3.421 -		this.query4 = query4;
   3.422 -	}
   3.423 -
   3.424 -	public String getQuery5() {
   3.425 -		return query5;
   3.426 -	}
   3.427 -
   3.428 -	public void setQuery5(String query5) {
   3.429 -		this.query5 = query5;
   3.430 -	}
   3.431 -
   3.432 -	public String getQuery6() {
   3.433 -		return query6;
   3.434 -	}
   3.435 -
   3.436 -	public void setQuery6(String query6) {
   3.437 -		this.query6 = query6;
   3.438 -	}
   3.439 -
   3.440 -	public String getQuery7() {
   3.441 -		return query7;
   3.442 -	}
   3.443 -
   3.444 -	public void setQuery7(String query7) {
   3.445 -		this.query7 = query7;
   3.446 -	}
   3.447 -	public String getQuery8() {
   3.448 -		return query8;
   3.449 -	}
   3.450 -
   3.451 -	public void setQuery8(String query8) {
   3.452 -		this.query8 = query8;
   3.453 -	}
   3.454 -
   3.455 -	public String getFormat() {
   3.456 -		return format;
   3.457 -	}
   3.458 -
   3.459 -	public void setFormat(String format) {
   3.460 -		this.format = format;
   3.461 +	public void setEntries(List<Entry> entries) {
   3.462 +		this.entries = entries;
   3.463  	}
   3.464  	
   3.465 -	
   3.466 +	public Entry getEntry(int i) {
   3.467 +		if (i < 0 || i >= this.entries.size())
   3.468 +			return null;
   3.469 +		
   3.470 +		return this.entries.get(i);
   3.471 +	}
   3.472  	
   3.473  }
   3.474