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 3323 barteau
4 3396 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
10
    <jsp:declaration>
11
        private ClientViewHelper            clientViewHelper = null;
12
    </jsp:declaration>
13
14
15
    <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 3396 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
                <div class="templatecontentareaclass">
59
60
                    <jsp:useBean id="clientViewBean" scope="session" class="edu.ucsb.nceas.metacat.clientview.ClientView"/>
61
                    <jsp:setProperty name="clientViewBean" property="*"/>
62
63
                    <jsp:scriptlet>
64
                        clientViewHelper = ClientViewHelper.clientViewHelperInstance(request);
65
                        clientViewHelper.clientRequest(request, response);
66
                    </jsp:scriptlet>
67
68
                    <li>Search for KNP Data
69
                        <form name="searchform" method="post" action="../../../metacat" target="_top">
70
                            <jsp:include page="SimpleSearchMetacatPostFields.html"/>
71
                            <jsp:element name="input">
72
                                <jsp:attribute name="name">sessionid</jsp:attribute>
73
                                <jsp:attribute name="type">hidden</jsp:attribute>
74
                                <jsp:attribute name="value"><jsp:getProperty name="clientViewBean" property="sessionid"/></jsp:attribute>
75
                            </jsp:element>
76
                            <br/>
77
                            <p class="regtext">
78
                                <input name="anyfield" value="" type="text" size="14"/>
79
                                <input name="action" value="query" type="submit"/>
80
                                all fields, including author, title, abstract, keywords, and other documentation.
81
                                Use a '%' symbol as a wildcard (e.g., '%biodiversity%').
82
                            </p>
83
                        </form>
84
                        <br/>
85
                    </li>
86
87
                    <li>Browse KNP data sets
88
89
                        <form name="browseform" method="post" action="../../../metacat" target="_top">
90
                            <jsp:include page="SimpleSearchMetacatPostFields.html"/>
91
                            <input name="anyfield" type="hidden" value="%" />
92
                            <jsp:element name="input">
93
                                <jsp:attribute name="name">sessionid</jsp:attribute>
94
                                <jsp:attribute name="type">hidden</jsp:attribute>
95
                                <jsp:attribute name="value"><jsp:getProperty name="clientViewBean" property="sessionid"/></jsp:attribute>
96
                            </jsp:element>
97
                            <br/>
98
                            <p class="regtext">
99
                                <input name="action" value="query" type="submit"/>
100
                                Browse all existing data sets by title.  This operation can be slow.
101
                            </p>
102
                        </form>
103
                        <br/>
104
                    </li>
105
106
                    <jsp:scriptlet>
107
                        if (!clientViewHelper.isLoggedIn()) {
108
                    </jsp:scriptlet>
109
                    <li>Login
110
                        <form name="loginForm" method="post" action="SaeonLogin.jspx" onsubmit="return allowSubmit(this)">
111
                            <input name="qformat" type="hidden" value="knp"/>
112
                            <table>
113
                                <tr>
114
                                    <td>
115
                                        <span class="required">User name</span>
116
                                    </td>
117
                                    <td>
118
                                        <input name="username" type="text" value="" style="width: 140"/>
119
                                    </td>
120
                                    <td rowspan="3" class="regtext" align="right" valign="top" style="width: 160" >
121
                                        <div>
122
                                            <!-- TODO: Config param follows -->
123
                                            <a href="http://localhost:8084/cgiScripts/cgi-bin/ldapweb.cgi" target="_parent">create a new account</a>
124
                                        </div>
125
                                    </td>
126
                                </tr>
127
                                <tr>
128
                                    <td>
129
                                        <span class="required">Organization</span>
130
                                    </td>
131
                                    <td>
132
                                        <select name="organization" style="width: 140">
133
                                            <option value="SANParks" selected="">SANParks</option>
134
                                            <option value="SAEON">SAEON</option>
135
                                            <option value="NCEAS">NCEAS</option>
136
                                            <option value="unaffiliated">unaffiliated</option>
137
                                        </select>
138
                                    </td>
139
                                </tr>
140
                                <tr>
141
                                    <td>
142
                                        <span class="required">Password</span>
143
                                    </td>
144
                                    <td>
145
                                        <input name="password" value="" type="password" style="width: 140" maxlength="50"/>
146
                                    </td>
147
                                </tr>
148
                                <tr>
149
                                    <td colspan="2" align="center">
150
                                        <input name="action" value="Login" type="submit" class="button_login"/>
151
                                    </td>
152
                                </tr>
153
                            </table>
154
                        </form>
155
                        <jsp:scriptlet>
156
                            } else {
157
                        </jsp:scriptlet>
158
                        <form name="logoutForm" method="post" action="SaeonLogin.jspx">
159
                            <input name="qformat" value="knp" type="hidden"/>
160
                            <table>
161
                                <tr>
162
                                    <td>
163
                                        <p class="regtext">Account: <jsp:expression>clientViewBean.getMessage(ClientView.LOGIN_MESSAGE)</jsp:expression></p>
164
                                    </td>
165
                                    <td rowspan="2" class="regtext" align="right" valign="top" style="width: 160" >
166
                                        <div>
167
                                            <!-- TODO: Config param follows -->
168
                                            <a href="http://localhost:8084/cgiScripts/cgi-bin/ldapweb.cgi?stage=resetpass" target="_parent">reset your password</a>
169
                                        </div>
170
                                        <div>
171
                                            <!-- TODO: Config param follows -->
172
                                            <a href="http://localhost:8084/cgiScripts/cgi-bin/ldapweb.cgi?stage=changepass" target="_parent">change your password</a>
173
                                        </div>
174
                                    </td>
175
                                </tr>
176
                                <tr>
177
                                    <td align="center">
178
                                        <input name="action" type="submit" value="Logout" class="button_login"/>
179
                                    </td>
180
                                </tr>
181
                            </table>
182
                        </form>
183
                        <jsp:scriptlet>
184
                            }
185
                        </jsp:scriptlet>
186
187
                        <!-- File Upload Form -->
188
                        <br/>
189
                        <jsp:scriptlet>
190
                            if (clientViewHelper.isLoggedIn()) {
191
                        </jsp:scriptlet>
192
                        <form action="SaeonUpload.jspx">
193
                            <li>Data Package Upload <input name="action" type="submit" value="Go" class="button_login"/></li>
194
                        </form>
195
                        <jsp:scriptlet>
196
                            } else {
197
                        </jsp:scriptlet>
198
                    </li>
199
                    <li>Data Package Upload
200
                        <br/>
201
                        <p class="regtext">
202
                            You must be logged into your user account before uploading a data set.
203
                        </p>
204
                    </li>
205
                    <jsp:scriptlet>
206
                        }
207
                    </jsp:scriptlet>
208
                </div>
209
        </body>
210
    </html>
211 3284 barteau
</jsp:root>