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
<html xmlns="http://www.w3.org/1999/xhtml">
18
<head>
19

    
20
	<script type="text/javascript">
21
                
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
    </script>
53

    
54
	<title>SANParks - South African National Park Data Repository</title>
55
	<link href="sanparks.css" rel="stylesheet" type="text/css" />
56

    
57
</head>
58
	
59
<body>
60
<!-- <body style="background: #FFFFFF;">-->
61
	<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

    
69
	<table>
70
	<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
	<tr valign="top">
80
	<td>
81
	
82
	<h2>Search for SANParks Data</h2>
83
	
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
			<!-- 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
		<jsp:scriptlet>
138
			}
139
			else {
140
		</jsp:scriptlet>
141
			All Organizations	
142
		<jsp:scriptlet>
143
			}
144
		</jsp:scriptlet>
145
	</p>
146
	
147
	<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
		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
		</p>
165
			<input name="anyfield" value="" type="text" size="14" />
166
			<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
			<input name="action" value="query" type="hidden" />  
174
			<input value="Search" type="submit" /> 
175
		
176
	</form>
177
	<p class="regtext">
178
	-Or-
179
	</p>
180
	<form name="browseform" method="post" action="../../../metacat"
181
		target="_top">
182
		<jsp:include page="SimpleSearchMetacatPostFields.html" /> 
183
		<input name="anyfield" type="hidden" value="%" />
184
		<jsp:element name="input">
185
			<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
			<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
		<input name="action" value="query" type="hidden" />
202
		<input value="Browse All" type="submit" />
203
	</form>
204

    
205
	</td>
206
	<td>
207
	
208
	<!-- Login section -->
209
	<jsp:scriptlet>
210
		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
	<form name="loginForm" method="post" action="./"
221
		onsubmit="return allowSubmit(this)">
222
		<input name="qformat" type="hidden" value="sanparks" />
223
	<table>
224
		<tr valign="top">
225
			<td>
226
				<span class="required">User name</span>	
227
			</td>
228
			<td>
229
				<input name="username" type="text" value=""
230
				style="width: 140" />
231
			</td>
232
		</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
			<td colspan="2" align="center">
249
				<input name="action"
250
				value="Login" type="submit" class="button_login" />
251
			</td>
252
		</tr>
253
	</table>
254
	</form>
255
	
256
	<jsp:scriptlet>
257
		} else {
258
	</jsp:scriptlet>
259
	<h3>
260
		Welcome,
261
		<jsp:expression>clientViewBean.getUsername()</jsp:expression>  
262
	</h3>
263
	<form name="logoutForm" method="post" action="./">
264
	<input name="qformat" value="sanparks" type="hidden" />
265
	<table>
266
		<tr valign="top">
267
			<td>
268
				<p class="regtext">
269
					You are currently logged in.
270
				</p>
271
			</td>
272
			<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
				<!-- 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
				|
294
				<!-- TODO: Config param follows --> 
295
				<a
296
					href="HOSTNAME_HERE/cgiScripts/cgi-bin/ldapweb.cgi?stage=changepass"
297
					target="_parent">change your password</a>
298
			</td>
299
		</tr>
300
	</table>
301
	</form>
302
	<jsp:scriptlet>
303
		}
304
	</jsp:scriptlet> 
305
	
306
	<!-- File Upload Form --> 
307
	<br />
308
	<h3>Data Package Upload</h3>
309
	
310
	<jsp:scriptlet>
311
		if (clientViewHelper.isLoggedIn()) {
312
	</jsp:scriptlet>
313
	<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
	<jsp:scriptlet>
323
		} 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
	<jsp:scriptlet>
330
		}
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
	<td colspan="2" align="center">
342
	
343
	
344
	<!-- Map here --> 
345
	<br />
346
	<h3>Spatial Search</h3>
347
	
348
		<!-- map frame -->
349
        <script language="JavaScript">
350
            insertMap();
351
        </script>
352
	</td>
353
	
354
	<!-- so the map frame doesn't overlap content -->
355
	<td width="50px"></td>
356
	
357
	</tr>
358
	
359
	</table>
360
	
361
	</div>
362
</body>
363
</html>
364
</jsp:root>
(2-2/17)