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