Project

General

Profile

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