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 3414 leinfelder
<html xmlns="http://www.w3.org/1999/xhtml">
18
<head>
19 3405 leinfelder
20
	<script type="text/javascript">
21 3404 leinfelder
22
                function allowSubmit(formObj) {
23
                    var     result = true;
24
                    var     action = "";
25
26
                    action = trim(formObj.elements["action"].value);
27
                    if (action == "Login") {
28
                        if (isEmpty(formObj.elements["username"])) {
29
                            result = false;
30
                            alert("User name is required");
31
                        } else if (isEmpty(formObj.elements["organization"])) {
32
                            result = false;
33
                            alert("Organization is required");
34
                        } else if (isEmpty(formObj.elements["password"])) {
35
                            result = false;
36
                            alert("Password is required");
37
                        }
38
                    }
39
40
                    return(result);
41
                }
42
43
                function isEmpty(aTextField) {
44
                    var value = trim(aTextField.value);
45
                    var result = ((value.length == 0) || (value == null));
46
                    return(result);
47
                }
48
49
		function trim(stringToTrim) {
50
			return(stringToTrim.replace(/^\s+|\s+$/g,""));
51
		}
52 3405 leinfelder
    </script>
53
54 3414 leinfelder
	<title>SANParks - South African National Park Data Repository</title>
55 3405 leinfelder
	<link href="sanparks.css" rel="stylesheet" type="text/css" />
56
57 3414 leinfelder
</head>
58
59 3428 leinfelder
<body>
60
<!-- <body style="background: #FFFFFF;">-->
61 3414 leinfelder
	<div class="templatecontentareaclass">
62
		<jsp:useBean id="clientViewBean" scope="session" class="edu.ucsb.nceas.metacat.clientview.ClientView" />
63
		<jsp:setProperty name="clientViewBean" property="*" />
64
		<jsp:scriptlet>
65
			clientViewHelper = ClientViewHelper.clientViewHelperInstance(request);
66
			clientViewHelper.clientRequest(request, response);
67
        </jsp:scriptlet>
68 3405 leinfelder
69 3414 leinfelder
	<table>
70 3415 leinfelder
	<tr>
71
		<td colspan="3">
72
			<p class="regtext">
73
			Welcome to the SANParks Data Repository.
74
			This is the primary source for comprehensive information about scientific
75
			and research data sets collected throughout the South African National Park System.
76
			</p>
77
		</td>
78
	</tr>
79 3414 leinfelder
	<tr valign="top">
80
	<td>
81
82
	<h2>Search for SANParks Data</h2>
83 3426 leinfelder
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 3459 leinfelder
			<!-- 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
101
					//check if the dropdown is loaded in DOM
102
					if (mapFrameDocument.getElementsByName('locations').length == 0) {
103
						dropDownTimer = setTimeout("setMapLocation('" + strLocation + "')", 100);
104
						return false;
105
					}
106
					clearTimeout(dropDownTimer);
107
108
					var locationMenu = mapFrameDocument.getElementsByName('locations')[0];
109
					//alert("locationMenu=" + locationMenu);
110
					var locationOptions = locationMenu.options;
111
					//alert("locationOptions=" + locationOptions);
112
					//loop through the options to find the correct location based on input string
113
					for (var i=0; i &lt; locationOptions.length; i++) {
114
						if (locationOptions[i].text == strLocation) {
115
							//set as selected
116
							locationMenu.selectedIndex = i;
117
							break;
118
						}
119
					}
120
					//alert("Focusing on selected location: " + locationMenu.options[locationMenu.selectedIndex].text);
121
122
					//the onchange command from select object
123
					locationMenu.onchange();
124
					//mapFrameDocument.config.objects.locationsSelect.setAoi(locationMenu.options[locationMenu.selectedIndex].value,'mainMap');
125
126
				}
127
128
				//kick it off
129
				dropDownTimer =
130
					setTimeout(
131
					"setMapLocation('<jsp:expression>organizationScope</jsp:expression>')",
132
					 100);
133
134
			</script>
135
136
			<jsp:expression>organizationScope</jsp:expression>
137 3426 leinfelder
		<jsp:scriptlet>
138
			}
139
			else {
140
		</jsp:scriptlet>
141
			All Organizations
142
		<jsp:scriptlet>
143
			}
144
		</jsp:scriptlet>
145
	</p>
146
147 3414 leinfelder
	<form name="searchform" method="post" action="../../../metacat" target="_top">
148
		<jsp:include page="SimpleSearchMetacatPostFields.html" />
149
		<jsp:element name="input">
150
			<jsp:attribute name="name">sessionid</jsp:attribute>
151
			<jsp:attribute name="type">hidden</jsp:attribute>
152
			<jsp:attribute name="value">
153
				<jsp:getProperty name="clientViewBean" property="sessionid" />
154
			</jsp:attribute>
155
		</jsp:element>
156
		<p class="regtext">
157 3415 leinfelder
		The repository search system is used to locate data sets of interest by
158
		searching through existing registered data sets.
159
		Presently the search covers all fields, including author, title, abstract,
160
		keywords, and other documentation for each data set.
161
		<br />
162
		Use a '%' symbol as a wildcard in searches (e.g., '%herbivore%'
163
		would locate any phrase with the word herbivore embedded within it).
164 3414 leinfelder
		</p>
165 3419 leinfelder
			<input name="anyfield" value="" type="text" size="14" />
166 3459 leinfelder
			<jsp:element name="input">
167
				<jsp:attribute name="name">placekey</jsp:attribute>
168
				<jsp:attribute name="type">hidden</jsp:attribute>
169
				<jsp:attribute name="value">
170
					<jsp:expression>organizationScope</jsp:expression>
171
				</jsp:attribute>
172
			</jsp:element>
173 3419 leinfelder
			<input name="action" value="query" type="hidden" />
174 3431 leinfelder
			<input value="Search" type="submit" />
175 3414 leinfelder
176
	</form>
177
	<p class="regtext">
178
	-Or-
179 3405 leinfelder
	</p>
180
	<form name="browseform" method="post" action="../../../metacat"
181 3414 leinfelder
		target="_top">
182
		<jsp:include page="SimpleSearchMetacatPostFields.html" />
183 3459 leinfelder
		<input name="anyfield" type="hidden" value="%" />
184 3414 leinfelder
		<jsp:element name="input">
185 3459 leinfelder
			<jsp:attribute name="name">placekey</jsp:attribute>
186
			<jsp:attribute name="type">hidden</jsp:attribute>
187
			<jsp:attribute name="value">
188
				<jsp:expression>organizationScope</jsp:expression>
189
			</jsp:attribute>
190
		</jsp:element>
191
		<jsp:element name="input">
192 3414 leinfelder
			<jsp:attribute name="name">sessionid</jsp:attribute>
193
			<jsp:attribute name="type">hidden</jsp:attribute>
194
			<jsp:attribute name="value">
195
				<jsp:getProperty name="clientViewBean" property="sessionid" />
196
			</jsp:attribute>
197
		</jsp:element>
198
		<p class="regtext">
199
		Browse all existing data sets by title. This operation can be slow.
200
		</p>
201 3419 leinfelder
		<input name="action" value="query" type="hidden" />
202 3431 leinfelder
		<input value="Browse All" type="submit" />
203 3405 leinfelder
	</form>
204
205 3414 leinfelder
	</td>
206
	<td>
207
208
	<!-- Login section -->
209 3405 leinfelder
	<jsp:scriptlet>
210 3414 leinfelder
		if (!clientViewHelper.isLoggedIn()) {
211
	</jsp:scriptlet>
212
213
	<h3>
214
		Login
215
		<!-- TODO: Config param follows -->
216
		<a href="HOSTNAME_HERE/cgiScripts/cgi-bin/ldapweb.cgi" target="_parent">
217
			<span class="regtext"> (request an account...)</span>
218
		</a>
219
	</h3>
220 3428 leinfelder
	<form name="loginForm" method="post" action="./"
221 3414 leinfelder
		onsubmit="return allowSubmit(this)">
222
		<input name="qformat" type="hidden" value="sanparks" />
223 3405 leinfelder
	<table>
224 3414 leinfelder
		<tr valign="top">
225
			<td>
226
				<span class="required">User name</span>
227 3405 leinfelder
			</td>
228 3414 leinfelder
			<td>
229
				<input name="username" type="text" value=""
230
				style="width: 140" />
231
			</td>
232 3405 leinfelder
		</tr>
233
		<tr>
234
			<td><span class="required">Organization</span></td>
235
			<td><select name="organization" style="width: 140">
236
				<option value="SANParks" selected="">SANParks</option>
237
				<option value="SAEON">SAEON</option>
238
				<option value="NCEAS">NCEAS</option>
239
				<option value="unaffiliated">unaffiliated</option>
240
			</select></td>
241
		</tr>
242
		<tr>
243
			<td><span class="required">Password</span></td>
244
			<td><input name="password" value="" type="password"
245
				style="width: 140" maxlength="50" /></td>
246
		</tr>
247
		<tr>
248 3414 leinfelder
			<td colspan="2" align="center">
249
				<input name="action"
250
				value="Login" type="submit" class="button_login" />
251
			</td>
252 3405 leinfelder
		</tr>
253
	</table>
254
	</form>
255 3414 leinfelder
256 3405 leinfelder
	<jsp:scriptlet>
257 3414 leinfelder
		} else {
258
	</jsp:scriptlet>
259 3416 leinfelder
	<h3>
260
		Welcome,
261
		<jsp:expression>clientViewBean.getUsername()</jsp:expression>
262
	</h3>
263 3428 leinfelder
	<form name="logoutForm" method="post" action="./">
264 3405 leinfelder
	<input name="qformat" value="sanparks" type="hidden" />
265
	<table>
266 3416 leinfelder
		<tr valign="top">
267 3405 leinfelder
			<td>
268 3416 leinfelder
				<p class="regtext">
269
					You are currently logged in.
270
				</p>
271 3405 leinfelder
			</td>
272 3416 leinfelder
			<td align="right">
273
				<input name="action" type="submit" value="Logout" class="button_login" />
274
			</td>
275
		</tr>
276
		<tr valign="top">
277
			<td colspan="2">
278
				<p class="regtext">
279
					(<jsp:expression>clientViewBean.getMessage(ClientView.LOGIN_MESSAGE)</jsp:expression>)
280
				</p>
281
			</td>
282
		</tr>
283
		<tr>
284
			<td colspan="2"
285
				class="regtext"
286
				align="center"
287
				valign="top">
288
289 3414 leinfelder
				<!-- TODO: Config param follows -->
290
				<a
291
					href="HOSTNAME_HERE/cgiScripts/cgi-bin/ldapweb.cgi?stage=resetpass"
292
					target="_parent">reset your password</a>
293 3416 leinfelder
				|
294
				<!-- TODO: Config param follows -->
295
				<a
296 3414 leinfelder
					href="HOSTNAME_HERE/cgiScripts/cgi-bin/ldapweb.cgi?stage=changepass"
297
					target="_parent">change your password</a>
298 3405 leinfelder
			</td>
299
		</tr>
300
	</table>
301
	</form>
302
	<jsp:scriptlet>
303 3414 leinfelder
		}
304
	</jsp:scriptlet>
305
306
	<!-- File Upload Form -->
307
	<br />
308
	<h3>Data Package Upload</h3>
309
310 3405 leinfelder
	<jsp:scriptlet>
311 3414 leinfelder
		if (clientViewHelper.isLoggedIn()) {
312
	</jsp:scriptlet>
313 3431 leinfelder
	<table width="100%">
314
		<tr valign="top">
315
			<td align="right">
316
				<form action="./upload.jsp" method="post">
317
					<input name="action" type="submit" value="Go >" class="button_login" />
318
				</form>
319
			</td>
320
		</tr>
321
	</table>
322 3405 leinfelder
	<jsp:scriptlet>
323 3414 leinfelder
		} else {
324
	</jsp:scriptlet>
325
326
	<p class="regtext">
327
		You must be logged into your user account before uploading a data set.
328
	</p>
329 3405 leinfelder
	<jsp:scriptlet>
330 3414 leinfelder
		}
331
	</jsp:scriptlet>
332
333
	</td>
334
335
	<!-- so the map frame doesn't overlap content -->
336
	<td width="50px"></td>
337
338
	</tr>
339
340
	<tr>
341 3435 leinfelder
	<td colspan="2" align="center">
342 3431 leinfelder
343
344
	<!-- Map here -->
345
	<br />
346 3459 leinfelder
	<h3>Spatial Search</h3>
347 3431 leinfelder
348 3451 leinfelder
		<!-- map frame -->
349
        <script language="JavaScript">
350
            insertMap();
351
        </script>
352 3431 leinfelder
	</td>
353
354
	<!-- so the map frame doesn't overlap content -->
355
	<td width="50px"></td>
356
357 3414 leinfelder
	</tr>
358 3431 leinfelder
359 3414 leinfelder
	</table>
360
361 3405 leinfelder
	</div>
362 3414 leinfelder
</body>
363
</html>
364 3404 leinfelder
</jsp:root>