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 3462 leinfelder
	<script language="JavaScript" type="text/JavaScript" src="./searchPathQuery.js"/>
21 3405 leinfelder
	<script type="text/javascript">
22 3404 leinfelder
		function trim(stringToTrim) {
23
			return(stringToTrim.replace(/^\s+|\s+$/g,""));
24
		}
25 3491 leinfelder
26
		function isEmpty(aTextField) {
27
			var value = trim(aTextField.value);
28
			var result = ((value.length == 0) || (value == null));
29
			return(result);
30
		}
31
32
		function allowSubmit(formObj) {
33
			var     result = true;
34
			var     action = "";
35
36
		    action = trim(formObj.elements["action"].value);
37
		    if (action == "Login") {
38
		        if (isEmpty(formObj.elements["username"])) {
39
		            result = false;
40
		            alert("User name is required");
41
		        } else if (isEmpty(formObj.elements["organization"])) {
42
		            result = false;
43
		            alert("Organization is required");
44
		        } else if (isEmpty(formObj.elements["password"])) {
45
		            result = false;
46
		            alert("Password is required");
47
		        }
48
		    }
49
50
			return(result);
51
		}
52
	</script>
53 3405 leinfelder
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 3462 leinfelder
				organizationScope = "";
89 3426 leinfelder
			}
90 3462 leinfelder
			if (!organizationScope.equals("")) {
91 3426 leinfelder
		</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 3462 leinfelder
	<form id="searchform" name="searchform" method="post" action="../../../metacat"
148
		target="_top"
149
		onsubmit="setQueryFormField()">
150 3414 leinfelder
		<p class="regtext">
151 3415 leinfelder
		The repository search system is used to locate data sets of interest by
152
		searching through existing registered data sets.
153
		Presently the search covers all fields, including author, title, abstract,
154
		keywords, and other documentation for each data set.
155
		<br />
156
		Use a '%' symbol as a wildcard in searches (e.g., '%herbivore%'
157
		would locate any phrase with the word herbivore embedded within it).
158 3414 leinfelder
		</p>
159
		<jsp:element name="input">
160 3462 leinfelder
			<jsp:attribute name="name">organizationScope</jsp:attribute>
161
			<jsp:attribute name="id">organizationScope</jsp:attribute>
162 3459 leinfelder
			<jsp:attribute name="type">hidden</jsp:attribute>
163
			<jsp:attribute name="value">
164
				<jsp:expression>organizationScope</jsp:expression>
165
			</jsp:attribute>
166
		</jsp:element>
167
		<jsp:element name="input">
168 3414 leinfelder
			<jsp:attribute name="name">sessionid</jsp:attribute>
169
			<jsp:attribute name="type">hidden</jsp:attribute>
170
			<jsp:attribute name="value">
171
				<jsp:getProperty name="clientViewBean" property="sessionid" />
172
			</jsp:attribute>
173
		</jsp:element>
174 3462 leinfelder
		<input type="text" id="anyfield" name="anyfield" value="" size="14" />
175
		<input type="hidden" id="query" name="query"  />
176
		<input type="hidden" name="qformat" value="sanparks"/>
177
		<input type="hidden" name="action" value="squery" />
178
		<input type="submit" value="Search"  />
179 3414 leinfelder
		<p class="regtext">
180 3462 leinfelder
		-Or-
181
		<br />
182 3414 leinfelder
		Browse all existing data sets by title. This operation can be slow.
183
		</p>
184 3462 leinfelder
		<input type="button" value="Browse All" onclick="setBrowseAll();form.submit()" />
185 3405 leinfelder
	</form>
186 3462 leinfelder
187 3414 leinfelder
	</td>
188
	<td>
189
190
	<!-- Login section -->
191 3405 leinfelder
	<jsp:scriptlet>
192 3414 leinfelder
		if (!clientViewHelper.isLoggedIn()) {
193
	</jsp:scriptlet>
194
195
	<h3>
196
		Login
197
		<!-- TODO: Config param follows -->
198
		<a href="HOSTNAME_HERE/cgiScripts/cgi-bin/ldapweb.cgi" target="_parent">
199
			<span class="regtext"> (request an account...)</span>
200
		</a>
201
	</h3>
202 3428 leinfelder
	<form name="loginForm" method="post" action="./"
203 3414 leinfelder
		onsubmit="return allowSubmit(this)">
204
		<input name="qformat" type="hidden" value="sanparks" />
205 3405 leinfelder
	<table>
206 3414 leinfelder
		<tr valign="top">
207
			<td>
208
				<span class="required">User name</span>
209 3405 leinfelder
			</td>
210 3414 leinfelder
			<td>
211
				<input name="username" type="text" value=""
212
				style="width: 140" />
213
			</td>
214 3405 leinfelder
		</tr>
215
		<tr>
216
			<td><span class="required">Organization</span></td>
217
			<td><select name="organization" style="width: 140">
218
				<option value="SANParks" selected="">SANParks</option>
219
				<option value="SAEON">SAEON</option>
220
				<option value="NCEAS">NCEAS</option>
221
				<option value="unaffiliated">unaffiliated</option>
222
			</select></td>
223
		</tr>
224
		<tr>
225
			<td><span class="required">Password</span></td>
226
			<td><input name="password" value="" type="password"
227
				style="width: 140" maxlength="50" /></td>
228
		</tr>
229
		<tr>
230 3414 leinfelder
			<td colspan="2" align="center">
231
				<input name="action"
232
				value="Login" type="submit" class="button_login" />
233
			</td>
234 3405 leinfelder
		</tr>
235
	</table>
236
	</form>
237 3414 leinfelder
238 3405 leinfelder
	<jsp:scriptlet>
239 3414 leinfelder
		} else {
240
	</jsp:scriptlet>
241 3416 leinfelder
	<h3>
242
		Welcome,
243
		<jsp:expression>clientViewBean.getUsername()</jsp:expression>
244
	</h3>
245 3428 leinfelder
	<form name="logoutForm" method="post" action="./">
246 3405 leinfelder
	<input name="qformat" value="sanparks" type="hidden" />
247
	<table>
248 3416 leinfelder
		<tr valign="top">
249 3405 leinfelder
			<td>
250 3416 leinfelder
				<p class="regtext">
251
					You are currently logged in.
252
				</p>
253 3405 leinfelder
			</td>
254 3416 leinfelder
			<td align="right">
255
				<input name="action" type="submit" value="Logout" class="button_login" />
256
			</td>
257
		</tr>
258
		<tr valign="top">
259
			<td colspan="2">
260
				<p class="regtext">
261
					(<jsp:expression>clientViewBean.getMessage(ClientView.LOGIN_MESSAGE)</jsp:expression>)
262
				</p>
263
			</td>
264
		</tr>
265
		<tr>
266
			<td colspan="2"
267
				class="regtext"
268
				align="center"
269
				valign="top">
270
271 3414 leinfelder
				<!-- TODO: Config param follows -->
272
				<a
273
					href="HOSTNAME_HERE/cgiScripts/cgi-bin/ldapweb.cgi?stage=resetpass"
274
					target="_parent">reset your password</a>
275 3416 leinfelder
				|
276
				<!-- TODO: Config param follows -->
277
				<a
278 3414 leinfelder
					href="HOSTNAME_HERE/cgiScripts/cgi-bin/ldapweb.cgi?stage=changepass"
279
					target="_parent">change your password</a>
280 3405 leinfelder
			</td>
281
		</tr>
282
	</table>
283
	</form>
284
	<jsp:scriptlet>
285 3414 leinfelder
		}
286
	</jsp:scriptlet>
287
288
	<!-- File Upload Form -->
289
	<br />
290
	<h3>Data Package Upload</h3>
291
292 3405 leinfelder
	<jsp:scriptlet>
293 3414 leinfelder
		if (clientViewHelper.isLoggedIn()) {
294
	</jsp:scriptlet>
295 3431 leinfelder
	<table width="100%">
296
		<tr valign="top">
297
			<td align="right">
298
				<form action="./upload.jsp" method="post">
299
					<input name="action" type="submit" value="Go >" class="button_login" />
300
				</form>
301
			</td>
302
		</tr>
303
	</table>
304 3405 leinfelder
	<jsp:scriptlet>
305 3414 leinfelder
		} else {
306
	</jsp:scriptlet>
307
308
	<p class="regtext">
309
		You must be logged into your user account before uploading a data set.
310
	</p>
311 3405 leinfelder
	<jsp:scriptlet>
312 3414 leinfelder
		}
313
	</jsp:scriptlet>
314
315
	</td>
316
317
	<!-- so the map frame doesn't overlap content -->
318
	<td width="50px"></td>
319
320
	</tr>
321
322
	<tr>
323 3435 leinfelder
	<td colspan="2" align="center">
324 3431 leinfelder
325
326
	<!-- Map here -->
327
	<br />
328 3459 leinfelder
	<h3>Spatial Search</h3>
329 3431 leinfelder
330 3451 leinfelder
		<!-- map frame -->
331
        <script language="JavaScript">
332
            insertMap();
333
        </script>
334 3431 leinfelder
	</td>
335
336
	<!-- so the map frame doesn't overlap content -->
337
	<td width="50px"></td>
338
339 3414 leinfelder
	</tr>
340 3431 leinfelder
341 3414 leinfelder
	</table>
342
343 3405 leinfelder
	</div>
344 3414 leinfelder
</body>
345
</html>
346 3404 leinfelder
</jsp:root>