Strabon

annotate endpoint/WebContent/query.jsp @ 1337:4dff2f1163d8

Merge with default branch.
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Fri May 23 13:37:11 2014 +0300 (2014-05-23)
parents 5e650277cbdf 3d89aafb0ad7
children 5b6b65340693
rev   line source
psmeros@544 1 <%@page import="java.net.URLEncoder"%>
grad1110@502 2 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
psmeros@544 3 <%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
psmeros@544 4 <%@page import="org.springframework.web.context.WebApplicationContext"%>
psmeros@544 5 <%@page import="eu.earthobservatory.org.StrabonEndpoint.StrabonBeanWrapper"%>
charnik@548 6 <%@page import="eu.earthobservatory.org.StrabonEndpoint.StrabonBeanWrapperConfiguration"%>
psmeros@544 7 <%@page import="java.util.List"%>
Konstantina@1192 8 <%@page import="java.util.ArrayList"%>
psmeros@544 9 <%@page import="java.util.Iterator"%>
Konstantina@1189 10 <%@page import="org.openrdf.query.TupleQueryResult"%>
Konstantina@1190 11 <%@page import="org.openrdf.query.BindingSet"%>
charnik@522 12 <jsp:directive.page import="eu.earthobservatory.org.StrabonEndpoint.Common"/>
grad1110@502 13 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
grad1110@502 14 <html>
grad1110@502 15 <head>
grad1110@502 16 <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
grad1110@502 17 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
sgian@605 18 <script type="text/javascript" src="js/more_link.js"></script>
charnik@542 19 <link rel="stylesheet" href="style.css" type="text/css" />
Konstantina@1239 20 <script type="text/javascript" src="js/timemap/jquery-1.6.2.min.js"></script>
Konstantina@1239 21 <script type="text/javascript" src="js/timemap/mxn.js?(googlev3)"></script>
Konstantina@1239 22 <script type="text/javascript" src="js/timemap/timeline-1.2.js"></script>
Konstantina@1239 23 <script src="js/timemap/timemap.js" type="text/javascript"></script>
Konstantina@1239 24 <script src="js/timemap/param.js" type="text/javascript"></script>
Konstantina@1239 25 <script src="js/timemap/xml.js" type="text/javascript"></script>
Konstantina@1239 26 <script src="js/timemap/kml.js" type="text/javascript"></script>
grad1110@502 27 <script type="text/javascript">
grad1110@502 28 function toggleMe(a) {
grad1110@502 29 var e = document.getElementById(a);
grad1110@502 30 if (!e) {
grad1110@502 31 return true;
grad1110@502 32 }
grad1110@502 33 if (e.style.display == "none") {
grad1110@502 34 e.style.display = "block";
grad1110@502 35 } else {
grad1110@502 36 e.style.display = "none";
grad1110@502 37 }
grad1110@502 38 return true;
grad1110@502 39 }
grad1110@502 40 </script>
sgian@605 41 <script>
sgian@605 42 $(document).ready(function() {
sgian@605 43 var showChar = 100;
sgian@605 44 var ellipsestext = "...";
sgian@605 45 var moretext = "more";
sgian@605 46 var lesstext = "less";
sgian@605 47 $('.more').each(function() {
sgian@605 48 var content = $(this).html();
sgian@605 49
sgian@605 50 if(content.length > showChar) {
sgian@605 51
sgian@605 52 var c = content.substr(0, showChar);
sgian@605 53 var h = content.substr(showChar-1, content.length - showChar);
sgian@605 54
sgian@605 55 var html = c + '<span class="moreelipses">'+ellipsestext+'</span>&nbsp;<span class="morecontent"><span>' + h + '</span>&nbsp;&nbsp;<a href="" class="morelink">'+moretext+'</a></span>';
sgian@605 56
sgian@605 57 $(this).html(html);
sgian@605 58 }
sgian@605 59
sgian@605 60 });
sgian@605 61
sgian@605 62 $(".morelink").click(function(){
sgian@605 63 if($(this).hasClass("less")) {
sgian@605 64 $(this).removeClass("less");
sgian@605 65 $(this).html(moretext);
sgian@605 66 } else {
sgian@605 67 $(this).addClass("less");
sgian@605 68 $(this).html(lesstext);
sgian@605 69 }
sgian@605 70 $(this).parent().prev().toggle();
sgian@605 71 $(this).prev().toggle();
sgian@605 72 return false;
sgian@605 73 });
sgian@605 74 });
sgian@605 75 </script>
charnik@548 76 <%
charnik@634 77 // get the reference to StrabonBeanWrapper
charnik@634 78 StrabonBeanWrapper strabonWrapper;
Konstantina@1192 79 //String arr = new String[2];
Konstantina@1197 80 int i;
Konstantina@1197 81 ArrayList<String> arr = new ArrayList<String>(2);
Konstantina@1197 82 String gChartString=null;
charnik@634 83 ServletContext context;
charnik@634 84 context = getServletContext();
charnik@634 85 WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(context);
charnik@634 86 strabonWrapper=(StrabonBeanWrapper) applicationContext.getBean("strabonBean");
charnik@634 87
charnik@560 88 // get query parameter or attribute (the attribute comes from ConnectionBean)
charnik@634 89 String query = strabonWrapper.getPrefixes();
charnik@548 90 if (request.getParameter("query") != null) {
charnik@548 91 query = request.getParameter("query");
charnik@548 92
charnik@548 93 } else if (request.getAttribute("query") != null) {
charnik@548 94 query = (String) request.getAttribute("query");
charnik@548 95
charnik@548 96 }
charnik@560 97
charnik@567 98 if ("null".equals(query)) {
charnik@567 99 query = "";
charnik@567 100 }
charnik@567 101
charnik@560 102 // get format parameter or attribute (the attribute comes from ConnectionBean)
charnik@604 103 String selFormat = "HTML";
charnik@560 104 if (request.getParameter("format") != null) {
charnik@560 105 selFormat = request.getParameter("format");
charnik@560 106
charnik@560 107 } else if (request.getAttribute("format") != null) {
charnik@560 108 selFormat = (String) request.getAttribute("format");
charnik@560 109
charnik@560 110 }
charnik@560 111
charnik@560 112 // get handle parameter or attribute (the attribute comes from ConnectionBean)
charnik@560 113 String handle = "";
charnik@560 114 if (request.getParameter("handle") != null) {
charnik@560 115 handle = request.getParameter("handle");
charnik@560 116
charnik@560 117 } else if (request.getAttribute("handle") != null) {
charnik@560 118 handle = (String) request.getAttribute("handle");
charnik@560 119
charnik@560 120 }
kkyzir@616 121
charnik@548 122 if (request.getAttribute("pathToKML") != null) {
Konstantina@1241 123 if (request.getAttribute("handle").toString().contains("map")) {
charnik@548 124 %>
Konstantina@1239 125 <link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
Konstantina@1239 126 <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
charnik@542 127 <script type="text/javascript" src="js/geoxml3-kmz.js"></script>
charnik@542 128 <script type="text/javascript" src="js/ProjectedOverlay.js"></script>
kkyzir@616 129 <%
kkyzir@616 130 }
kkyzir@616 131 %>
Konstantina@1239 132
grad1110@502 133 <script type="text/javascript">
kallirroi@1199 134
kallirroi@1199 135 //listener for the event 'bounds_changed'
kallirroi@1199 136 function addListener(map){
kallirroi@1199 137
kallirroi@1199 138 google.maps.event.addListener(map, 'bounds_changed', function() {
kallirroi@1199 139 // get the new bounds
kallirroi@1199 140 var bounds = map.getBounds();
kallirroi@1199 141 var northEast = bounds.getNorthEast();
kallirroi@1199 142 var southWest = bounds.getSouthWest();
kallirroi@1199 143
kallirroi@1199 144 var x1 = northEast.lng().toFixed(2);
kallirroi@1199 145 var y1 = northEast.lat().toFixed(2);
kallirroi@1199 146
kallirroi@1199 147 var x2 = southWest.lng().toFixed(2);
kallirroi@1199 148 var y2 = southWest.lat().toFixed(2);
kallirroi@1199 149
kallirroi@1204 150 var polygon = "\"<http\://www.opengis.net/def/crs/EPSG/0/4326\> POLYGON((" +
kallirroi@1199 151 x1 + " " + y2 + ", " +
kallirroi@1199 152 x2 + " " + y2 + ", " +
kallirroi@1199 153 x2 + " " + y1 + ", " +
kallirroi@1199 154 x1 + " " + y1 + ", " +
kallirroi@1204 155 x1 + " " + y2 + "))\"" +
kallirroi@1204 156 "^^<http\://www.opengis.net/ont/geosparql#wktLiteral>";
kallirroi@1199 157
kallirroi@1199 158 document.getElementById('bounds').value=polygon;
kallirroi@1199 159
kallirroi@1199 160 });
kallirroi@1199 161 }
kallirroi@1199 162
grad1110@502 163 function initialize() {
charnik@522 164 var myOptions = {
charnik@522 165 zoom: 11,
Konstantina@1241 166 mapTypeId: google.maps.MapTypeId.ROADMAP,
Konstantina@1241 167 zoomControl: true
charnik@522 168 };
kallirroi@1199 169
charnik@542 170 // get KML filename
charnik@542 171 var kml = '<%=request.getAttribute("pathToKML")%>';
Konstantina@1240 172 var map;
charnik@542 173 // create map
Konstantina@1240 174 <%if(request.getAttribute("handle").toString().contains("timemap")){ %>
charnik@1318 175 map = tm.getNativeMap();
charnik@1318 176 map.setOptions(myOptions);
Konstantina@1240 177 <%} else {%>
charnik@1318 178 var map = new google.maps.Map(document.getElementById("map"), myOptions);
Konstantina@1240 179 <%}%>
sgian@699 180 <% if (request.getAttribute("pathToKML") == null) {%>
Konstantina@1241 181 // center at Brahames
sgian@699 182 map.setCenter(new google.maps.LatLng(37.92253, 23.72275));
sgian@699 183 <%}%>
kallirroi@1199 184
kallirroi@1199 185 addListener(map);
kallirroi@1199 186
sgian@699 187
charnik@1318 188 <%if ("map_local".equals(request.getAttribute("handle"))) {%>
charnik@542 189 // display using geoxml3
charnik@542 190 var myParser = new geoXML3.parser({map: map});
kallirroi@1199 191 myParser.parse(kml);
charnik@542 192 <%} else {%>
charnik@542 193 var ctaLayer = new google.maps.KmlLayer(kml);
charnik@522 194 ctaLayer.setMap(map);
charnik@542 195 <%}%>
kkyzir@612 196
Konstantina@1240 197 <%if (("map".equals(request.getAttribute("handle"))) || ("map_local".equals(request.getAttribute("handle")))
charnik@1318 198 || ("timemap".equals(request.getAttribute("handle")))) {%>
kkyzir@612 199 $('html, body').animate({
kkyzir@612 200 scrollTop: $("#divResultsStart").offset().top
kkyzir@617 201 }, 1500);
kallirroi@1199 202
kkyzir@614 203 <%}%>
kallirroi@1199 204
kallirroi@1199 205
grad1110@502 206 }
kkyzir@616 207 </script>
kkyzir@615 208 <% } else { %>
kkyzir@615 209 <script type="text/javascript">
kkyzir@615 210 function initialize() {
kkyzir@616 211 <%
kkyzir@616 212 if (query != "" || selFormat != "" || handle != "") {
kkyzir@615 213 %>
kkyzir@615 214 $('html, body').animate({
kkyzir@615 215 scrollTop: $("#divResultsStart").offset().top
kkyzir@615 216 }, 1000);
kkyzir@615 217 <%}%>
kkyzir@616 218 }
kkyzir@615 219 </script>
kkyzir@615 220 <%}%>
kkyzir@615 221
kkyzir@608 222 <!-- jQuery start -->
kkyzir@608 223 <link type="text/css" href="style-menu.css" rel="stylesheet" />
kkyzir@608 224 <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
kkyzir@608 225 <script type="text/javascript" src="js/jquery-ui-1.8.23.custom.min.js"></script>
kkyzir@608 226 <script type="text/javascript">
kkyzir@608 227 $(function(){
kkyzir@608 228 // Accordion
kkyzir@608 229 $("#accordion").accordion({
kkyzir@608 230 header: "h3",
kkyzir@616 231 fillSpace: true,
kkyzir@617 232 navigation: true,
kkyzir@617 233 collapsible: true
kkyzir@608 234 });
kkyzir@608 235 //hover states on the static widgets
kkyzir@608 236 $('#dialog_link, ul#icons li').hover(
kkyzir@608 237 function() { $(this).addClass('ui-state-hover'); },
kkyzir@608 238 function() { $(this).removeClass('ui-state-hover'); }
kkyzir@608 239 );
kkyzir@608 240 });
kkyzir@608 241 </script>
kkyzir@608 242 <style type="text/css">
kkyzir@608 243 /*demo page css*/
kkyzir@608 244 body{ font: 90% "Trebuchet MS", sans-serif; margin: 50px;}
kkyzir@617 245 .container { height:410px; width:165px;}
kkyzir@608 246 .demoHeaders { margin-top: 1em;}
kkyzir@608 247 #dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
kkyzir@608 248 #dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
kkyzir@608 249 ul#icons {margin: 0; padding: 0;}
kkyzir@608 250 ul#icons li {margin: 1px; position: relative; padding: 1px 0; cursor: pointer; float: left; list-style: none;}
kkyzir@608 251 ul#icons span.ui-icon {float: left; margin: 0 1px;}
kkyzir@608 252 </style>
Konstantina@1239 253
Konstantina@1239 254 <script type="text/javascript">
Konstantina@1239 255
Konstantina@1239 256 var tm;
Konstantina@1239 257 $(function() {
Konstantina@1241 258 var myOptions = {
Konstantina@1241 259 zoom: 11,
Konstantina@1241 260 mapTypeId: google.maps.MapTypeId.ROADMAP,
Konstantina@1241 261 zoomControl: true,
Konstantina@1241 262 scrollwheel : true
Konstantina@1241 263
Konstantina@1241 264 };
Konstantina@1241 265
Konstantina@1241 266 var map = new google.maps.Map(document.getElementById("map"), myOptions);
Konstantina@1239 267 tm = TimeMap.init({
Konstantina@1241 268 // Id of map div element (required)
Konstantina@1241 269 mapId: "map",
Konstantina@1239 270 timelineId: "timeline", // Id of timeline div element (required)
Konstantina@1239 271 options: {
Konstantina@1241 272 eventIconPath: "images/"
Konstantina@1239 273 },
Konstantina@1239 274 datasets: [
Konstantina@1239 275 {
Konstantina@1239 276 title: "Visualization of timestamps",
Konstantina@1239 277 theme: "red",
Konstantina@1239 278 type: "kml", // Data to be loaded in KML - must be a local URL
Konstantina@1239 279 options: {
Konstantina@1239 280 url: <% if(request.getAttribute("pathToKML") != null){
Konstantina@1239 281 out.println("\""+request.getAttribute("pathToKML")+"\"");
Konstantina@1239 282 }%> // KML file to load
Konstantina@1239 283 }
Konstantina@1239 284 }
Konstantina@1239 285 ],
Konstantina@1239 286 bandInfo: [
Konstantina@1239 287 {
Konstantina@1239 288 width: "85%",
Konstantina@1260 289 intervalUnit: Timeline.DateTime.MONTH,
Konstantina@1239 290 intervalPixels: 210
Konstantina@1239 291 },
Konstantina@1239 292 {
Konstantina@1239 293 width: "15%",
Konstantina@1260 294 intervalUnit: Timeline.DateTime.YEAR,
Konstantina@1239 295 intervalPixels: 150,
Konstantina@1239 296 showEventText: false,
Konstantina@1239 297 trackHeight: 0.2,
Konstantina@1239 298 trackGap: 0.2
Konstantina@1239 299 }
Konstantina@1239 300 ]
Konstantina@1239 301 });
Konstantina@1241 302
Konstantina@1241 303
Konstantina@1239 304 });
Konstantina@1241 305
Konstantina@1239 306
Konstantina@1239 307 </script>
Konstantina@1239 308
gstam@1314 309
Konstantina@1239 310 <link href="js/timemap/examples.css" type="text/css" rel="stylesheet"/>
Konstantina@1239 311 <style>
Konstantina@1239 312 div#timelinecontainer{ height: 310px; }
Konstantina@1240 313 div#mapcontainer{ height: 600px; }
Konstantina@1239 314 </style>
Konstantina@1239 315
kkyzir@608 316 <!-- jQuery end -->
kkyzir@614 317
gstam@1309 318 <title>Strabon Endpoint</title>
Konstantina@1189 319 <!--Load the AJAX API-->
Konstantina@1189 320 <script type="text/javascript" src="https://www.google.com/jsapi"></script>
Konstantina@1189 321 <script type="text/javascript">
Konstantina@1189 322
Konstantina@1189 323 // Load the Visualization API and the piechart package.
Konstantina@1189 324 google.load('visualization', '1.0', {'packages':['corechart']});
Konstantina@1189 325
Konstantina@1192 326 google.setOnLoadCallback(drawChart);
Konstantina@1192 327
Konstantina@1189 328 // Set a callback to run when the Google Visualization API is loaded.
Konstantina@1189 329
Konstantina@1190 330
Konstantina@1189 331 // Callback that creates and populates a data table,
Konstantina@1189 332 // instantiates the pie chart, passes in the data and
Konstantina@1189 333 // draws it.
Konstantina@1189 334
Konstantina@1197 335
Konstantina@1197 336
Konstantina@1189 337 function drawChart() {
Konstantina@1190 338
Konstantina@1189 339 // Create the data table.
Konstantina@1189 340 var data = new google.visualization.DataTable();
Konstantina@1220 341 <% if (request.getAttribute("format")!=null && request.getAttribute("response") != null) {
Konstantina@1220 342 if (request.getAttribute("format").equals("CHART")) {
Konstantina@1197 343 out.println(request.getAttribute("response"));
Konstantina@1197 344 %>
Konstantina@1197 345
Konstantina@1220 346
Konstantina@1189 347 chart.draw(data, options);
Konstantina@1190 348
Konstantina@1190 349 <%}}%>
Konstantina@1189 350 }
Konstantina@1189 351 </script>
Konstantina@1239 352
Konstantina@1239 353
grad1110@502 354 </head>
grad1110@502 355 <body topmargin="0" leftmargin="0" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" onload="initialize()">
grad1110@502 356
grad1110@502 357 <!-- include TELEIOS header and description -->
gstam@1309 358 <%@ include file="header.html"%>
grad1110@502 359 <!-- include TELEIOS header and description -->
grad1110@502 360
charnik@522 361 <FORM enctype="UTF-8" accept-charset="UTF-8" method="post" action="Query">
charnik@522 362 <INPUT type=hidden name="view" value="HTML"/>
charnik@522 363
charnik@527 364 <table border="0" width="100%">
charnik@527 365 <tr>
kkyzir@617 366 <td width="90" valign="top">
kkyzir@608 367 <table border="0" cellspacing="0" cellpadding="0" width="165">
charnik@527 368 <tr><td id="twidth">
kkyzir@608 369 <div class="container">
kkyzir@608 370 <div id="accordion">
psmeros@544 371 <%
charnik@548 372
charnik@548 373 Iterator <StrabonBeanWrapperConfiguration> entryListIterator = strabonWrapper.getEntries().iterator();
kkyzir@608 374 boolean first = true;
kkyzir@616 375 String hash = "";
charnik@548 376 while(entryListIterator.hasNext())
charnik@548 377 {
charnik@548 378 StrabonBeanWrapperConfiguration entry = entryListIterator.next();
charnik@548 379
kkyzir@608 380 if (entry.isHeader()) {
kkyzir@608 381 if (!first) {
kkyzir@608 382 %>
kkyzir@608 383 </div></div>
kkyzir@608 384 <%
kkyzir@608 385 } else {
kkyzir@608 386 first = false;
kkyzir@608 387 }
kkyzir@608 388
kkyzir@608 389 String label=entry.getLabel();
kkyzir@617 390 String style = "", href = "";
kkyzir@617 391 hash = new Integer(Math.abs(label.hashCode())).toString();
kkyzir@617 392 href="href=\"#"+hash+"\"";
kkyzir@617 393 %>
kkyzir@617 394 <div><h3><a <%=style%> <%=href%>><%=label%></a></h3><div>
kkyzir@617 395 <%
kkyzir@617 396 } else if (entry.isBean()) {
kkyzir@617 397 String label=entry.getLabel();
kkyzir@608 398 String bean=entry.getBean();
psmeros@1172 399 if(bean.equals("browse.jsp") || bean.equals("ChangeConnection"))
psmeros@1162 400 continue;
kkyzir@616 401 String style = "", href = "";
kkyzir@617 402 hash = new Integer(Math.abs(label.hashCode()*bean.hashCode())).toString();
kkyzir@617 403 href = "\"" +bean + "#"+ hash+"\"";
kkyzir@617 404 style = "class=\"navText\"";
kkyzir@608 405 %>
kkyzir@617 406 <b>&middot;</b>&nbsp;<a class="linkText" href=<%=href%>><%=label%></a><br/>
kkyzir@608 407 <%
kkyzir@608 408 } else {
kkyzir@616 409 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)+"\"";
kkyzir@608 410 String title="\""+entry.getTitle()+"\"";
kkyzir@608 411 String label=entry.getLabel();
kkyzir@617 412 %>
kkyzir@617 413 <b>&middot;</b>&nbsp;<a class="linkText" href=<%=href%> title=<%=title%>><%=label%></a><br/>
kkyzir@617 414 <%
kkyzir@608 415
kkyzir@608 416 }
kkyzir@608 417 }
kkyzir@608 418 %>
kkyzir@608 419 </div>
kkyzir@608 420 </div>
charnik@527 421 </td>
grad1110@502 422 </tr>
kkyzir@608 423 <!--
grad1110@502 424 <tr><td width="90" class="style4"><a href="describe.jsp" class="navText">Describe</a></td></tr>
kkyzir@608 425 <tr><td width="90" class="style4"><a href="store.jsp" class="navText" title="Store triples">Store</a></td></tr>
kkyzir@608 426 -->
grad1110@502 427 </table>
grad1110@502 428 </td>
grad1110@502 429 <td width="*" valign="top" >
grad1110@502 430 <table cellspacing="5">
charnik@527 431 <%if (request.getAttribute("info") != null) { %>
charnik@527 432 <!-- Info Message -->
charnik@527 433 <TR><TD colspan=2>
charnik@527 434 <CENTER><P><%=request.getAttribute("info") %></P></CENTER>
charnik@527 435 </TD></TR>
charnik@527 436 <!-- Info Message -->
charnik@527 437 <%}%>
grad1110@502 438 <tr>
psmeros@1162 439 <td id="output" colspan=2>
psmeros@1162 440 <div style="font-size:13px">
gstam@1314 441 You must be logged in to perform update queries, or run in localhost.
psmeros@1162 442 </div>
psmeros@1162 443 </td>
grad1110@502 444 </tr>
grad1110@502 445 <tr>
psmeros@1162 446 <td id="output" style="width: 150px">stSPARQL Query:</td>
psmeros@1162 447 <td id="output"><textarea name="query" title="pose your query/update here" rows="20" cols="100"><%=query%></textarea></td>
psmeros@1162 448 </tr>
psmeros@1162 449 <tr>
psmeros@1162 450 <td id="output">Output Format:</td>
psmeros@1162 451 <td id="output">
charnik@522 452 <select name="format" title="select one of the following output format types">
charnik@560 453 <%
charnik@522 454 for (String format : Common.registeredQueryResultsFormatNames) {%>
charnik@522 455 <OPTION value="<%=format%>"<%=format.equals(selFormat) ? "selected":""%>><%=format%></OPTION>
charnik@522 456 <%}%>
psmeros@1162 457 </select>
charnik@522 458 </td>
grad1110@502 459 </tr>
charnik@522 460 <tr>
psmeros@1162 461 <td id="output">View Result:</td>
psmeros@1162 462 <td id="output">
charnik@522 463 <SELECT name="handle" title="select how you would like to view the result">
charnik@560 464 <OPTION value="plain"<%= ("plain".equals(handle)) ? "selected":""%>>Plain</OPTION>
charnik@560 465 <OPTION value="download"<%= ("download".equals(handle)) ? "selected":""%>>Download</OPTION>
charnik@560 466 <OPTION value="map"<%= ("map".equals(handle)) ? "selected":""%>>On a map</OPTION>
charnik@560 467 <OPTION value="map_local"<%= ("map_local".equals(handle)) ? "selected":""%>>On a map (localhost)</OPTION>
Konstantina@1240 468 <OPTION value="timemap"<%= ("timemap".equals(handle)) ? "selected":""%>>On a timemap</OPTION>
psmeros@1162 469 </SELECT>
charnik@522 470 </td>
charnik@522 471 </tr>
psmeros@1162 472
kallirroi@1199 473 <tr>
kallirroi@1199 474 <td id="output">Map Bounds:</td>
kallirroi@1199 475 <td id="output">
kallirroi@1199 476 <textarea readonly id='bounds' rows="1" cols="100"></textarea>
kallirroi@1199 477 </td>
kallirroi@1199 478 </tr>
kallirroi@1199 479
psmeros@1162 480 <tr>
psmeros@1162 481 <td colspan=2 id="output"><br/><center>
psmeros@1162 482 <input type="submit" title="execute query" value="Query" name="submit" style="width: 350px" />
psmeros@1162 483 <input type="submit" title="execute update" value="Update" name="submit" style="width: 350px"/></center><br/></td>
psmeros@1162 484 </tr>
psmeros@1162 485
kallirroi@1199 486
kallirroi@1199 487
charnik@522 488 <% if (request.getAttribute("error") != null) {%>
charnik@522 489 <!-- Error Message -->
charnik@522 490 <TR>
charnik@522 491 <TD id="output">Result: </TD><TD id="output"><%=request.getAttribute("error") %></TD>
charnik@522 492 </TR>
charnik@522 493 <!-- Error Message -->
charnik@522 494 <%}%>
grad1110@502 495 </table></td></tr></table><br/><br/>
grad1110@502 496 </form>
kkyzir@612 497 <a name="#results">&nbsp;</a>
kkyzir@612 498 <div id="divResultsStart"></div>
charnik@522 499 <!-- Response -->
Konstantina@1221 500 <% if(request.getAttribute("format") == null || !request.getAttribute("format").equals("CHART")){
Konstantina@1221 501 if (request.getAttribute("response") != null) {
Konstantina@1221 502 if (Common.getHTMLFormat().equals(request.getParameter("format"))) {%>
charnik@543 503 <%=request.getAttribute("response")%>
Konstantina@1221 504 <%} else { %>
charnik@522 505 <PRE><%=request.getAttribute("response") %></PRE>
charnik@543 506 <%}%>
Konstantina@1221 507 <%}}%>
charnik@522 508 <!-- Response -->
Konstantina@1240 509 <% if (request.getAttribute("pathToKML") != null && request.getAttribute("handle").toString().contains("timemap")) { %>
Konstantina@1239 510 <div id="timemap">
Konstantina@1239 511 <div id="timelinecontainer">
Konstantina@1239 512 <div id="timeline"></div>
Konstantina@1239 513 </div>
Konstantina@1239 514 <div id="mapcontainer">
Konstantina@1239 515 <div id="map"></div>
Konstantina@1239 516 </div>
Konstantina@1239 517 </div>
Konstantina@1241 518 <%} else {%>
Konstantina@1240 519 <div id="map"></div>
Konstantina@1241 520 <%} %>
kkyzir@612 521 <div id="divResultsEnd" style="height: 1px; width 1px"></div>
Konstantina@1196 522 <div id="chart_div"></div>
grad1110@502 523 </body>
grad1110@502 524 </html>