Revision 3374
Added by barteau over 17 years ago
lib/style/common/fgdc/ClientViewHelper.jspx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> |
|
3 |
|
|
4 |
<jsp:directive.page contentType="text/html;charset=UTF-8"/> |
|
5 |
<jsp:directive.page import="com.oreilly.servlet.multipart.MultipartParser"/> |
|
6 |
<jsp:directive.page import="edu.ucsb.nceas.metacat.MetaCatUtil"/> |
|
7 |
<jsp:directive.page import="java.io.*"/> |
|
8 |
<jsp:directive.page import="javax.servlet.*"/> |
|
9 |
<jsp:directive.page import="javax.servlet.http.*"/> |
|
10 |
<jsp:directive.page import="edu.ucsb.nceas.metacat.clientview.ClientViewHelper"/> |
|
11 |
|
|
12 |
<jsp:declaration> |
|
13 |
String message; |
|
14 |
String contentType, posted_ldapUserName; |
|
15 |
|
|
16 |
private ClientViewHelper clientHelper; |
|
17 |
private MultipartParser multipartParser; |
|
18 |
private int sizeLimit; |
|
19 |
</jsp:declaration> |
|
20 |
|
|
21 |
<jsp:scriptlet> |
|
22 |
sizeLimit = (new Integer(MetaCatUtil.getOption("datafilesizelimit"))).intValue(); |
|
23 |
clientHelper = ClientViewHelper.clientViewHelperInstance(request); |
|
24 |
|
|
25 |
contentType = request.getContentType(); |
|
26 |
message = ""; |
|
27 |
//*** Only process request if a file upload. |
|
28 |
if (clientHelper.isLoggedIn()) { |
|
29 |
//*** Init the MultipartParser. |
|
30 |
multipartParser = new MultipartParser(request, sizeLimit * 1024 * 1024); |
|
31 |
message = clientHelper.handleFileUpdate(multipartParser); |
|
32 |
} else { |
|
33 |
message = "you aint logged in"; |
|
34 |
} |
|
35 |
response.setContentType("text/html;charset=UTF-8"); |
|
36 |
</jsp:scriptlet> |
|
37 |
|
|
38 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
39 |
<head> |
|
40 |
</head> |
|
41 |
<body> |
|
42 |
<p> |
|
43 |
message = <jsp:expression>message</jsp:expression> |
|
44 |
</p> |
|
45 |
Press the BACK button to return. |
|
46 |
</body> |
|
47 |
</html> |
|
48 |
|
|
49 |
</jsp:root> |
|
0 | 50 |
Also available in: Unified diff
Provides a mechanism to access clientview classes from an XSLT-generated HTML document (within the skins framework).
Serves as a servlet for "updating" files from XSLT-generated html multipart-forms.
It simply forwards the multi-part request to the ClientViewHelper java class.
The form would list this JSP in the form's action attribute.