Examples of SendStreamResponse


Examples of org.jboss.dashboard.ui.controller.responses.SendStreamResponse

        String xml = expMgr.format(options);

        // Send XML bytes as a stream response.
        int id = xml.hashCode();
        if (id < 0) id = id*-1;
        return new SendStreamResponse(new ByteArrayInputStream(xml.getBytes()), "inline;filename=kpiExport_" + id + ".xml");
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.SendStreamResponse

        String xml = expMgr.format(options);

        // Send XML bytes as a stream response.
        int id = xml.hashCode();
        if (id < 0) id = id*-1;
        return new SendStreamResponse(new ByteArrayInputStream(xml.getBytes()), "inline;filename=kpiExport_" + id + ".xml");
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.SendStreamResponse

        return null;
    }

    public CommandResponse actionExportData(String format) throws Exception {
        if (ExportTool.FORMAT_EXCEL.equalsIgnoreCase(format))
            return new SendStreamResponse(new ExportTool().exportExcel(getTable().getModel()), "inline;filename=data.xlsx;");
        else if (ExportTool.FORMAT_CSV.equalsIgnoreCase(format))
            return new SendStreamResponse(new ExportTool().exportCSV(getTable().getModel()), "inline;filename=data.csv;");
        else {
            throw new IllegalArgumentException("Null or unsupported export format!");
        }
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.SendStreamResponse

                protected void txFragment(Session session) throws Exception {
                    element[0] = (GraphicElement) session.get(GraphicElement.class, Long.decode(dbid));
                }
            }.execute();
            if (element[0] != null) {
                return new SendStreamResponse(new ByteArrayInputStream(element[0].getZipFile()), "inline; filename=" + URLEncoder.encode(element[0].getId()) + ".zip;");
            }
        }
        return null;
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.SendStreamResponse

        return null;
    }

    public CommandResponse actionExportData(String format) throws Exception {
        if (ExportTool.FORMAT_EXCEL.equalsIgnoreCase(format))
            return new SendStreamResponse(new ExportTool().exportExcel(getTable().getModel()), "inline;filename=data.xlsx;");
        else if (ExportTool.FORMAT_CSV.equalsIgnoreCase(format))
            return new SendStreamResponse(new ExportTool().exportCSV(getTable().getModel()), "inline;filename=data.csv;");
        else {
            throw new IllegalArgumentException("Null or unsupported export format!");
        }
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.SendStreamResponse

        String xml = expMgr.format(options);

        // Send XML bytes as a stream response.
        int id = xml.hashCode();
        if (id < 0) id = id*-1;
        return new SendStreamResponse(new ByteArrayInputStream(xml.getBytes()), "inline;filename=kpiExport_" + id + ".kpiex");
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.SendStreamResponse

        this.array = array;
        this.name = name;
    }

    public CommandResponse getResourceAsResponse() {
        SendStreamResponse response = new SendStreamResponse(new ByteArrayInputStream(array), "inline; filename=" + name + ";");
        FileNameMap fileNameMap = URLConnection.getFileNameMap();
        String contentType = fileNameMap.getContentTypeFor(name);
        if (contentType != null) response.setContentType(contentType);
        return response;
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.SendStreamResponse

        if (file == null || !file.exists()) {
            log.debug("Resource does not exist: " + file);
            return new SendErrorResponse(HttpServletResponse.SC_NOT_FOUND);
        }
        try {
            return new SendStreamResponse(file);
        } catch (Exception e) {
            log.error("Failed to return resource named " + resName, e);
            return new SendErrorResponse(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        }
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.SendStreamResponse

        String xml = expMgr.format(options);

        // Send XML bytes as a stream response.
        int id = xml.hashCode();
        if (id < 0) id = id*-1;
        return new SendStreamResponse(new ByteArrayInputStream(xml.getBytes()), "inline;filename=kpiExport_" + id + ".kpiex");
    }
View Full Code Here

Examples of org.jboss.dashboard.ui.controller.responses.SendStreamResponse

        return null;
    }

    public CommandResponse actionExportData(String format) throws Exception {
        if (ExportTool.FORMAT_EXCEL.equalsIgnoreCase(format))
            return new SendStreamResponse(new ExportTool().exportExcel(getTable().getModel()), "inline;filename=data.xlsx;");
        else if (ExportTool.FORMAT_CSV.equalsIgnoreCase(format))
            return new SendStreamResponse(new ExportTool().exportCSV(getTable().getModel()), "inline;filename=data.csv;");
        else {
            throw new IllegalArgumentException("Null or unsupported export format!");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.