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