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
			<jsp:expression>SERVER_URL_WITH_CONTEXT + "/style/skins/saeon/searchPathQuery.js"</jsp:expression>
26
		</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
			<jsp:expression>SERVER_URL_WITH_CONTEXT + "/style/skins/saeon/saeon.css"</jsp:expression>
67
		</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
				<jsp:getProperty name="clientViewBean" property="sessionid" />
200
			</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
				<jsp:attribute name="target">_parent</jsp:attribute>
271
				<jsp:attribute name="href">
272 3780 daigle
					<jsp:expression>CGI_URL + "/ldapweb.cgi?cfg=saeon"</jsp:expression>
273 3739 leinfelder
				</jsp:attribute>
274
				<jsp:element name="img">
275
					<jsp:attribute name="src">
276
						<jsp:expression>SERVER_URL_WITH_CONTEXT + "/style/skins/saeon/images/user.gif"</jsp:expression>
277
					</jsp:attribute>
278
					<jsp:attribute name="alt">New User?</jsp:attribute>
279
					<jsp:attribute name="title">User</jsp:attribute>
280
					<jsp:attribute name="height">16</jsp:attribute>
281
					<jsp:attribute name="width">16</jsp:attribute>
282
				</jsp:element>
283 3640 leinfelder
				New user?
284 3739 leinfelder
			</jsp:element>
285 3640 leinfelder
		</dd>
286
	</dl>
287
288
	<jsp:scriptlet>
289
		} else {
290
	</jsp:scriptlet>
291
292 3648 leinfelder
	<dl class="portlet" id="portlet-login" style="width: 100%;">
293 3640 leinfelder
		<dt class="portletHeader">
294
			Welcome,
295
			<jsp:expression>clientViewBean.getUsername()</jsp:expression>
296
		</dt>
297
		<dd class="portletItem odd">
298
			<table>
299
				<tr valign="top">
300
					<td>
301
						<p class="regtext">
302
							You are currently logged in.
303
						</p>
304
					</td>
305 3648 leinfelder
					<td>
306
						<!-- <a target='_top' href='./index.jsp?action=Logout&amp;qformat=saeon'> Logout </a> -->
307 3640 leinfelder
					</td>
308
				</tr>
309 3648 leinfelder
				<!--
310 3640 leinfelder
				<tr valign="top">
311
					<td colspan="2">
312
						<p class="regtext">
313
							(<jsp:expression>clientViewBean.getMessage(ClientView.LOGIN_MESSAGE)</jsp:expression>)
314
						</p>
315
					</td>
316
				</tr>
317 3648 leinfelder
				-->
318 3640 leinfelder
			</table>
319
		</dd>
320
		<dd class="portletItem even">
321 3739 leinfelder
			<jsp:element name="a">
322
				<jsp:attribute name="target">_top</jsp:attribute>
323
				<jsp:attribute name="href">
324
					<jsp:expression>SERVER_URL_WITH_CONTEXT + "/style/skins/saeon/index.jsp?action=Logout&amp;qformat=saeon"</jsp:expression>
325
				</jsp:attribute>
326
				<jsp:element name="img">
327
					<jsp:attribute name="src">
328
						<jsp:expression>SERVER_URL_WITH_CONTEXT + "/style/skins/saeon/images/user.gif"</jsp:expression>
329
					</jsp:attribute>
330
					<jsp:attribute name="alt">logout</jsp:attribute>
331
					<jsp:attribute name="title">User</jsp:attribute>
332
					<jsp:attribute name="height">16</jsp:attribute>
333
					<jsp:attribute name="width">16</jsp:attribute>
334
				</jsp:element>
335 3648 leinfelder
				logout
336 3739 leinfelder
			</jsp:element>
337 3648 leinfelder
		</dd>
338
		<dd class="portletItem">
339 3739 leinfelder
			<jsp:element name="a">
340
				<jsp:attribute name="target">_parent</jsp:attribute>
341
				<jsp:attribute name="href">
342 3780 daigle
					<jsp:expression>CGI_URL + "/ldapweb.cgi?cfg=saeon&amp;stage=resetpass"</jsp:expression>
343 3739 leinfelder
				</jsp:attribute>
344
				<jsp:element name="img">
345
					<jsp:attribute name="src">
346
						<jsp:expression>SERVER_URL_WITH_CONTEXT + "/style/skins/saeon/images/user.gif"</jsp:expression>
347
					</jsp:attribute>
348
					<jsp:attribute name="alt">reset password</jsp:attribute>
349
					<jsp:attribute name="title">User</jsp:attribute>
350
					<jsp:attribute name="height">16</jsp:attribute>
351
					<jsp:attribute name="width">16</jsp:attribute>
352
				</jsp:element>
353 3640 leinfelder
				reset your password
354 3739 leinfelder
			</jsp:element>
355 3640 leinfelder
		</dd>
356 3648 leinfelder
		<dd class="portletItem even">
357 3739 leinfelder
			<jsp:element name="a">
358
				<jsp:attribute name="target">_parent</jsp:attribute>
359
				<jsp:attribute name="href">
360 3780 daigle
					<jsp:expression>CGI_URL + "/ldapweb.cgi?cfg=saeon&amp;stage=changepass"</jsp:expression>
361 3739 leinfelder
				</jsp:attribute>
362
				<jsp:element name="img">
363
					<jsp:attribute name="src">
364
						<jsp:expression>SERVER_URL_WITH_CONTEXT + "/style/skins/saeon/images/user.gif"</jsp:expression>
365
					</jsp:attribute>
366
					<jsp:attribute name="alt">change password</jsp:attribute>
367
					<jsp:attribute name="title">User</jsp:attribute>
368
					<jsp:attribute name="height">16</jsp:attribute>
369
					<jsp:attribute name="width">16</jsp:attribute>
370
				</jsp:element>
371 3640 leinfelder
				change your password
372 3739 leinfelder
			</jsp:element>
373 3640 leinfelder
		</dd>
374
	</dl>
375
	<jsp:scriptlet>
376
		}
377
	</jsp:scriptlet>
378
379
	<!-- File Upload Form -->
380
	<br />
381 3648 leinfelder
	<dl class="portlet" id="portlet-login" style="width: 100%;">
382 3640 leinfelder
		<dt class="portletHeader">
383
			Data Package Upload
384
		</dt>
385
		<dd class="portletItem odd">
386
			<jsp:scriptlet>
387
				if (clientViewHelper.isLoggedIn()) {
388
			</jsp:scriptlet>
389 3648 leinfelder
			<table>
390 3640 leinfelder
				<tr valign="top">
391
					<td align="right">
392 3739 leinfelder
						<jsp:element name="form">
393
							<jsp:attribute name="method">post</jsp:attribute>
394
							<jsp:attribute name="action">
395
								<jsp:expression>SERVER_URL_WITH_CONTEXT + "/style/skins/saeon/upload.jsp"</jsp:expression>
396
							</jsp:attribute>
397 3640 leinfelder
							<input type="submit" value="Go >" class="button_login" />
398 3739 leinfelder
						</jsp:element>
399 3640 leinfelder
					</td>
400
				</tr>
401
			</table>
402
			<jsp:scriptlet>
403
				} else {
404
			</jsp:scriptlet>
405
406
			<p class="regtext">
407
				You must be logged into your user account before uploading a data set.
408
			</p>
409
			<jsp:scriptlet>
410
				}
411
			</jsp:scriptlet>
412
413
		</dd>
414
	</dl>
415
416
	</td>
417
418
	<!-- so the map frame doesn't overlap content -->
419
	<td width="50px"></td>
420
421
	</tr>
422
423
	<tr>
424
	<td colspan="2" align="left">
425
426
	<!-- Map here -->
427
	<h2>Spatial Search</h2>
428
429
		<div style="padding-left: 100px">
430
		<!-- map frame -->
431
        <script language="JavaScript">
432 3739 leinfelder
            insertMap("<jsp:expression>SERVER_URL_WITH_CONTEXT</jsp:expression>");
433 3640 leinfelder
        </script>
434
        </div>
435
	</td>
436
437
	<!-- so the map frame doesn't overlap content -->
438
	<td width="50px"></td>
439
440
	</tr>
441
442
	</table>
443
444
	</div>
445
</body>
446
</html>
447
</jsp:root>