Project

General

Profile

1 3404 leinfelder
<?xml version="1.0" encoding="UTF-8"?>
2
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
3
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
4
    <jsp:directive.page import="edu.ucsb.nceas.metacat.clientview.ClientViewHelper"/>
5
    <jsp:directive.page import="edu.ucsb.nceas.metacat.clientview.ClientView"/>
6
7
    <jsp:declaration>
8
        private ClientViewHelper            clientViewHelper;
9
    </jsp:declaration>
10
11
    <html xmlns="http://www.w3.org/1999/xhtml">
12
        <head>
13
            <script type="text/javascript">
14
                function allowUploadSubmit(formObj) {
15
                    var     result = true;
16
17
                    if (isEmpty(formObj.elements["metaFileName"])) {
18
                        result = false;
19
                        alert("Metadata file name is required");
20
                    }
21
                    return(result);
22
                }
23
24
                function isEmpty(aTextField) {
25
                    var value = trim(aTextField.value);
26
                    var result = ((value.length == 0) || (value == null));
27
                    return(result);
28
                }
29
30
		function trim(stringToTrim) {
31
			return(stringToTrim.replace(/^\s+|\s+$/g,""));
32
		}
33
            </script>
34
35
            <jsp:scriptlet>
36
                clientViewHelper = ClientViewHelper.clientViewHelperInstance(request);
37
            </jsp:scriptlet>
38 3418 leinfelder
            <link href="sanparks.css" rel="stylesheet" type="text/css" />
39 3404 leinfelder
        </head>
40 3428 leinfelder
        <body>
41 3404 leinfelder
            <jsp:useBean id="clientViewBean" scope="session" class="edu.ucsb.nceas.metacat.clientview.ClientView"/>
42
            <jsp:setProperty name="clientViewBean" property="*"/>
43 3418 leinfelder
44
            <h2>Data Package Upload</h2>
45
46
            <p class="regtext">
47
            	Spatial metadata files (FGDC-compliant) and associated shape or raster files can be uploaded to the repository.
48
            </p>
49
50 3404 leinfelder
                <jsp:scriptlet>
51
                    clientViewHelper.clientRequest(request, response);
52
                    if (clientViewHelper.isLoggedIn()) {
53
                </jsp:scriptlet>
54 3418 leinfelder
55
                <jsp:scriptlet>
56
					if ( clientViewBean.getMessage(ClientView.UPLOAD_MESSAGE) != null) {
57
				</jsp:scriptlet>
58
	                <p class="emphasis">
59
						<jsp:expression>
60
							clientViewBean.getMessage(ClientView.UPLOAD_MESSAGE)
61
						</jsp:expression>
62
					</p>
63
				 <jsp:scriptlet>
64
					}
65
				</jsp:scriptlet>
66
67 3428 leinfelder
                <form name="uploadForm" method="post" action="./upload.jsp" enctype="multipart/form-data" onsubmit="return allowUploadSubmit(this)">
68 3404 leinfelder
                    <input name="returnfield" type="hidden" value="distinfo/stdorder/digform/digtopt/onlinopt/computer/networka/networkr"/>
69
                    <input name="pathExpr" type="hidden" value="/metadata/distinfo/resdesc"/>
70
71
                    <!-- Set the pathValue to the username (the scope) -->
72
                    <jsp:element name="input">
73
                        <jsp:attribute name="name">pathValue</jsp:attribute>
74
                        <jsp:attribute name="type">hidden</jsp:attribute>
75
                        <jsp:attribute name="value"><jsp:getProperty name="clientViewBean" property="username"/></jsp:attribute>
76
                    </jsp:element>
77
78 3418 leinfelder
79
                    <table>
80 3404 leinfelder
                        <tr>
81
                            <td colspan="2">
82 3418 leinfelder
                            	<h3>Metadata File <span class="regtext">(required)</span></h3>
83
                                <p class="regtext">Enter the Meta Data File (*.xml) &#xa0;&#xa0;&#xa0;
84 3404 leinfelder
                                    <input name="publicAccess" type="checkbox" checked=''/> Grant public read access
85
                                </p>
86
                            </td>
87
                        </tr>
88
                        <tr>
89 3418 leinfelder
                            <td colspan="2" align="right">
90 3404 leinfelder
                                <input name="metaFileName" accept="xml" type="file" size="60" value="" />
91
                            </td>
92
                        </tr>
93
                        <!-- Data fields -->
94
                        <tr>
95
                            <td colspan="2">
96 3418 leinfelder
                                <h3>Supporting Data Files <span class="regtext">(optional)</span></h3>
97 3404 leinfelder
                            </td>
98
                        </tr>
99
                        <tr>
100
                            <td colspan="2">
101 3418 leinfelder
                                <p class="regtext">Enter Data File 1 (*.shp)</p>
102
                            </td>
103
                        </tr>
104
                        <tr>
105
                            <td colspan="2" align="right">
106 3404 leinfelder
                                <input name="dataFileName" type="file" size="60" />
107
                            </td>
108
                        </tr>
109
                        <tr>
110
                            <td colspan="2">
111 3418 leinfelder
                                <p class="regtext">Enter Data File 2 (*.dbf)</p>
112 3404 leinfelder
                            </td>
113
                        </tr>
114
                        <tr>
115 3418 leinfelder
                            <td colspan="2" align="right">
116 3404 leinfelder
                                <input name="dataFileName" type="file" size="60" />
117
                            </td>
118
                        </tr>
119
                        <tr>
120
                            <td colspan="2">
121 3418 leinfelder
                                <p class="regtext">Enter Data File 3 (*.sbx)</p>
122 3404 leinfelder
                            </td>
123
                        </tr>
124
                        <tr>
125 3418 leinfelder
                            <td colspan="2" align="right">
126 3404 leinfelder
                                <input name="dataFileName" type="file" size="60" />
127
                            </td>
128
                        </tr>
129
                        <tr>
130
                            <td colspan="2">
131 3418 leinfelder
                                <p class="regtext">Enter Data File 4 (*.idx)</p>
132 3404 leinfelder
                            </td>
133
                        </tr>
134
                        <tr>
135 3418 leinfelder
                            <td colspan="2" align="right">
136 3404 leinfelder
                                <input name="dataFileName" type="file" size="60" />
137
                            </td>
138
                        </tr>
139
                        <tr>
140
                            <td colspan="2">
141 3418 leinfelder
                                <p class="regtext">Enter Data File 5 (*.XXX)</p>
142 3404 leinfelder
                            </td>
143
                        </tr>
144
                        <tr>
145 3418 leinfelder
                            <td colspan="2" align="right">
146 3404 leinfelder
                                <input name="dataFileName" type="file" size="60" />
147
                            </td>
148
                        </tr>
149
                        <tr>
150 3418 leinfelder
                            <td colspan="2" align="center">
151
                                <br/>
152
                            </td>
153
                        </tr>
154
                        <tr>
155 3404 leinfelder
                            <td align="left">
156 3418 leinfelder
                                <span class="regtext">
157
                                	<jsp:expression>
158
                                	clientViewBean.getMessage(ClientView.UPLOAD_MESSAGE)
159
                                	</jsp:expression>
160
                                </span>
161 3404 leinfelder
                            </td>
162
                            <td align="right">
163
                                <input name="action" value="Upload" type="submit" class="button_login"/>
164
                            </td>
165
                        </tr>
166
                    </table>
167
                </form>
168
169
                <jsp:scriptlet>
170
                    } else {
171
                </jsp:scriptlet>
172 3418 leinfelder
173
                <p class="emphasis">
174 3404 leinfelder
                    You must be logged into your user account before uploading a data set.
175 3418 leinfelder
                </p>
176
177 3404 leinfelder
                <jsp:scriptlet>
178
                    }
179
                </jsp:scriptlet>
180 3418 leinfelder
181 3404 leinfelder
                <p class="regtext">
182 3428 leinfelder
                    <form action="./index.jsp" method="post">
183 3404 leinfelder
                        <button name="action" type="submit" class="button_login">
184 3418 leinfelder
                            &lt; Back
185 3404 leinfelder
                        </button>
186
                    </form>
187
                </p>
188
        </body>
189
    </html>
190
</jsp:root>