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 style="background: #FFFFFF;">
60
	<div class="templatecontentareaclass">
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 SANParks Data Repository. 
73
			This is the primary source for comprehensive information about scientific 
74
			and research data sets collected throughout the South African National Park System.
75
			</p>
76
		</td>
77
	</tr>
78
	<tr valign="top">
79
	<td>
80
	
81
	<h2>Search for SANParks 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
			<jsp:expression>request.getParameter("organizationScope")</jsp:expression>
92
		<jsp:scriptlet>
93
			}
94
			else {
95
		</jsp:scriptlet>
96
			All Organizations	
97
		<jsp:scriptlet>
98
			}
99
		</jsp:scriptlet>
100
	</p>
101
	
102
	<form name="searchform" method="post" action="../../../metacat" target="_top">
103
		<jsp:include page="SimpleSearchMetacatPostFields.html" /> 
104
		<jsp:element name="input">
105
			<jsp:attribute name="name">sessionid</jsp:attribute>
106
			<jsp:attribute name="type">hidden</jsp:attribute>
107
			<jsp:attribute name="value">
108
				<jsp:getProperty name="clientViewBean" property="sessionid" />
109
			</jsp:attribute>
110
		</jsp:element> 
111
		<p class="regtext">
112
		The repository search system is used to locate data sets of interest by 
113
		searching through existing registered data sets. 
114
		Presently the search covers all fields, including author, title, abstract, 
115
		keywords, and other documentation for each data set. 
116
		<br />
117
		Use a '%' symbol as a wildcard in searches (e.g., '%herbivore%' 
118
		would locate any phrase with the word herbivore embedded within it).
119
		</p>
120
			<input name="anyfield" value="" type="text" size="14" />
121
			<input name="action" value="query" type="hidden" />  
122
			<input name="search" value="Search" type="submit" /> 
123
		
124
	</form>
125
	<p class="regtext">
126
	-Or-
127
	</p>
128
	<form name="browseform" method="post" action="../../../metacat"
129
		target="_top">
130
		<jsp:include page="SimpleSearchMetacatPostFields.html" /> 
131
		<input name="anyfield" type="hidden" value="%" /> 
132
		<jsp:element name="input">
133
			<jsp:attribute name="name">sessionid</jsp:attribute>
134
			<jsp:attribute name="type">hidden</jsp:attribute>
135
			<jsp:attribute name="value">
136
				<jsp:getProperty name="clientViewBean" property="sessionid" />
137
			</jsp:attribute>
138
		</jsp:element>
139
		<p class="regtext">
140
		Browse all existing data sets by title. This operation can be slow.
141
		</p>
142
		<input name="action" value="query" type="hidden" />
143
		<input name="browse" value="Browse All" type="submit" />
144
	</form>
145

    
146
	</td>
147
	<td>
148
	
149
	<!-- Login section -->
150
	<jsp:scriptlet>
151
		if (!clientViewHelper.isLoggedIn()) {
152
	</jsp:scriptlet>
153
	
154
	<h3>
155
		Login
156
		<!-- TODO: Config param follows --> 
157
		<a href="HOSTNAME_HERE/cgiScripts/cgi-bin/ldapweb.cgi" target="_parent">
158
			<span class="regtext"> (request an account...)</span>
159
		</a>
160
	</h3>
161
	<form name="loginForm" method="post" action="SaeonLogin.jspx"
162
		onsubmit="return allowSubmit(this)">
163
		<input name="qformat" type="hidden" value="sanparks" />
164
	<table>
165
		<tr valign="top">
166
			<td>
167
				<span class="required">User name</span>	
168
			</td>
169
			<td>
170
				<input name="username" type="text" value=""
171
				style="width: 140" />
172
			</td>
173
		</tr>
174
		<tr>
175
			<td><span class="required">Organization</span></td>
176
			<td><select name="organization" style="width: 140">
177
				<option value="SANParks" selected="">SANParks</option>
178
				<option value="SAEON">SAEON</option>
179
				<option value="NCEAS">NCEAS</option>
180
				<option value="unaffiliated">unaffiliated</option>
181
			</select></td>
182
		</tr>
183
		<tr>
184
			<td><span class="required">Password</span></td>
185
			<td><input name="password" value="" type="password"
186
				style="width: 140" maxlength="50" /></td>
187
		</tr>
188
		<tr>
189
			<td colspan="2" align="center">
190
				<input name="action"
191
				value="Login" type="submit" class="button_login" />
192
			</td>
193
		</tr>
194
	</table>
195
	</form>
196
	
197
	<jsp:scriptlet>
198
		} else {
199
	</jsp:scriptlet>
200
	<h3>
201
		Welcome,
202
		<jsp:expression>clientViewBean.getUsername()</jsp:expression>  
203
	</h3>
204
	<form name="logoutForm" method="post" action="SaeonLogin.jspx">
205
	<input name="qformat" value="sanparks" type="hidden" />
206
	<table>
207
		<tr valign="top">
208
			<td>
209
				<p class="regtext">
210
					You are currently logged in.
211
				</p>
212
			</td>
213
			<td align="right">
214
				<input name="action" type="submit" value="Logout" class="button_login" />
215
			</td>
216
		</tr>
217
		<tr valign="top">
218
			<td colspan="2">
219
				<p class="regtext">
220
					(<jsp:expression>clientViewBean.getMessage(ClientView.LOGIN_MESSAGE)</jsp:expression>)
221
				</p>
222
			</td>
223
		</tr>	
224
		<tr>	
225
			<td colspan="2"
226
				class="regtext" 
227
				align="center" 
228
				valign="top">
229
				
230
				<!-- TODO: Config param follows --> 
231
				<a
232
					href="HOSTNAME_HERE/cgiScripts/cgi-bin/ldapweb.cgi?stage=resetpass"
233
					target="_parent">reset your password</a>
234
				|
235
				<!-- TODO: Config param follows --> 
236
				<a
237
					href="HOSTNAME_HERE/cgiScripts/cgi-bin/ldapweb.cgi?stage=changepass"
238
					target="_parent">change your password</a>
239
			</td>
240
		</tr>
241
	</table>
242
	</form>
243
	<jsp:scriptlet>
244
		}
245
	</jsp:scriptlet> 
246
	
247
	</td>
248
	
249
	<!-- so the map frame doesn't overlap content -->
250
	<td width="50px"></td>
251
	
252
	</tr>
253
	
254
	<tr>
255
	<td colspan="2">
256
	
257
	<!-- File Upload Form --> 
258
	<br />
259
	<h3>Data Package Upload</h3>
260
	
261
	<jsp:scriptlet>
262
		if (clientViewHelper.isLoggedIn()) {
263
	</jsp:scriptlet>
264
	<form action="SaeonUpload.jspx">
265
		<input name="action" type="submit" value="Go" class="button_login" />
266
	</form>
267
	<jsp:scriptlet>
268
		} else {
269
	</jsp:scriptlet>
270
	
271
	<p class="regtext">
272
		You must be logged into your user account before uploading a data set.
273
	</p>
274
	<jsp:scriptlet>
275
		}
276
	</jsp:scriptlet>
277
	
278
	</td>
279
	
280
	<!-- so the map frame doesn't overlap content -->
281
	<td width="50px"></td>
282
	
283
	</tr>
284
	
285
	<!--
286
	<tr>
287
		<td colspan="3">
288
		<iframe 
289
			width="100%"
290
			height="400px"
291
			frameborder="0"
292
			scrolling="no"
293
			src="spatial/pma.html" />
294
		</td>
295
	</tr>
296
	-->
297
	</table>
298
	
299
	</div>
300
</body>
301
</html>
302
</jsp:root>
(2-2/16)