Project

General

Profile

1 3284 barteau
<?xml version="1.0" encoding="UTF-8"?>
2
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
3 3301 barteau
4 3323 barteau
<!-- 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 import="edu.ucsb.nceas.metacat.clientview.ClientView"/>
7
<jsp:directive.page import="edu.ucsb.nceas.metacat.clientview.ClientViewHelper"/>
8
<jsp:directive.page import="edu.ucsb.nceas.metacat.clientview.ClientHtmlHelper"/>
9 3301 barteau
10 3323 barteau
<jsp:declaration>
11
    private ClientViewHelper            clientViewHelper = null;
12
</jsp:declaration>
13 3301 barteau
14
15 3323 barteau
<html xmlns="http://www.w3.org/1999/xhtml">
16
<head>
17
18
    <script type="text/javascript">
19 3284 barteau
20
                function allowSubmit(formObj) {
21
                    var     result = true;
22
                    var     action = "";
23
24 3323 barteau
                    action = trim(formObj.elements["action"].value);
25 3284 barteau
                    if (action == "Login") {
26
                        if (isEmpty(formObj.elements["username"])) {
27
                            result = false;
28
                            alert("User name is required");
29
                        } else if (isEmpty(formObj.elements["organization"])) {
30
                            result = false;
31
                            alert("Organization is required");
32
                        } else if (isEmpty(formObj.elements["password"])) {
33
                            result = false;
34
                            alert("Password is required");
35
                        }
36
                    }
37
38
                    return(result);
39
                }
40
41
                function isEmpty(aTextField) {
42
                    var value = trim(aTextField.value);
43
                    var result = ((value.length == 0) || (value == null));
44
                    return(result);
45
                }
46
47
		function trim(stringToTrim) {
48
			return(stringToTrim.replace(/^\s+|\s+$/g,""));
49
		}
50
51 3323 barteau
    </script>
52
53
    <title>SANParks - Kruger National Park Data Repository</title>
54
    <link href="knp.css" rel="stylesheet" type="text/css"/>
55
56
</head>
57
<body>
58
    <jsp:useBean id="clientViewBean" scope="session" class="edu.ucsb.nceas.metacat.clientview.ClientView"/>
59
    <jsp:setProperty name="clientViewBean" property="*"/>
60
61
    <jsp:scriptlet>
62
        clientViewHelper = ClientViewHelper.clientViewHelperInstance(request);
63
        clientViewHelper.clientRequest(request, response);
64
    </jsp:scriptlet>
65
66
    <li>Search for KNP Data
67
        <form name="searchform" method="post" action="/knb/metacat" target="_top">
68
            <jsp:include page="SimpleSearchMetacatPostFields.html"/>
69
            <jsp:element name="input">
70
                <jsp:attribute name="name">sessionid</jsp:attribute>
71
                <jsp:attribute name="type">hidden</jsp:attribute>
72
                <jsp:attribute name="value"><jsp:getProperty name="clientViewBean" property="sessionid"/></jsp:attribute>
73
            </jsp:element>
74
            <br/>
75
            <p class="regtext">
76
                <input name="anyfield" value="" type="text" size="14"/>
77
                <input name="action" value="query" type="submit"/>
78
                all fields, including author, title, abstract, keywords, and other documentation.
79
                Use a '%' symbol as a wildcard (e.g., '%biodiversity%').
80
            </p>
81
        </form>
82
        <br/>
83
    </li>
84
85
    <li>Browse KNP data sets
86
87
        <form name="browseform" method="post" action="/knb/metacat" target="_top">
88
            <jsp:include page="SimpleSearchMetacatPostFields.html"/>
89
            <input name="anyfield" type="hidden" value="%" />
90
            <jsp:element name="input">
91
                <jsp:attribute name="name">sessionid</jsp:attribute>
92
                <jsp:attribute name="type">hidden</jsp:attribute>
93
                <jsp:attribute name="value"><jsp:getProperty name="clientViewBean" property="sessionid"/></jsp:attribute>
94
            </jsp:element>
95
            <br/>
96
            <p class="regtext">
97
                <input name="action" value="query" type="submit"/>
98
                Browse all existing data sets by title.  This operation can be slow.
99
            </p>
100
        </form>
101
        <br/>
102
    </li>
103
104
    <jsp:scriptlet>
105
        if (!clientViewHelper.isLoggedIn()) {
106
    </jsp:scriptlet>
107
    <li>Login
108
        <form name="loginForm" method="post" action="SaeonLogin.jspx" onsubmit="return allowSubmit(this)">
109
            <input name="qformat" type="hidden" value="knp"/>
110
            <table>
111
                <tr>
112
                    <td>
113
                        <span class="required">User name</span>
114
                    </td>
115
                    <td>
116
                        <input name="username" type="text" value="" style="width: 140"/>
117
                    </td>
118
                    <td rowspan="3" class="regtext" align="right" valign="top" style="width: 160" >
119
                        <div>
120
                            <!-- TODO: Config param follows -->
121
                            <a href="http://localhost:8084/cgiScripts/cgi-bin/ldapweb.cgi" target="_parent">create a new account</a>
122
                        </div>
123
                    </td>
124
                </tr>
125
                <tr>
126
                    <td>
127
                        <span class="required">Organization</span>
128
                    </td>
129
                    <td>
130
                        <select name="organization" style="width: 140">
131
                            <option value="SANParks" selected="">SANParks</option>
132
                            <option value="SAEON">SAEON</option>
133
                            <option value="NCEAS">NCEAS</option>
134
                            <option value="unaffiliated">unaffiliated</option>
135
                        </select>
136
                    </td>
137
                </tr>
138
                <tr>
139
                    <td>
140
                        <span class="required">Password</span>
141
                    </td>
142
                    <td>
143
                        <input name="password" value="" type="password" style="width: 140" maxlength="50"/>
144
                    </td>
145
                </tr>
146
                <tr>
147
                    <td colspan="2" align="center">
148
                        <input name="action" value="Login" type="submit" class="button_login"/>
149
                    </td>
150
                </tr>
151
            </table>
152
        </form>
153
        <jsp:scriptlet>
154
            } else {
155
        </jsp:scriptlet>
156
        <form name="logoutForm" method="post" action="SaeonLogin.jspx">
157
            <input name="qformat" value="knp" type="hidden"/>
158
            <table>
159
                <tr>
160
                    <td>
161
                        <p class="regtext">Account: <jsp:expression>clientViewBean.getMessage(ClientView.LOGIN_MESSAGE)</jsp:expression></p>
162
                    </td>
163
                    <td rowspan="2" class="regtext" align="right" valign="top" style="width: 160" >
164
                        <div>
165
                            <!-- TODO: Config param follows -->
166
                            <a href="http://localhost:8084/cgiScripts/cgi-bin/ldapweb.cgi?stage=resetpass" target="_parent">reset your password</a>
167
                        </div>
168
                        <div>
169
                            <!-- TODO: Config param follows -->
170
                            <a href="http://localhost:8084/cgiScripts/cgi-bin/ldapweb.cgi?stage=changepass" target="_parent">change your password</a>
171
                        </div>
172
                    </td>
173
                </tr>
174
                <tr>
175
                    <td align="center">
176
                        <input name="action" type="submit" value="Logout" class="button_login"/>
177
                    </td>
178
                </tr>
179
            </table>
180
        </form>
181
        <jsp:scriptlet>
182
            }
183
        </jsp:scriptlet>
184
185
        <!-- File Upload Form -->
186
        <br/>
187
        <jsp:scriptlet>
188
            if (clientViewHelper.isLoggedIn()) {
189
        </jsp:scriptlet>
190
        <form action="SaeonUpload.jspx">
191
            <li>Data Package Upload <input name="action" type="submit" value="Go" class="button_login"/></li>
192
        </form>
193
        <jsp:scriptlet>
194
            } else {
195
        </jsp:scriptlet>
196
    </li>
197
    <li>Data Package Upload
198
    <br/>
199
    <p class="regtext">
200
        You must be logged into your user account before uploading a data set.
201
    </p>
202
    </li>
203
    <jsp:scriptlet>
204
        }
205
    </jsp:scriptlet>
206
</body>
207
</html>
208 3284 barteau
</jsp:root>