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
		</dt>
208
		<dd class="portletItem odd">
209
			<form name="loginForm" method="post" action="./"
210
				onsubmit="return allowSubmit(this)">
211
				<input name="qformat" type="hidden" value="saeon" />
212
				<table>
213
					<tr valign="top">
214
						<td>
215
							<span class="required">User name</span>	
216
						</td>
217
						<td>
218
							<input name="username" type="text" value=""
219
							style="width: 140" />
220
						</td>
221
					</tr>
222
					<tr>
223
						<td><span class="required">Organization</span></td>
224
						<td><select name="organization" style="width: 140">
225
							<option value="SAEON" selected="selected">SAEON</option>
226
							<option value="SANParks">SANParks</option>
227
							<option value="NCEAS">NCEAS</option>
228
							<option value="unaffiliated">unaffiliated</option>
229
						</select></td>
230
					</tr>
231
					<tr>
232
						<td><span class="required">Password</span></td>
233
						<td><input name="password" value="" type="password"
234
							style="width: 140" maxlength="50" /></td>
235
					</tr>
236
					<tr>
237
						<td></td>
238
						<td colspan="1" align="right">
239
							<input name="action"
240
							value="Login" type="submit" class="button_login" />
241
						</td>
242
					</tr>
243
				</table>
244
			</form>
245
		</dd>
246

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

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