Strabon

view endpoint/WebContent/store.jsp @ 1466:194886c8647e

local commit
author Liza Sakellari <esakellari@di.uoa.gr>
date Thu Jan 15 18:54:03 2015 +0200 (2015-01-15)
parents 355ab4e7cf59
children 845e3fbd310e
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 <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>
30 <!-- jQuery start -->
31 <link type="text/css" href="style-menu.css" rel="stylesheet" />
32 <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
33 <script type="text/javascript" src="js/jquery-ui-1.8.23.custom.min.js"></script>
34 <script type="text/javascript">
35 $(function(){
36 // Accordion
37 $("#accordion").accordion({
38 header: "h3",
39 fillSpace: true,
40 navigation: true,
41 collapsible: true
42 });
43 //hover states on the static widgets
44 $('#dialog_link, ul#icons li').hover(
45 function() { $(this).addClass('ui-state-hover'); },
46 function() { $(this).removeClass('ui-state-hover'); }
47 );
48 });
49 </script>
50 <style type="text/css">
51 /*demo page css*/
52 body{ font: 90% "Trebuchet MS", sans-serif; margin: 50px;}
53 .container { height:410px; width:165px;}
54 .demoHeaders { margin-top: 1em;}
55 #dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
56 #dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
57 ul#icons {margin: 0; padding: 0;}
58 ul#icons li {margin: 1px; position: relative; padding: 1px 0; cursor: pointer; float: left; list-style: none;}
59 ul#icons span.ui-icon {float: left; margin: 0 1px;}
60 </style>
61 <title>TELEIOS: Strabon Endpoint</title>
62 </head>
63 <body topmargin="0" leftmargin="0" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
65 <!-- include TELEIOS header and description -->
66 <jsp:include page="teleios-header.html"/>
67 <!-- include TELEIOS header and description -->
69 <FORM method=POST enctype="UTF-8" accept-charset="UTF-8" action="Store">
70 <INPUT type=hidden name="view" value="HTML"/>
72 <TABLE border="0" width="100%">
73 <TR>
74 <td width="90" valign="top">
75 <table border="0" cellspacing="0" cellpadding="0" width="165">
76 <tr><td id="twidth">
77 <div class="container">
78 <div id="accordion">
79 <%
80 StrabonBeanWrapper strabonWrapper;
81 ServletContext context;
82 context = getServletContext();
83 WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(context);
84 strabonWrapper=(StrabonBeanWrapper) applicationContext.getBean("strabonBean");
85 Iterator <StrabonBeanWrapperConfiguration> entryListIterator = strabonWrapper.getEntries().iterator();
86 boolean first = true;
87 String hash = "";
88 while(entryListIterator.hasNext())
89 {
90 StrabonBeanWrapperConfiguration entry = entryListIterator.next();
92 if (entry.isHeader()) {
93 if (!first) {
94 %>
95 </div></div>
96 <%
97 } else {
98 first = false;
99 }
101 String label=entry.getLabel();
102 String style = "", href = "";
103 hash = new Integer(Math.abs(label.hashCode())).toString();
104 href="href=\"#"+hash+"\"";
105 %>
106 <div><h3><a <%=style%> <%=href%>><%=label%></a></h3><div>
107 <%
108 } else if (entry.isBean()) {
109 String label=entry.getLabel();
110 String bean=entry.getBean();
111 if(bean.equals("browse.jsp") || bean.equals("ChangeConnection"))
112 continue;
113 String style = "", href = "";
114 hash = new Integer(Math.abs(label.hashCode()*bean.hashCode())).toString();
115 href = "\"" +bean + "#"+ hash+"\"";
116 style = "class=\"navText\"";
117 %>
118 <b>&middot;</b>&nbsp;<a class="linkText" href=<%=href%>><%=label%></a><br/>
119 <%
120 } else {
121 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)+"\"";
122 String title="\""+entry.getTitle()+"\"";
123 String label=entry.getLabel();
124 %>
125 <b>&middot;</b>&nbsp;<a class="linkText" href=<%=href%> title=<%=title%>><%=label%></a><br/>
126 <%
128 }
129 }
130 %>
131 </div>
132 </div>
133 </td>
134 </tr>
135 <!--
136 <tr><td width="90" class="style4"><a href="describe.jsp" class="navText">Describe</a></td></tr>
137 <tr><td width="90" class="style4"><a href="store.jsp" class="navText" title="Store triples">Store</a></td></tr>
138 -->
139 </table>
140 </td>
141 <td width="*" valign="top">
142 <TABLE cellspacing="5">
144 <% if (request.getAttribute("error") != null) {%>
145 <!-- Error Message -->
146 <TR><TD colspan=2>
147 <CENTER><P style="color: red;"><%=request.getAttribute("error") %></P></CENTER>
148 </TD></TR>
149 <!-- Error Message -->
150 <%}%>
152 <%if (request.getAttribute("info") != null) { %>
153 <!-- Info Message -->
154 <TR><TD colspan=2>
155 <CENTER><P><%=request.getAttribute("info") %></P></CENTER>
156 </TD></TR>
157 <!-- Info Message -->
158 <%}%>
159 <tr>
160 <td colspan=2 id="output">
161 <div style="font-size:13px">
162 You must be logged in to store.
163 </div>
164 </td>
165 </tr>
166 <tr>
167 <!-- direct input form -->
168 <td id="output" style="width: 150px">Graph:</td>
169 <td id="output">
170 <textarea name="graph" title="URI of the named graph to store the input" rows="1" cols="100"></textarea>
171 </td>
172 </tr>
173 <tr>
174 <td id="output">RDF Format:</td>
175 <td id="output">
176 <SELECT name="format" title="select one of the following RDF graph format types">
177 <% for (String format : Common.registeredFormats) {%>
178 <OPTION value="<%=format%>"><%=format%></OPTION>
179 <%}%>
180 </SELECT>
181 </td>
182 </tr>
183 <tr>
184 <td id="output">Inference:</td>
185 <td id="output">
186 <input type="checkbox" title="Enable Inference" name="inference" value="true"> <br>
187 </td>
188 </tr>
189 <tr>
190 <!-- direct input form -->
191 <td id="output">Direct Input:</td>
192 <td id="output">
193 <textarea name="data" rows="15" cols="100"></textarea></td>
194 </tr>
195 <tr>
196 <td colspan=2 id="output"><br/>
197 <CENTER>
198 <input type="submit" value="Store Input" name="dsubmit" style="width: 350px"/>
199 </CENTER><br/>
200 </td>
201 </tr>
203 <tr>
204 <td id="output" >URI Input:</td>
205 <td id="output">
206 <textarea name="url" rows="1" cols="100"></textarea>
207 </td>
208 </tr>
210 <tr>
211 <td colspan=2 id="output"><br/>
212 <CENTER>
213 <INPUT type="submit" value="Store from URI" name="fromurl" style="width: 350px"/>
214 </CENTER><br/>
215 </td>
216 </tr>
218 </TABLE>
219 </td>
220 </tr>
221 </TABLE>
222 </FORM>
223 </BODY>
224 </HTML>