Strabon

changeset 617:62e39ced8771

Modified the way that the query.jsp page creates the navigation bar.
Entries at the beans.xml file are divided in three groups:
* Header entries: entries that correspond to the headers of the naviation bar and contain only one value element with the name of the header
* Bean entries: entries that correspond to other beans and contain only two value elements for the label and the link.
* Generic entries: entries that correspond to a call of a bean
author Kostis Kyzirakos <kkyzir@di.uoa.gr>
date Wed Oct 03 17:44:50 2012 +0300 (2012-10-03)
parents 398331eac419
children 34e68fb2a595
files endpoint/WebContent/WEB-INF/beans.xml endpoint/WebContent/query.jsp endpoint/WebContent/style-menu.css endpoint/WebContent/teleios-header.html endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapperConfiguration.java
line diff
     1.1 --- a/endpoint/WebContent/WEB-INF/beans.xml	Sat Sep 29 09:37:21 2012 +0300
     1.2 +++ b/endpoint/WebContent/WEB-INF/beans.xml	Wed Oct 03 17:44:50 2012 +0300
     1.3 @@ -60,7 +60,7 @@
     1.4               		<!-- Single valued elements correspond to headers -->
     1.5  					<value>Dataset Presentation</value>
     1.6  	            </list>
     1.7 -	            	             <list>
     1.8 +				<list>
     1.9  	                 <!-- Bean -->
    1.10  	                <value>Query</value> 
    1.11  	                <!-- Format -->
    1.12 @@ -594,7 +594,7 @@
    1.13  	            </list>
    1.14  	            <list>
    1.15               		<!-- Single valued elements correspond to headers -->
    1.16 -					<value>Discover corellations between three datasets</value>
    1.17 +					<value>Second level of statistics</value>
    1.18  	            </list>
    1.19  	           	             <list>
    1.20  	                 <!-- Bean -->
    1.21 @@ -602,7 +602,7 @@
    1.22  	                <!-- Format -->
    1.23  	                <value>HTML</value>   
    1.24  	                <!-- Label -->
    1.25 -	                <value></value> 
    1.26 +	                <value>How many patches with a specific label are contained by a CLC area?</value> 
    1.27  	                <!-- Statement -->
    1.28  	                <value><![CDATA[PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    1.29  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    1.30 @@ -615,11 +615,43 @@
    1.31  PREFIX geonames: <http://www.geonames.org/ontology#>
    1.32  PREFIX teleios:<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
    1.33  PREFIX dlr: <http://www.earthobservatory.eu/ontologies/dlrOntology.owl#>
    1.34 +
    1.35 +SELECT ?clcLandUse ?annotation (COUNT(?p) AS ?numberOfPatches)
    1.36 +WHERE {
    1.37 +   #select corine areas
    1.38 +   ?clc a teleios:Area .
    1.39 +   ?clc teleios:hasCode ?clcCode .
    1.40 +   ?clc teleios:hasLandUse ?clcLandUse .
    1.41 +   ?clc teleios:hasGeometry ?clcGeo .
    1.42 +   #Venice
    1.43 +   FILTER (strdf:inside(?clcGeo, "POLYGON ((12.301451 45.40493,12.398127 45.416817,12.386066 45.46502,12.289288 45.45313,12.301451 45.40493))"^^strdf:WKT)) .
    1.44 +   #Toulouse
    1.45 +   #FILTER (strdf:inside(?clcGeo, "POLYGON((1.3816636 43.573734,1.4903361 43.588024,1.4783715 43.634777,1.3696271 43.620483,1.3816636 43.573734))"^^strdf:WKT)) .
    1.46 +   #Timisoara
    1.47 +   #FILTER (strdf:inside(?clcGeo, "POLYGON((21.188068 45.7305,21.286903 45.74229,21.275377 45.79014,21.176264 45.778324,21.188068 45.7305))"^^strdf:WKT)) .
    1.48 +
    1.49 +   #select patches
    1.50 +   ?p rdf:type dlr:Patch .        
    1.51 +   ?p dlr:hasGeometry ?g .
    1.52 +   ?p dlr:hasLabel ?l .
    1.53 +   ?l rdf:type dlr:Label .
    1.54 +   ?l dlr:correspondsTo ?annotation .
    1.55 +   #Venice
    1.56 +   FILTER (strdf:inside(?g, "POLYGON ((12.301451 45.40493,12.398127 45.416817,12.386066 45.46502,12.289288 45.45313,12.301451 45.40493))"^^strdf:WKT)) .
    1.57 +   #Toulouse
    1.58 +   #FILTER (strdf:inside(?g, "POLYGON((1.3816636 43.573734,1.4903361 43.588024,1.4783715 43.634777,1.3696271 43.620483,1.3816636 43.573734))"^^strdf:WKT)) .
    1.59 +   #Timisoara
    1.60 +   #FILTER (strdf:inside(?g, "POLYGON((21.188068 45.7305,21.286903 45.74229,21.275377 45.79014,21.176264 45.778324,21.188068 45.7305))"^^strdf:WKT)) .
    1.61 +   
    1.62 +   FILTER (geof:sf-contains(?clcGeo, ?g)) .
    1.63 +   
    1.64 +}
    1.65 +GROUP BY ?clcLandUse ?annotation
    1.66  	                ]]></value>
    1.67  	                <!-- Description -->
    1.68  					<value></value>
    1.69  					<!-- Hander (plain, download, map or map_local)-->
    1.70 -					<value></value>
    1.71 +					<value>plain</value>
    1.72  	            </list>
    1.73  	             <list>
    1.74  	                 <!-- Bean -->
    1.75 @@ -696,9 +728,17 @@
    1.76  					<!-- Hander (plain, download, map or map_local)-->
    1.77  					<value></value>
    1.78  	            </list>
    1.79 -	           
    1.80 -	        
    1.81 -	            
    1.82 +
    1.83 +
    1.84 +				<list>
    1.85 +             		<!-- Single valued elements correspond to headers -->
    1.86 +					<value>Explore/Modify operations</value>
    1.87 +	            </list>
    1.88 +	            <list>
    1.89 +             		<!-- Link to bean: two arguemnts -->
    1.90 +					<value>Store</value>
    1.91 +					<value>store.jsp</value>
    1.92 +	            </list>
    1.93  	            <list>
    1.94               		<!-- Link to bean: two arguemnts -->
    1.95  					<value>Update</value>
    1.96 @@ -706,13 +746,18 @@
    1.97  	            </list>
    1.98  	            <list>
    1.99               		<!-- Link to bean: two arguemnts -->
   1.100 +					<value>Query</value>
   1.101 +					<value>query.jsp</value>
   1.102 +	            </list>
   1.103 +	            <list>
   1.104 +             		<!-- Link to bean: two arguemnts -->
   1.105  					<value>Describe</value>
   1.106  					<value>describe.jsp</value>
   1.107  	            </list>
   1.108  	            <list>
   1.109               		<!-- Link to bean: two arguemnts -->
   1.110 -					<value>Store</value>
   1.111 -					<value>store.jsp</value>
   1.112 +					<value>Browse</value>
   1.113 +					<value>browse.jsp</value>
   1.114  	            </list>
   1.115              </list>
   1.116           </constructor-arg>
     2.1 --- a/endpoint/WebContent/query.jsp	Sat Sep 29 09:37:21 2012 +0300
     2.2 +++ b/endpoint/WebContent/query.jsp	Wed Oct 03 17:44:50 2012 +0300
     2.3 @@ -100,7 +100,7 @@
     2.4  		<%if ("map".equals(request.getAttribute("handle")) || "map_local".equals(request.getAttribute("handle"))) {%>	
     2.5  			$('html, body').animate({
     2.6  				scrollTop: $("#divResultsStart").offset().top
     2.7 -			}, 1000);
     2.8 +			}, 1500);
     2.9  		<%}%>
    2.10  		}
    2.11  	</script>
    2.12 @@ -128,7 +128,8 @@
    2.13  			$("#accordion").accordion({ 
    2.14  				header: "h3",
    2.15  				fillSpace: true,
    2.16 -				navigation: true
    2.17 +				navigation: true,
    2.18 +				collapsible: true
    2.19  			});
    2.20  			//hover states on the static widgets
    2.21  			$('#dialog_link, ul#icons li').hover(
    2.22 @@ -140,7 +141,7 @@
    2.23  	<style type="text/css">
    2.24  		/*demo page css*/
    2.25  		body{ font: 90% "Trebuchet MS", sans-serif; margin: 50px;}
    2.26 -		.container { height:700px; width:165px;}
    2.27 +		.container { height:410px; width:165px;}
    2.28  		.demoHeaders { margin-top: 1em;}
    2.29  		#dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
    2.30  		#dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
    2.31 @@ -163,7 +164,7 @@
    2.32  
    2.33  <table border="0" width="100%">
    2.34  <tr> 
    2.35 -	<td width="90" valign="top" bgcolor="#dfe8f0"> 
    2.36 +	<td width="90" valign="top"> 
    2.37  		<table border="0" cellspacing="0" cellpadding="0" width="165">  
    2.38  		<tr><td id="twidth">
    2.39  		<div class="container">
    2.40 @@ -192,27 +193,29 @@
    2.41  									}
    2.42  									
    2.43  									String label=entry.getLabel();
    2.44 +									String style = "", href = "";
    2.45 +									hash = new Integer(Math.abs(label.hashCode())).toString();
    2.46 +									href="href=\"#"+hash+"\"";									
    2.47 +									%>
    2.48 +									<div><h3><a <%=style%> <%=href%>><%=label%></a></h3><div>
    2.49 +									<%									
    2.50 +								} else if (entry.isBean()) {
    2.51 +									String label=entry.getLabel();
    2.52  									String bean=entry.getBean();
    2.53  									String style = "", href = "";
    2.54 -									if (bean == null) {
    2.55 -										hash = new Integer(Math.abs(label.hashCode())).toString();
    2.56 -										href="href=\"#"+hash+"\"";
    2.57 -									} else {
    2.58 -										hash = new Integer(Math.abs(label.hashCode()*bean.hashCode())).toString();
    2.59 -										href = "href=\"" +bean + "#"+ hash+"\"";
    2.60 -										style = "class=\"navText\"";
    2.61 -									}
    2.62 -									
    2.63 +									hash = new Integer(Math.abs(label.hashCode()*bean.hashCode())).toString();
    2.64 +									href = "\"" +bean + "#"+ hash+"\"";
    2.65 +									style = "class=\"navText\"";
    2.66  									%>
    2.67 -									<div><h3><a <%=style%> <%=href%>><%=label%></a></h3><div>
    2.68 +									<b>&middot;</b>&nbsp;<a class="linkText" href=<%=href%>><%=label%></a><br/>
    2.69  									<%
    2.70  								} else {
    2.71  									String href="\""+URLEncoder.encode(entry.getBean(),"utf-8")+"?view=HTML&handle="+entry.getHandle()+"&query="+URLEncoder.encode(entry.getStatement(),"utf-8")+"&format="+URLEncoder.encode(entry.getFormat(),"utf-8")+(hash == "" ? "" : "#" + hash)+"\"";
    2.72  									String title="\""+entry.getTitle()+"\"";
    2.73  									String label=entry.getLabel();
    2.74 -				%>
    2.75 -					<b>&middot;</b>&nbsp;<a class="linkText" href=<%=href%> title=<%=title%>><%=label%></a><br/>
    2.76 -		<%
    2.77 +									%>
    2.78 +									<b>&middot;</b>&nbsp;<a class="linkText" href=<%=href%> title=<%=title%>><%=label%></a><br/>
    2.79 +									<%
    2.80  			
    2.81  								}
    2.82  							}
     3.1 --- a/endpoint/WebContent/style-menu.css	Sat Sep 29 09:37:21 2012 +0300
     3.2 +++ b/endpoint/WebContent/style-menu.css	Wed Oct 03 17:44:50 2012 +0300
     3.3 @@ -314,7 +314,7 @@
     3.4   */
     3.5  /* IE/Win - Fix animation bug - #4615 */
     3.6  .ui-accordion { width: 100%; }
     3.7 -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
     3.8 +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; font-size: 14px; }
     3.9  .ui-accordion .ui-accordion-li-fix { display: inline; }
    3.10  .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
    3.11  .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
     4.1 --- a/endpoint/WebContent/teleios-header.html	Sat Sep 29 09:37:21 2012 +0300
     4.2 +++ b/endpoint/WebContent/teleios-header.html	Wed Oct 03 17:44:50 2012 +0300
     4.3 @@ -4,10 +4,10 @@
     4.4        <TD height="1"></TD>
     4.5  	</TR>		
     4.6  	<TR>
     4.7 -      <TD height="60" background="images/nav2_bg.gif"> 
     4.8 +      <TD height="60"> 
     4.9          <table width="100%" border=0>
    4.10           <tr>
    4.11 -            <td width="1"><img src="images/nav2_bg.gif" width="1" height="60"></td>
    4.12 +            <td width="1">&nbsp;</td>
    4.13              <td valign="top" width="80px"><img border="0" src="images/teleios_logo.png" /></td>
    4.14              <td valign="top" align="left">
    4.15              <span class="logo">&nbsp;stSPARQL Endpoint</span><br><span class="style4"></span></td>
    4.16 @@ -38,4 +38,4 @@
    4.17  demo paper <a href="http://www.earthobservatory.eu/publications/p2010_manoliskoubarakis_vldb2012-2.pdf">here</a>. </p> 
    4.18        </TD>
    4.19  	</TR>
    4.20 -</TABLE>
    4.21 \ No newline at end of file
    4.22 +</TABLE>
     5.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapperConfiguration.java	Sat Sep 29 09:37:21 2012 +0300
     5.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapperConfiguration.java	Wed Oct 03 17:44:50 2012 +0300
     5.3 @@ -21,7 +21,8 @@
     5.4  	private String format;
     5.5  	private String title;
     5.6  	private String handle;
     5.7 -	private boolean header;
     5.8 +	private boolean isHeader;
     5.9 +	private boolean isBean;
    5.10  
    5.11  	public StrabonBeanWrapperConfiguration(String label, String bean, String statement, String format, String title, String handle) {
    5.12  		this.label = label;
    5.13 @@ -30,19 +31,22 @@
    5.14  		this.format = format;
    5.15  		this.title = title;
    5.16  		this.handle = handle;
    5.17 -		this.header = false;
    5.18 +		this.isHeader = false;
    5.19 +		this.isBean = false;
    5.20  	}
    5.21  	
    5.22  	public StrabonBeanWrapperConfiguration(String label) {
    5.23  		this.label = label;
    5.24  		this.bean = null;
    5.25 -		this.header = true;
    5.26 +		this.isHeader = true;
    5.27 +		this.isBean = false;
    5.28  	}
    5.29  	
    5.30  	public StrabonBeanWrapperConfiguration(String label, String bean) {
    5.31  		this.label = label;
    5.32  		this.bean = bean;
    5.33 -		this.header = true;
    5.34 +		this.isHeader = false;
    5.35 +		this.isBean = true;
    5.36  	}
    5.37  	
    5.38  	public String getLabel() {
    5.39 @@ -95,11 +99,18 @@
    5.40  	}
    5.41  
    5.42  	public boolean isHeader() {
    5.43 -		return header;
    5.44 +		return isHeader;
    5.45  	}
    5.46  
    5.47 -	public void setHeader(boolean header) {
    5.48 -		this.header = header;
    5.49 +	public void setHeader(boolean isHeader) {
    5.50 +		this.isHeader = isHeader;
    5.51  	}
    5.52 +	public boolean isBean() {
    5.53 +		return isBean;
    5.54 +	}
    5.55 +	public void setBean(boolean isBean) {
    5.56 +		this.isBean = isBean;
    5.57 +	}
    5.58 +	
    5.59  }
    5.60