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
        </jsp:scriptlet>
67

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

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

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