Project

General

Profile

metacat / lib / style / skins / sanparks / SaeonUpload.jspx @ 3434

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