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
    </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
        </head>    
39
        <body>
40
            <jsp:useBean id="clientViewBean" scope="session" class="edu.ucsb.nceas.metacat.clientview.ClientView"/>
41
            <jsp:setProperty name="clientViewBean" property="*"/>
42
            <p>Data Package Upload</p>
43
            <p>
44
                <jsp:scriptlet>
45
                    clientViewHelper.clientRequest(request, response);
46
                    if (clientViewHelper.isLoggedIn()) {
47
                </jsp:scriptlet>
48
                <form name="uploadForm" method="post" action="SaeonUpload.jspx" enctype="multipart/form-data" onsubmit="return allowUploadSubmit(this)">
49
                    <input name="returnfield" type="hidden" value="distinfo/stdorder/digform/digtopt/onlinopt/computer/networka/networkr"/>
50
                    <input name="pathExpr" type="hidden" value="/metadata/distinfo/resdesc"/>
51
                    
52
                    <!-- Set the pathValue to the username (the scope) -->
53
                    <jsp:element name="input">
54
                        <jsp:attribute name="name">pathValue</jsp:attribute>
55
                        <jsp:attribute name="type">hidden</jsp:attribute>
56
                        <jsp:attribute name="value"><jsp:getProperty name="clientViewBean" property="username"/></jsp:attribute>
57
                    </jsp:element>
58
                    
59
                    <table bgcolor="WhiteSmoke">
60
                        <tr>
61
                            <td colspan="2">
62
                                <p class="regtext">Enter the Meta Data File (required) &#xa0;&#xa0;&#xa0;
63
                                    <input name="publicAccess" type="checkbox" checked=''/> Grant public read access
64
                                </p>
65
                            </td>
66
                        </tr>
67
                        <tr>
68
                            <td>
69
                                <input name="metaFileName" accept="xml" type="file" size="60" value="" />
70
                            </td>
71
                        </tr>
72
                        <!-- Data fields -->
73
                        <tr>
74
                            <td colspan="2">
75
                                <p class="regtext">Enter Data File 1 (optional)</p>
76
                            </td>
77
                        </tr>
78
                        <tr>
79
                            <td colspan="2">
80
                                <input name="dataFileName" type="file" size="60" />
81
                            </td>
82
                        </tr>
83
                        <tr>
84
                            <td colspan="2">
85
                                <p class="regtext">Enter Data File 2 (optional)</p>
86
                            </td>
87
                        </tr>
88
                        <tr>
89
                            <td colspan="2">
90
                                <input name="dataFileName" type="file" size="60" />
91
                            </td>
92
                        </tr>
93
                        <tr>
94
                            <td colspan="2">
95
                                <p class="regtext">Enter Data File 3 (optional)</p>
96
                            </td>
97
                        </tr>
98
                        <tr>
99
                            <td colspan="2">
100
                                <input name="dataFileName" type="file" size="60" />
101
                            </td>
102
                        </tr>
103
                        <tr>
104
                            <td colspan="2">
105
                                <p class="regtext">Enter Data File 4 (optional)</p>
106
                            </td>
107
                        </tr>
108
                        <tr>
109
                            <td colspan="2">
110
                                <input name="dataFileName" type="file" size="60" />
111
                            </td>
112
                        </tr>
113
                        <tr>
114
                            <td colspan="2">
115
                                <p class="regtext">Enter Data File 5 (optional)</p>
116
                            </td>
117
                        </tr>
118
                        <tr>
119
                            <td colspan="2">
120
                                <input name="dataFileName" type="file" size="60" />
121
                            </td>
122
                        </tr>
123
                        <tr>
124
                            <td align="left">
125
                                <span class="regtext"><jsp:expression>clientViewBean.getMessage(ClientView.UPLOAD_MESSAGE)</jsp:expression></span>
126
                            </td>
127
                            <td align="right">
128
                                <input name="action" value="Upload" type="submit" class="button_login"/>
129
                            </td>
130
                        </tr>
131
                    </table>
132
                </form>
133
                
134
                <jsp:scriptlet>
135
                    } else {
136
                </jsp:scriptlet>
137
                <span class="regtext">
138
                    You must be logged into your user account before uploading a data set.
139
                </span>
140
                <jsp:scriptlet>
141
                    }
142
                </jsp:scriptlet>
143
                <p class="regtext">
144
                    <form action="SaeonLogin.jspx">
145
                        <button name="action" type="submit" class="button_login">
146
                            <img alt="back" src="images/left_arrow.gif" align="middle"/>Back
147
                        </button>
148
                    </form>
149
                </p>
150
            </p>
151
        </body>
152
    </html>
153
</jsp:root>
(3-3/16)