Project

General

Profile

« Previous | Next » 

Revision 3484

Added by barteau about 17 years ago

Modifications to accomodate Downloads.

View differences:

lib/style/common/ClientViewHelper.jspx
10 10
    <jsp:directive.page import="edu.ucsb.nceas.metacat.clientview.ClientViewHelper"/>
11 11
    
12 12
    <jsp:declaration>
13
        String                                              message, newUrl;
14
        String                                              contentType, posted_ldapUserName;
15
        
13
        private String                                      message, newUrl, contentType;
16 14
        private ClientViewHelper                            clientHelper;
17 15
        private MultipartParser                             multipartParser;
18 16
        private int                                         sizeLimit;
19
        private String                                      contenType;
20 17
    </jsp:declaration>
21 18
    
22 19
    <jsp:scriptlet>
23 20
        sizeLimit = (new Integer(MetaCatUtil.getOption("datafilesizelimit"))).intValue();
24 21
        clientHelper = ClientViewHelper.clientViewHelperInstance(request);
25
        
22

  
26 23
        contentType = request.getContentType();
27 24
        message = "";
28
        if (clientHelper.isLoggedIn()) {
29
            if (contentType != null &amp;&amp; contentType.contains("multipart/form-data")) {
30
                //*** Process request here if a file update.
31
                //*** Init the MultipartParser.
32
                multipartParser = new MultipartParser(request, sizeLimit * 1024 * 1024);
33
                message = clientHelper.handleFileUpdate(multipartParser);
34
            } else {
35
                //*** Process request here if a delete.
36
                message = clientHelper.clientRequest(request, response);
37
            }
25
        if (contentType != null &amp;&amp; contentType.contains("multipart/form-data")) {
26
            //*** Process request here if a file update.
27
            //*** Init the MultipartParser.
28
            multipartParser = new MultipartParser(request, sizeLimit * 1024 * 1024);
29
            message = clientHelper.handleFileUpdate(multipartParser);
38 30
        } else {
39
            message = "You need to be logged in.";
31
            //*** Process request here if a delete.
32
            message = clientHelper.clientRequest(request, response);
40 33
        }
41
        response.setContentType("text/html;charset=UTF-8");
42 34
        newUrl = clientHelper.makeRedirectUrl();
43
        response.sendRedirect("../../" + newUrl);
35
        if (newUrl != null) {
36
            response.setContentType("text/html;charset=UTF-8");
37
            response.sendRedirect("../../" + newUrl);
38
        }
39
        
40
        System.out.println("ClientViewHelper.jspx: " + message);
44 41
    </jsp:scriptlet>
45 42
</jsp:root>

Also available in: Unified diff