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 language="JavaScript" type="text/JavaScript" src="./searchPathQuery.js"/>
21
	<script type="text/javascript">
22
		function trim(stringToTrim) {
23
			return(stringToTrim.replace(/^\s+|\s+$/g,""));
24
		}
25
		
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

    
54
	<title>SAEON - South African Environmental Observation Network Repository</title>
55
	<link href="saeon.css" rel="stylesheet" type="text/css" />
56

    
57
</head>
58
	
59
<body>
60
	<div class="templatecontentareaclass" style="background: #FFFFFF;">
61
		<jsp:useBean id="clientViewBean" scope="session" class="edu.ucsb.nceas.metacat.clientview.ClientView" /> 
62
		<jsp:setProperty name="clientViewBean" property="*" /> 
63
		<jsp:scriptlet>
64
			clientViewHelper = ClientViewHelper.clientViewHelperInstance(request);
65
			clientViewHelper.clientRequest(request, response);
66
			request.getSession().setAttribute("clientViewHelper", clientViewHelper);
67
        </jsp:scriptlet>
68

    
69
	<table>
70
	<tr>
71
		<td colspan="3">
72
			<p class="regtext">
73
			Welcome to the SAEON Data Repository. 
74
			This is the primary source for comprehensive information about scientific 
75
			and research data sets collected throughout the South African Environmental Observation Network.
76
			</p>
77
		</td>
78
	</tr>
79
	<tr valign="top">
80
	<td>
81
	
82
	<h2>Search for SAEON 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
					if (!mapFrameDocument) {
101
						//alert("IE");
102
						mapFrameDocument = document.getElementById("mapFrame").contentWindow;
103
						if (mapFrameDocument.document) {
104
							mapFrameDocument = mapFrameDocument.document;
105
						}
106
						
107
					}
108
					//alert("mapFrame=" + mapFrameDocument.name);
109
					//alert("locations=" + mapFrameDocument.getElementsByTagName('locations'));
110
					
111
					//check if the dropdown is loaded in DOM
112
					if (mapFrameDocument.getElementsByName('locations').length == 0) {
113
						dropDownTimer = setTimeout("setMapLocation('" + strLocation + "')", 100);
114
						return false;
115
					}
116
					clearTimeout(dropDownTimer);
117
					
118
					var locationMenu = mapFrameDocument.getElementsByName('locations')[0];
119
					//alert("locationMenu=" + locationMenu);
120
					var locationOptions = locationMenu.options;
121
					//alert("locationOptions=" + locationOptions);
122
					//loop through the options to find the correct location based on input string
123
					for (var i=0; i &lt; locationOptions.length; i++) {
124
						if (locationOptions[i].text == strLocation) {
125
							//set as selected
126
							locationMenu.selectedIndex = i;
127
							break;
128
						}
129
					}
130
					//alert("Focusing on selected location: " + locationMenu.options[locationMenu.selectedIndex].text);
131
					
132
					//the onchange command from select object
133
					locationMenu.onchange();
134
					//mapFrameDocument.config.objects.locationsSelect.setAoi(locationMenu.options[locationMenu.selectedIndex].value,'mainMap');
135
				
136
				}
137
				
138
				//kick it off
139
				dropDownTimer = 
140
					setTimeout(
141
					"setMapLocation('<jsp:expression>organizationScope</jsp:expression>')",
142
					 100);
143
				
144
			</script>
145
			
146
			<jsp:expression>organizationScope</jsp:expression>
147
		<jsp:scriptlet>
148
			}
149
			else {
150
		</jsp:scriptlet>
151
			All Organizations	
152
		<jsp:scriptlet>
153
			}
154
		</jsp:scriptlet>
155
	</p>
156
	
157
	<form id="searchform" name="searchform" method="post" action="../../../metacat" 
158
		target="_top" 
159
		onsubmit="setQueryFormField()">
160
		<p class="regtext">
161
		The repository search system is used to locate data sets of interest by 
162
		searching through existing registered data sets. 
163
		Presently the search covers all fields, including author, title, abstract, 
164
		keywords, and other documentation for each data set. 
165
		<br />
166
		Use a '%' symbol as a wildcard in searches (e.g., '%herbivore%' 
167
		would locate any phrase with the word herbivore embedded within it).
168
		</p>
169
		<jsp:element name="input">
170
			<jsp:attribute name="name">organizationScope</jsp:attribute>
171
			<jsp:attribute name="id">organizationScope</jsp:attribute>
172
			<jsp:attribute name="type">hidden</jsp:attribute>
173
			<jsp:attribute name="value">
174
				<jsp:expression>organizationScope</jsp:expression>
175
			</jsp:attribute>
176
		</jsp:element>
177
		<jsp:element name="input">
178
			<jsp:attribute name="name">sessionid</jsp:attribute>
179
			<jsp:attribute name="type">hidden</jsp:attribute>
180
			<jsp:attribute name="value">
181
				<jsp:getProperty name="clientViewBean" property="sessionid" />
182
			</jsp:attribute>
183
		</jsp:element>
184
		<input type="text" id="anyfield" name="anyfield" value="" size="14" />
185
		<input type="hidden" id="query" name="query"  />
186
		<input type="hidden" name="qformat" value="saeon"/>
187
		<input type="hidden" name="action" value="squery" />  
188
		<input type="submit" value="Search"  />
189
		<p class="regtext">
190
		-Or-
191
		<br />
192
		Browse all existing data sets by title. This operation can be slow.
193
		</p>
194
		<input type="button" value="Browse All" onclick="setBrowseAll();form.submit()" />
195
	</form>
196
	
197
	</td>
198
	<td width="150px">
199
	
200
	<!-- Login section -->
201
	<jsp:scriptlet>
202
		if (!clientViewHelper.isLoggedIn()) {
203
	</jsp:scriptlet>
204
	
205
	<dl class="portlet" id="portlet-login">
206
		<dt class="portletHeader">
207
			<!-- <a href="./login.jsp">Log in</a>-->
208
			Log in
209
		</dt>
210
		<dd class="portletItem odd">
211
			<form name="loginForm" method="post" action="./"
212
				onsubmit="return allowSubmit(this)">
213
				<input name="qformat" type="hidden" value="saeon" />
214
				<table>
215
					<tr valign="top">
216
						<td>
217
							<span class="required">User name</span>	
218
						</td>
219
						<td>
220
							<input name="username" type="text" value=""
221
							style="width: 140" />
222
						</td>
223
					</tr>
224
					<tr>
225
						<td><span class="required">Organization</span></td>
226
						<td><select name="organization" style="width: 140">
227
							<option value="SAEON" selected="selected">SAEON</option>
228
							<option value="SANParks">SANParks</option>
229
							<option value="NCEAS">NCEAS</option>
230
							<option value="unaffiliated">unaffiliated</option>
231
						</select></td>
232
					</tr>
233
					<tr>
234
						<td><span class="required">Password</span></td>
235
						<td><input name="password" value="" type="password"
236
							style="width: 140" maxlength="50" /></td>
237
					</tr>
238
					<tr>
239
						<td></td>
240
						<td colspan="1" align="right">
241
							<input name="action"
242
							value="Login" type="submit" class="button_login" />
243
						</td>
244
					</tr>
245
				</table>
246
			</form>
247
		</dd>
248

    
249
		<dd class="portletItem even">
250
			<a href="@cgi-prefix@/ldapweb.cgi" target="_parent">
251
				<img src="images/user.gif" alt="New user?" 
252
				title="User" 
253
				height="16" 
254
				width="16" />
255
				New user?
256
			</a>
257
		</dd>
258
	</dl>
259
	
260
	<jsp:scriptlet>
261
		} else {
262
	</jsp:scriptlet>
263
	
264
	<dl class="portlet" id="portlet-login">
265
		<dt class="portletHeader">
266
			Welcome,
267
			<jsp:expression>clientViewBean.getUsername()</jsp:expression>
268
		</dt>
269
		<dd class="portletItem odd">
270
			<form name="logoutForm" method="post" action="./">
271
			<input name="qformat" value="saeon" type="hidden" />
272
			<table>
273
				<tr valign="top">
274
					<td>
275
						<p class="regtext">
276
							You are currently logged in.
277
						</p>
278
					</td>
279
					<td align="right">
280
						<input name="action" type="submit" value="Logout" class="button_login" />
281
					</td>
282
				</tr>
283
				<tr valign="top">
284
					<td colspan="2">
285
						<p class="regtext">
286
							(<jsp:expression>clientViewBean.getMessage(ClientView.LOGIN_MESSAGE)</jsp:expression>)
287
						</p>
288
					</td>
289
				</tr>
290
			</table>
291
			</form>
292
		</dd>
293
		<dd class="portletItem even">
294
			<a href="@cgi-prefix@/ldapweb.cgi?stage=resetpass" target="_parent">
295
				<img src="images/user.gif" alt="New user?" 
296
				title="User" 
297
				height="16" 
298
				width="16" />
299
				reset your password
300
			</a>
301
		</dd>
302
		<dd class="portletItem">
303
			<a href="@cgi-prefix@/ldapweb.cgi?stage=changepass" target="_parent">
304
				<img src="images/user.gif" alt="New user?" 
305
				title="User" 
306
				height="16" 
307
				width="16" />
308
				change your password
309
			</a>
310
		</dd>
311
	</dl>		
312
	<jsp:scriptlet>
313
		}
314
	</jsp:scriptlet> 
315
	
316
	<!-- File Upload Form --> 
317
	<br />
318
	<dl class="portlet" id="portlet-login">
319
		<dt class="portletHeader">
320
			Data Package Upload
321
		</dt>
322
		<dd class="portletItem odd">
323
		
324
			<jsp:scriptlet>
325
				if (clientViewHelper.isLoggedIn()) {
326
			</jsp:scriptlet>
327
			<table width="100%">
328
				<tr valign="top">
329
					<td align="right">
330
						<form action="./upload.jsp" method="post">
331
							<input type="submit" value="Go >" class="button_login" />
332
						</form>
333
					</td>
334
				</tr>
335
			</table>			
336
			<jsp:scriptlet>
337
				} else {
338
			</jsp:scriptlet>
339
			
340
			<p class="regtext">
341
				You must be logged into your user account before uploading a data set.
342
			</p>
343
			<jsp:scriptlet>
344
				}
345
			</jsp:scriptlet>
346
		
347
		</dd>
348
	</dl>	
349
	
350
	</td>
351
	
352
	<!-- so the map frame doesn't overlap content -->
353
	<td width="50px"></td>
354
	
355
	</tr>
356
	
357
	<tr>
358
	<td colspan="2" align="left">
359

    
360
	<!-- Map here --> 
361
	<h2>Spatial Search</h2>
362
	
363
		<div style="padding-left: 100px">
364
		<!-- map frame -->
365
        <script language="JavaScript">
366
            insertMap();
367
        </script>
368
        </div>
369
	</td>
370
	
371
	<!-- so the map frame doesn't overlap content -->
372
	<td width="50px"></td>
373
	
374
	</tr>
375
	
376
	</table>
377
	
378
	</div>
379
</body>
380
</html>
381
</jsp:root>
(3-3/20)