Package org.dspace.app.webui.util

Examples of org.dspace.app.webui.util.JSONUploadResponse


                if (ConfigurationManager.getBooleanProperty("webui.submit.upload.progressbar", true))
                {
                    Gson gson = new Gson();
                    // old browser need to see this response as html to work           
                    response.setContentType("text/html");
                    JSONUploadResponse jsonResponse = new JSONUploadResponse();
                    jsonResponse.addUploadFileSizeLimitExceeded(
                            e.getActualSize(), e.getPermittedSize());
                    response.getWriter().print(gson.toJson(jsonResponse));
                    response.flushBuffer();                   
                }
                else
View Full Code Here


        if (UIUtil.getBoolParameter(request, "ajaxUpload"))
        {
            Gson gson = new Gson();
            // old browser need to see this response as html to work           
            response.setContentType("text/html");
            JSONUploadResponse jsonResponse = new JSONUploadResponse();
            String bitstreamName = null;
            int bitstreamID = -1;
            long size = 0;
            String url = null;
            if (subInfo.getBitstream() != null)
            {
                Bitstream bitstream = subInfo.getBitstream();
                bitstreamName = bitstream.getName();
                bitstreamID = bitstream.getID();
                size = bitstream.getSize();
                url = request.getContextPath() + "/retrieve/" + bitstreamID
                        + "/" + UIUtil.encodeBitstreamName(bitstreamName);
            }
            jsonResponse.addUploadFileStatus(bitstreamName, bitstreamID, size,
                    url, status);
            response.getWriter().print(gson.toJson(jsonResponse));
            response.flushBuffer();
            return;
        }
View Full Code Here

        if (UIUtil.getBoolParameter(request, "ajaxUpload"))
        {
            Gson gson = new Gson();
            // old browser need to see this response as html to work           
            response.setContentType("text/html");
            JSONUploadResponse jsonResponse = new JSONUploadResponse();
            String bitstreamName = null;
            int bitstreamID = -1;
            long size = 0;
            String url = null;
            if (subInfo.getBitstream() != null)
            {
                Bitstream bitstream = subInfo.getBitstream();
                bitstreamName = bitstream.getName();
                bitstreamID = bitstream.getID();
                size = bitstream.getSize();
                url = request.getContextPath() + "/retrieve/" + bitstreamID
                        + "/" + UIUtil.encodeBitstreamName(bitstreamName);
            }
            jsonResponse.addUploadFileStatus(bitstreamName, bitstreamID, size,
                    url, status);
            response.getWriter().print(gson.toJson(jsonResponse));
            response.flushBuffer();
            return;
        }
View Full Code Here

TOP

Related Classes of org.dspace.app.webui.util.JSONUploadResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.