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