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
    <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
        private String                      message;
10
    </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
            <link href="sanparks.css" rel="stylesheet" type="text/css" />
40
        </head>    
41
        <body>
42
            <jsp:useBean id="clientViewBean" scope="session" class="edu.ucsb.nceas.metacat.clientview.ClientView"/>
43
            <jsp:setProperty name="clientViewBean" property="*"/>
44
            
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
                <jsp:scriptlet>
52
                    message = clientViewHelper.clientRequest(request, response);
53
                    if (clientViewHelper.isLoggedIn()) {
54
                </jsp:scriptlet>
55
                
56
                <jsp:scriptlet>
57
					if ( message != null) {
58
				</jsp:scriptlet>
59
	                <p class="emphasis">
60
						<jsp:expression>
61
							message
62
						</jsp:expression>
63
					</p>
64
				 <jsp:scriptlet>
65
					}
66
				</jsp:scriptlet>	
67
	                
68
                <form name="uploadForm" method="post" action="./upload.jsp" enctype="multipart/form-data" onsubmit="return allowUploadSubmit(this)">
69
                    <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
                    <input name="action" type="hidden" value="Upload"/>
72
                    
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
                    
81
                    <table>
82
                        <tr>
83
                            <td colspan="2">
84
                            	<h3>Metadata File <span class="regtext">(required)</span></h3>
85
                                <p class="regtext">Enter the Meta Data File (*.xml) &#xa0;&#xa0;&#xa0;
86
                                    <input name="publicAccess" type="checkbox" checked=''/> Grant public read access
87
                                </p>
88
                            </td>
89
                        </tr>
90
                        <tr>
91
                            <td colspan="2" align="right">
92
                                <input name="metaFileName" accept="xml" type="file" size="60" value="" />
93
                            </td>
94
                        </tr>
95
                        <!-- Data fields -->
96
                        <tr>
97
                            <td colspan="2">
98
                                <h3>Supporting Data Files <span class="regtext">(optional)</span></h3>
99
                            </td>
100
                        </tr>
101
                        <tr>
102
                            <td colspan="2">
103
                                <p class="regtext">Enter Data File 1 (*.shp)</p>
104
                            </td>
105
                        </tr>
106
                        <tr>
107
                            <td colspan="2" align="right">
108
                                <input name="dataFileName" type="file" size="60" />
109
                            </td>
110
                        </tr>
111
                        <tr>
112
                            <td colspan="2">
113
                                <p class="regtext">Enter Data File 2 (*.dbf)</p>
114
                            </td>
115
                        </tr>
116
                        <tr>
117
                            <td colspan="2" align="right">
118
                                <input name="dataFileName" type="file" size="60" />
119
                            </td>
120
                        </tr>
121
                        <tr>
122
                            <td colspan="2">
123
                                <p class="regtext">Enter Data File 3 (*.sbx)</p>
124
                            </td>
125
                        </tr>
126
                        <tr>
127
                            <td colspan="2" align="right">
128
                                <input name="dataFileName" type="file" size="60" />
129
                            </td>
130
                        </tr>
131
                        <tr>
132
                            <td colspan="2">
133
                                <p class="regtext">Enter Data File 4 (*.idx)</p>
134
                            </td>
135
                        </tr>
136
                        <tr>
137
                            <td colspan="2" align="right">
138
                                <input name="dataFileName" type="file" size="60" />
139
                            </td>
140
                        </tr>
141
                        <tr>
142
                            <td colspan="2">
143
                                <p class="regtext">Enter Data File 5 (*.XXX)</p>
144
                            </td>
145
                        </tr>
146
                        <tr>
147
                            <td colspan="2" align="right">
148
                                <input name="dataFileName" type="file" size="60" />
149
                            </td>
150
                        </tr>
151
                        <tr>
152
                            <td colspan="2" align="center">
153
                                <br/>
154
                            </td>
155
                        </tr>
156
                        <tr>
157
                            <td align="left">
158
                                <span class="regtext">
159
                                	<jsp:expression>
160
                                	clientViewBean.getMessage(ClientView.UPLOAD_MESSAGE)
161
                                	</jsp:expression>
162
                                </span>
163
                            </td>
164
                            <td align="right">
165
                                <input name="submit" value="Upload" type="submit" class="button_login"/>
166
                            </td>
167
                        </tr>
168
                    </table>
169
                </form>
170
                
171
                <jsp:scriptlet>
172
                    } else {
173
                </jsp:scriptlet>
174
                
175
                <p class="emphasis">
176
                    You must be logged into your user account before uploading a data set.
177
                </p>
178
                
179
                <jsp:scriptlet>
180
                    }
181
                </jsp:scriptlet>
182
                
183
                <p class="regtext">
184
                    <form action="./index.jsp" method="post">
185
                        <button type="submit" class="button_login">
186
                            &lt; Back
187
                        </button>
188
                    </form>
189
                </p>
190
        </body>
191
    </html>
192
</jsp:root>
(4-4/34)