Strabon

view endpoint/WebContent/describe.jsp @ 1421:b1ad88fdf4a6

added log4j.properties to endpoint-client; corrected test that using geof:getSRID() with a strdf:transform function with an input a geo:wktLiteral constant; in such a case we cannot return CRS84 simply because strdf:transform creates strdf:WKT datatypes for which the default CRS is EPSG:4326
author Babis Nikolaou <charnik@di.uoa.gr>
date Tue Sep 23 13:16:47 2014 +0300 (2014-09-23)
parents 845e3fbd310e
children
line source
1 <%@page import="java.net.URLEncoder"%>
2 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
3 <%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
4 <%@page import="org.springframework.web.context.WebApplicationContext"%>
5 <%@page import="eu.earthobservatory.org.StrabonEndpoint.StrabonBeanWrapper"%>
6 <%@page import="eu.earthobservatory.org.StrabonEndpoint.StrabonBeanWrapperConfiguration"%>
7 <%@page import="java.util.List"%>
8 <%@page import="java.util.Iterator"%>
9 <jsp:directive.page import="eu.earthobservatory.org.StrabonEndpoint.Common"/>
10 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
11 <html>
12 <head>
13 <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
14 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
15 <link rel="stylesheet" href="style.css" type="text/css"/>
16 <script type="text/javascript">
17 function toggleMe(a) {
18 var e = document.getElementById(a);
19 if (!e) {
20 return true;
21 }
22 if (e.style.display == "none") {
23 e.style.display = "block";
24 } else {
25 e.style.display = "none";
26 }
27 return true;
28 }
29 </script>
31 <%String handle = "";
32 if (request.getParameter("handle") != null)
33 {
34 handle = request.getParameter("handle");
36 }
37 else if (request.getAttribute("handle") != null)
38 {
39 handle = (String) request.getAttribute("handle");
41 }
43 String selFormat = "RDF/XML";
44 if (request.getParameter("format") != null) {
45 selFormat = request.getParameter("format");
47 } else if (request.getAttribute("format") != null) {
48 selFormat = (String) request.getAttribute("format");
50 }%>
51 <!-- jQuery start -->
52 <link type="text/css" href="style-menu.css" rel="stylesheet" />
53 <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
54 <script type="text/javascript" src="js/jquery-ui-1.8.23.custom.min.js"></script>
55 <script type="text/javascript">
56 $(function(){
57 // Accordion
58 $("#accordion").accordion({
59 header: "h3",
60 fillSpace: true,
61 navigation: true,
62 collapsible: true
63 });
64 //hover states on the static widgets
65 $('#dialog_link, ul#icons li').hover(
66 function() { $(this).addClass('ui-state-hover'); },
67 function() { $(this).removeClass('ui-state-hover'); }
68 );
69 });
70 </script>
71 <style type="text/css">
72 /*demo page css*/
73 body{ font: 90% "Trebuchet MS", sans-serif; margin: 50px;}
74 .container { height:410px; width:165px;}
75 .demoHeaders { margin-top: 1em;}
76 #dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
77 #dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
78 ul#icons {margin: 0; padding: 0;}
79 ul#icons li {margin: 1px; position: relative; padding: 1px 0; cursor: pointer; float: left; list-style: none;}
80 ul#icons span.ui-icon {float: left; margin: 0 1px;}
81 </style>
83 <title>Strabon Endpoint</title>
85 </head>
86 <body topmargin="0" leftmargin="0" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
88 <!-- include TELEIOS header and description -->
89 <jsp:include page="header.html"/>
90 <!-- include TELEIOS header and description -->
92 <FORM enctype="UTF-8" accept-charset="UTF-8" method="post" action="Describe">
93 <INPUT type=hidden name="view" value="HTML"/>
95 <table border="0" width="100%">
96 <tr>
97 <td width="90" valign="top">
98 <table border="0" cellspacing="0" cellpadding="0" width="165">
99 <tr><td id="twidth">
100 <div class="container">
101 <div id="accordion">
102 <%
103 StrabonBeanWrapper strabonWrapper;
104 ServletContext context;
105 context = getServletContext();
106 WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(context);
107 strabonWrapper=(StrabonBeanWrapper) applicationContext.getBean("strabonBean");
108 Iterator <StrabonBeanWrapperConfiguration> entryListIterator = strabonWrapper.getEntries().iterator();
109 boolean first = true;
110 String hash = "";
111 while(entryListIterator.hasNext())
112 {
113 StrabonBeanWrapperConfiguration entry = entryListIterator.next();
115 if (entry.isHeader()) {
116 if (!first) {
117 %>
118 </div></div>
119 <%
120 } else {
121 first = false;
122 }
124 String label=entry.getLabel();
125 String style = "", href = "";
126 hash = new Integer(Math.abs(label.hashCode())).toString();
127 href="href=\"#"+hash+"\"";
128 %>
129 <div><h3><a <%=style%> <%=href%>><%=label%></a></h3><div>
130 <%
131 } else if (entry.isBean()) {
132 String label=entry.getLabel();
133 String bean=entry.getBean();
134 if(bean.equals("browse.jsp") || bean.equals("ChangeConnection"))
135 continue;
136 String style = "", href = "";
137 hash = new Integer(Math.abs(label.hashCode()*bean.hashCode())).toString();
138 href = "\"" +bean + "#"+ hash+"\"";
139 style = "class=\"navText\"";
140 %>
141 <b>&middot;</b>&nbsp;<a class="linkText" href=<%=href%>><%=label%></a><br/>
142 <%
143 } else {
144 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)+"\"";
145 String title="\""+entry.getTitle()+"\"";
146 String label=entry.getLabel();
147 %>
148 <b>&middot;</b>&nbsp;<a class="linkText" href=<%=href%> title=<%=title%>><%=label%></a><br/>
149 <%
151 }
152 }
153 %>
154 </div>
155 </div>
156 </td>
157 </tr>
158 <!--
159 <tr><td width="90" class="style4"><a href="describe.jsp" class="navText">Describe</a></td></tr>
160 <tr><td width="90" class="style4"><a href="store.jsp" class="navText" title="Store triples">Store</a></td></tr>
161 -->
162 </table>
163 </td>
164 <td width="*" valign="top">
165 <table cellspacing="5">
166 <tr>
167 <td id="output" style="width: 150px">stSPARQL Query:</td>
168 <td id="output"><textarea name="query" title="pose your DESCRIBE query here" rows="15" cols="100">
169 <%=request.getParameter("query") != null ? request.getParameter("query"):""%></textarea></td>
170 </tr>
171 <tr>
172 <td id="output">Output Format:</td>
173 <td id="output">
174 <SELECT name="format" title="select one of the following RDF graph format types">
175 <% for (String format : Common.registeredFormats) {%>
176 <OPTION value="<%=format%>"<%=format.equals(selFormat) ? "selected":""%>><%=format%></OPTION>
177 <%}%>
178 </SELECT>
179 </td>
180 </tr>
181 <tr>
182 <td id="output">View Result:</td>
183 <td id="output">
184 <SELECT name="handle" title="select how you would like to view the result">
185 <OPTION value="plain"<%= ("plain".equals(handle)) ? "selected":""%>>Plain</OPTION>
186 <OPTION value="download"<%= ("download".equals(handle)) ? "selected":""%>>Download</OPTION>
187 </SELECT>
188 </td>
189 </tr>
190 <tr>
191 <td colspan=2 id="output"><br/>
192 <center>
193 <input type="submit" title="execute DESCRIBE query" value="Describe" name="submit" style="width: 350px"/>
194 </center><br/>
195 </td>
196 </tr>
200 <% if (request.getAttribute("error") != null) {%>
201 <!-- Error Message -->
202 <TR>
203 <TD id="output">Result: </TD><TD id="output"><%=request.getAttribute("error") %></TD>
204 </TR>
205 <!-- Error Message -->
206 <%}%>
209 </table></td></tr>
212 </table>
213 </form>
214 <% if (request.getAttribute("response") != null) {%>
215 <!-- Response -->
216 <div><%=request.getAttribute("response") %></div>
217 <!-- Response -->
218 <%}%>
219 </body>
220 </html>