Project

General

Profile

1 3640 leinfelder
<?xml version="1.0" encoding="UTF-8"?>
2
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
3
4
	<!-- to change the content type or response encoding change the following line -->
5
	<jsp:directive.page contentType="text/html;charset=UTF-8" />
6
	<jsp:directive.page
7
		import="edu.ucsb.nceas.metacat.clientview.ClientView" />
8
	<jsp:directive.page
9
		import="edu.ucsb.nceas.metacat.clientview.ClientViewHelper" />
10
	<jsp:directive.page
11
		import="edu.ucsb.nceas.metacat.clientview.ClientHtmlHelper" />
12
13
	<jsp:declaration>
14
        private ClientViewHelper clientViewHelper = null;
15
    </jsp:declaration>
16
17
<html xmlns="http://www.w3.org/1999/xhtml">
18
<head>
19
20
	<script language="JavaScript" type="text/JavaScript" src="./searchPathQuery.js"/>
21
	<script type="text/javascript">
22
		function trim(stringToTrim) {
23
			return(stringToTrim.replace(/^\s+|\s+$/g,""));
24
		}
25
26
		function isEmpty(aTextField) {
27
			var value = trim(aTextField.value);
28
			var result = ((value.length == 0) || (value == null));
29
			return(result);
30
		}
31
32
		function allowSubmit(formObj) {
33
			var     result = true;
34
			var     action = "";
35
36
		    action = trim(formObj.elements["action"].value);
37
		    if (action == "Login") {
38
		        if (isEmpty(formObj.elements["username"])) {
39
		            result = false;
40
		            alert("User name is required");
41
		        } else if (isEmpty(formObj.elements["organization"])) {
42
		            result = false;
43
		            alert("Organization is required");
44
		        } else if (isEmpty(formObj.elements["password"])) {
45
		            result = false;
46
		            alert("Password is required");
47
		        }
48
		    }
49
50
			return(result);
51
		}
52
	</script>
53
54
	<title>SAEON - South African Environmental Observation Network Repository</title>
55
	<link href="saeon.css" rel="stylesheet" type="text/css" />
56
57
</head>
58
59
<body>
60
	<div class="templatecontentareaclass" style="background: #FFFFFF;">
61
		<jsp:useBean id="clientViewBean" scope="session" class="edu.ucsb.nceas.metacat.clientview.ClientView" />
62
		<jsp:setProperty name="clientViewBean" property="*" />
63
		<jsp:scriptlet>
64
			clientViewHelper = ClientViewHelper.clientViewHelperInstance(request);
65
			clientViewHelper.clientRequest(request, response);
66 3647 leinfelder
			request.getSession().setAttribute("clientViewHelper", clientViewHelper);
67 3640 leinfelder
        </jsp:scriptlet>
68
69
	<table>
70
	<tr>
71
		<td colspan="3">
72
			<p class="regtext">
73
			Welcome to the SAEON Data Repository.
74
			This is the primary source for comprehensive information about scientific
75
			and research data sets collected throughout the South African Environmental Observation Network.
76
			</p>
77
		</td>
78
	</tr>
79
	<tr valign="top">
80
	<td>
81
82
	<h2>Search for SAEON Data</h2>
83
84
	<p class="emphasis">Searching:
85
		<jsp:scriptlet>
86
			String organizationScope = request.getParameter("organizationScope");
87
			if (organizationScope == null) {
88
				organizationScope = "";
89
			}
90
			if (!organizationScope.equals("")) {
91
		</jsp:scriptlet>
92
			<!-- set the map to use the correct scope -->
93
			<script type="text/javascript" >
94
				var dropDownTimer = null;
95
96
				//this syncs the map based on the input string location
97
				function setMapLocation(strLocation) {
98
99
					var mapFrameDocument = document.getElementById("mapFrame").contentDocument;
100
					if (!mapFrameDocument) {
101
						//alert("IE");
102
						mapFrameDocument = document.getElementById("mapFrame").contentWindow;
103
						if (mapFrameDocument.document) {
104
							mapFrameDocument = mapFrameDocument.document;
105
						}
106
107
					}
108
					//alert("mapFrame=" + mapFrameDocument.name);
109
					//alert("locations=" + mapFrameDocument.getElementsByTagName('locations'));
110
111
					//check if the dropdown is loaded in DOM
112
					if (mapFrameDocument.getElementsByName('locations').length == 0) {
113
						dropDownTimer = setTimeout("setMapLocation('" + strLocation + "')", 100);
114
						return false;
115
					}
116
					clearTimeout(dropDownTimer);
117
118
					var locationMenu = mapFrameDocument.getElementsByName('locations')[0];
119
					//alert("locationMenu=" + locationMenu);
120
					var locationOptions = locationMenu.options;
121
					//alert("locationOptions=" + locationOptions);
122
					//loop through the options to find the correct location based on input string
123
					for (var i=0; i &lt; locationOptions.length; i++) {
124
						if (locationOptions[i].text == strLocation) {
125
							//set as selected
126
							locationMenu.selectedIndex = i;
127
							break;
128
						}
129
					}
130
					//alert("Focusing on selected location: " + locationMenu.options[locationMenu.selectedIndex].text);
131
132
					//the onchange command from select object
133
					locationMenu.onchange();
134
					//mapFrameDocument.config.objects.locationsSelect.setAoi(locationMenu.options[locationMenu.selectedIndex].value,'mainMap');
135
136
				}
137
138
				//kick it off
139
				dropDownTimer =
140
					setTimeout(
141
					"setMapLocation('<jsp:expression>organizationScope</jsp:expression>')",
142
					 100);
143
144
			</script>
145
146
			<jsp:expression>organizationScope</jsp:expression>
147
		<jsp:scriptlet>
148
			}
149
			else {
150
		</jsp:scriptlet>
151
			All Organizations
152
		<jsp:scriptlet>
153
			}
154
		</jsp:scriptlet>
155
	</p>
156
157
	<form id="searchform" name="searchform" method="post" action="../../../metacat"
158
		target="_top"
159
		onsubmit="setQueryFormField()">
160
		<p class="regtext">
161
		The repository search system is used to locate data sets of interest by
162
		searching through existing registered data sets.
163
		Presently the search covers all fields, including author, title, abstract,
164
		keywords, and other documentation for each data set.
165
		<br />
166
		Use a '%' symbol as a wildcard in searches (e.g., '%herbivore%'
167
		would locate any phrase with the word herbivore embedded within it).
168
		</p>
169
		<jsp:element name="input">
170
			<jsp:attribute name="name">organizationScope</jsp:attribute>
171
			<jsp:attribute name="id">organizationScope</jsp:attribute>
172
			<jsp:attribute name="type">hidden</jsp:attribute>
173
			<jsp:attribute name="value">
174
				<jsp:expression>organizationScope</jsp:expression>
175
			</jsp:attribute>
176
		</jsp:element>
177
		<jsp:element name="input">
178
			<jsp:attribute name="name">sessionid</jsp:attribute>
179
			<jsp:attribute name="type">hidden</jsp:attribute>
180
			<jsp:attribute name="value">
181
				<jsp:getProperty name="clientViewBean" property="sessionid" />
182
			</jsp:attribute>
183
		</jsp:element>
184
		<input type="text" id="anyfield" name="anyfield" value="" size="14" />
185
		<input type="hidden" id="query" name="query"  />
186
		<input type="hidden" name="qformat" value="saeon"/>
187
		<input type="hidden" name="action" value="squery" />
188
		<input type="submit" value="Search"  />
189
		<p class="regtext">
190
		-Or-
191
		<br />
192
		Browse all existing data sets by title. This operation can be slow.
193
		</p>
194
		<input type="button" value="Browse All" onclick="setBrowseAll();form.submit()" />
195
	</form>
196
197
	</td>
198 3648 leinfelder
	<td width="250px">
199 3640 leinfelder
200
	<!-- Login section -->
201
	<jsp:scriptlet>
202
		if (!clientViewHelper.isLoggedIn()) {
203
	</jsp:scriptlet>
204
205 3648 leinfelder
	<dl class="portlet" id="portlet-login" style="width: 100%;">
206 3640 leinfelder
		<dt class="portletHeader">
207 3644 leinfelder
			<!-- <a href="./login.jsp">Log in</a>-->
208
			Log in
209 3640 leinfelder
		</dt>
210
		<dd class="portletItem odd">
211
			<form name="loginForm" method="post" action="./"
212
				onsubmit="return allowSubmit(this)">
213
				<input name="qformat" type="hidden" value="saeon" />
214
				<table>
215
					<tr valign="top">
216
						<td>
217
							<span class="required">User name</span>
218
						</td>
219
						<td>
220
							<input name="username" type="text" value=""
221
							style="width: 140" />
222
						</td>
223
					</tr>
224
					<tr>
225
						<td><span class="required">Organization</span></td>
226
						<td><select name="organization" style="width: 140">
227
							<option value="SAEON" selected="selected">SAEON</option>
228
							<option value="SANParks">SANParks</option>
229
							<option value="NCEAS">NCEAS</option>
230
							<option value="unaffiliated">unaffiliated</option>
231
						</select></td>
232
					</tr>
233
					<tr>
234
						<td><span class="required">Password</span></td>
235
						<td><input name="password" value="" type="password"
236
							style="width: 140" maxlength="50" /></td>
237
					</tr>
238
					<tr>
239
						<td></td>
240
						<td colspan="1" align="right">
241
							<input name="action"
242
							value="Login" type="submit" class="button_login" />
243
						</td>
244
					</tr>
245
				</table>
246
			</form>
247
		</dd>
248
249
		<dd class="portletItem even">
250 3652 leinfelder
			<a href="@cgi-prefix@/ldapweb.cgi?cfg=saeon" target="_parent">
251 3640 leinfelder
				<img src="images/user.gif" alt="New user?"
252
				title="User"
253
				height="16"
254
				width="16" />
255
				New user?
256
			</a>
257
		</dd>
258
	</dl>
259
260
	<jsp:scriptlet>
261
		} else {
262
	</jsp:scriptlet>
263
264 3648 leinfelder
	<dl class="portlet" id="portlet-login" style="width: 100%;">
265 3640 leinfelder
		<dt class="portletHeader">
266
			Welcome,
267
			<jsp:expression>clientViewBean.getUsername()</jsp:expression>
268
		</dt>
269
		<dd class="portletItem odd">
270
			<table>
271
				<tr valign="top">
272
					<td>
273
						<p class="regtext">
274
							You are currently logged in.
275
						</p>
276
					</td>
277 3648 leinfelder
					<td>
278
						<!-- <a target='_top' href='./index.jsp?action=Logout&amp;qformat=saeon'> Logout </a> -->
279 3640 leinfelder
					</td>
280
				</tr>
281 3648 leinfelder
				<!--
282 3640 leinfelder
				<tr valign="top">
283
					<td colspan="2">
284
						<p class="regtext">
285
							(<jsp:expression>clientViewBean.getMessage(ClientView.LOGIN_MESSAGE)</jsp:expression>)
286
						</p>
287
					</td>
288
				</tr>
289 3648 leinfelder
				-->
290 3640 leinfelder
			</table>
291
		</dd>
292
		<dd class="portletItem even">
293 3648 leinfelder
			<a target='_top' href='./index.jsp?action=Logout&amp;qformat=saeon'>
294
				<img src="images/user.gif" alt="Logout"
295
				title="Logout"
296
				height="16"
297
				width="16" />
298
				logout
299
			</a>
300
		</dd>
301
		<dd class="portletItem">
302 3652 leinfelder
			<a href="@cgi-prefix@/ldapweb.cgi?cfg=saeon&amp;stage=resetpass" target="_parent">
303 3640 leinfelder
				<img src="images/user.gif" alt="New user?"
304
				title="User"
305
				height="16"
306
				width="16" />
307
				reset your password
308
			</a>
309
		</dd>
310 3648 leinfelder
		<dd class="portletItem even">
311 3652 leinfelder
			<a href="@cgi-prefix@/ldapweb.cgi?cfg=saeon&amp;stage=changepass" target="_parent">
312 3640 leinfelder
				<img src="images/user.gif" alt="New user?"
313
				title="User"
314
				height="16"
315
				width="16" />
316
				change your password
317
			</a>
318
		</dd>
319
	</dl>
320
	<jsp:scriptlet>
321
		}
322
	</jsp:scriptlet>
323
324
	<!-- File Upload Form -->
325
	<br />
326 3648 leinfelder
	<dl class="portlet" id="portlet-login" style="width: 100%;">
327 3640 leinfelder
		<dt class="portletHeader">
328
			Data Package Upload
329
		</dt>
330
		<dd class="portletItem odd">
331
			<jsp:scriptlet>
332
				if (clientViewHelper.isLoggedIn()) {
333
			</jsp:scriptlet>
334 3648 leinfelder
			<table>
335 3640 leinfelder
				<tr valign="top">
336
					<td align="right">
337
						<form action="./upload.jsp" method="post">
338
							<input type="submit" value="Go >" class="button_login" />
339
						</form>
340
					</td>
341
				</tr>
342
			</table>
343
			<jsp:scriptlet>
344
				} else {
345
			</jsp:scriptlet>
346
347
			<p class="regtext">
348
				You must be logged into your user account before uploading a data set.
349
			</p>
350
			<jsp:scriptlet>
351
				}
352
			</jsp:scriptlet>
353
354
		</dd>
355
	</dl>
356
357
	</td>
358
359
	<!-- so the map frame doesn't overlap content -->
360
	<td width="50px"></td>
361
362
	</tr>
363
364
	<tr>
365
	<td colspan="2" align="left">
366
367
	<!-- Map here -->
368
	<h2>Spatial Search</h2>
369
370
		<div style="padding-left: 100px">
371
		<!-- map frame -->
372
        <script language="JavaScript">
373
            insertMap();
374
        </script>
375
        </div>
376
	</td>
377
378
	<!-- so the map frame doesn't overlap content -->
379
	<td width="50px"></td>
380
381
	</tr>
382
383
	</table>
384
385
	</div>
386
</body>
387
</html>
388
</jsp:root>