Project

General

Profile

1
<?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
<jsp:directive.include file="settings.jsp" />
18

    
19
<html xmlns="http://www.w3.org/1999/xhtml">
20
<head>
21

    
22
	<jsp:element name="script">
23
		<jsp:attribute name="language">JavaScript</jsp:attribute>
24
		<jsp:attribute name="src">
25
			<jsp:expression>CONTEXT_URL + "/style/skins/saeon/searchPathQuery.js"</jsp:expression>
26
		</jsp:attribute>
27
	</jsp:element>
28
	<script type="text/javascript" language="JavaScript">
29
		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
	<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>CONTEXT_URL + "/style/skins/saeon/saeon.css"</jsp:expression>
67
		</jsp:attribute>
68
	</jsp:element>
69
</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
			request.getSession().setAttribute("clientViewHelper", clientViewHelper);
79
        </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
	<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
			<jsp:expression>SERVLET_URL</jsp:expression>
175
		</jsp:attribute>
176
		<jsp:attribute name="target">_top</jsp:attribute>
177
		<jsp:attribute name="onsubmit">setQueryFormField()</jsp:attribute>
178
		<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
		<br/>
208
		<input type="checkbox" id="searchAll" name="searchAll" />Search all fields (slower)
209
		<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
	</jsp:element>
216
	
217
	</td>
218
	<td width="250px">
219
	
220
	<!-- Login section -->
221
	<jsp:scriptlet>
222
		if (!clientViewHelper.isLoggedIn()) {
223
	</jsp:scriptlet>
224
	
225
	<dl class="portlet" id="portlet-login" style="width: 100%;">
226
		<dt class="portletHeader">
227
			Log in
228
		</dt>
229
		<dd class="portletItem odd">
230
			<form name="loginForm" method="post" action="./"
231
				onsubmit="return allowSubmit(this);">
232
				<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
			<jsp:element name="a">
270
				<jsp:attribute name="target">_new</jsp:attribute>
271
				<jsp:attribute name="href">
272
					<!--<jsp:expression>CGI_URL + "/ldapweb.cgi?cfg=saeon"</jsp:expression>-->
273
					<jsp:expression>KNB_SITE_URL + "/cgi-bin/ldapweb.cgi?cfg=saeon"</jsp:expression>
274
				</jsp:attribute>
275
				<jsp:element name="img">
276
					<jsp:attribute name="src">
277
						<jsp:expression>CONTEXT_URL + "/style/skins/saeon/images/user.gif"</jsp:expression>
278
					</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
				New user?
285
			</jsp:element>
286
		</dd>
287
	</dl>
288
	
289
	<jsp:scriptlet>
290
		} else {
291
	</jsp:scriptlet>
292
	
293
	<dl class="portlet" id="portlet-login" style="width: 100%;">
294
		<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
					<td>
307
						<!-- <a target='_top' href='./index.jsp?action=Logout&amp;qformat=saeon'> Logout </a> -->
308
					</td>
309
				</tr>
310
				<!-- 
311
				<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
				-->
319
			</table>
320
		</dd>
321
		<dd class="portletItem even">
322
			<jsp:element name="a">
323
				<jsp:attribute name="target">_top</jsp:attribute>
324
				<jsp:attribute name="href">
325
					<jsp:expression>CONTEXT_URL + "/style/skins/saeon/index.jsp?action=Logout&amp;qformat=saeon"</jsp:expression>
326
				</jsp:attribute>
327
				<jsp:element name="img">
328
					<jsp:attribute name="src">
329
						<jsp:expression>CONTEXT_URL + "/style/skins/saeon/images/user.gif"</jsp:expression>
330
					</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
				logout
337
			</jsp:element>
338
		</dd>
339
		<dd class="portletItem">
340
			<jsp:element name="a">
341
				<jsp:attribute name="target">_parent</jsp:attribute>
342
				<jsp:attribute name="href">
343
					<jsp:expression>CGI_URL + "/ldapweb.cgi?cfg=saeon&amp;stage=resetpass"</jsp:expression>
344
				</jsp:attribute>
345
				<jsp:element name="img">
346
					<jsp:attribute name="src">
347
						<jsp:expression>CONTEXT_URL + "/style/skins/saeon/images/user.gif"</jsp:expression>
348
					</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
				reset your password
355
			</jsp:element>
356
		</dd>
357
		<dd class="portletItem even">
358
			<jsp:element name="a">
359
				<jsp:attribute name="target">_parent</jsp:attribute>
360
				<jsp:attribute name="href">
361
					<jsp:expression>CGI_URL + "/ldapweb.cgi?cfg=saeon&amp;stage=changepass"</jsp:expression>
362
				</jsp:attribute>
363
				<jsp:element name="img">
364
					<jsp:attribute name="src">
365
						<jsp:expression>CONTEXT_URL + "/style/skins/saeon/images/user.gif"</jsp:expression>
366
					</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
				change your password
373
			</jsp:element>
374
		</dd>
375
	</dl>		
376
	<jsp:scriptlet>
377
		}
378
	</jsp:scriptlet> 
379
	
380
	<!-- File Upload Form --> 
381
	<br />
382
	<dl class="portlet" id="portlet-login" style="width: 100%;">
383
		<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
			<table>
391
				<tr valign="top">
392
					<td align="right">
393
						<jsp:element name="form">
394
							<jsp:attribute name="method">post</jsp:attribute>
395
							<jsp:attribute name="action">
396
								<jsp:expression>CONTEXT_URL + "/style/skins/saeon/upload.jsp"</jsp:expression>
397
							</jsp:attribute>
398
							<input type="submit" value="Go >" class="button_login" />
399
						</jsp:element>
400
					</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
            insertMap("<jsp:expression>CONTEXT_URL</jsp:expression>");
434
        </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>
(3-3/20)