Package com.ponysdk.core.event

Examples of com.ponysdk.core.event.StreamHandler


            public void onSubmitComplete() {
                PNotificationManager.showTrayNotification("File uploaded, submit file '" + fileUpload.getFileName() + "'");
            }
        });

        fileUpload.addStreamHandler(new StreamHandler() {

            @Override
            public void onStream(final HttpServletRequest request, final HttpServletResponse response) {
                try {
                    response.setStatus(HttpServletResponse.SC_CREATED);
View Full Code Here


        downloadImageButton.addClickHandler(new PClickHandler() {

            @Override
            public void onClick(final PClickEvent event) {
                final StreamResource streamResource = new StreamResource();
                streamResource.open(new StreamHandler() {

                    @Override
                    public void onStream(final HttpServletRequest request, final HttpServletResponse response) {
                        response.reset();
                        response.setContentType("image/png");
View Full Code Here

        final byte[] reportBytes = JasperRunManager.runReportToPdf(report, new HashMap<Object, Object>(), new DynamicExportDataSource(records));

        // Set MIME type to binary data to prevent opening of PDF in browser window
        final StreamResource streamResource = new StreamResource();
        streamResource.open(new StreamHandler() {

            @Override
            public void onStream(final HttpServletRequest req, final HttpServletResponse response) {
                response.reset();
                response.setContentType("application/pdf");
View Full Code Here

    private void streamRequest(final HttpServletRequest req, final HttpServletResponse resp) {
        try {
            final Application ponyApplicationSession = (Application) req.getSession().getAttribute(Application.class.getCanonicalName());
            final Long ponySessionID = Long.parseLong(req.getParameter("ponySessionID"));
            final UIContext ponySession = ponyApplicationSession.getUIContext(ponySessionID);
            final StreamHandler streamHandler = ponySession.removeStreamListener(Long.parseLong(req.getParameter(PROPERTY.STREAM_REQUEST_ID)));
            streamHandler.onStream(req, resp);
        } catch (final Exception e) {
            log.error("Cannot stream request", e);
            try {
                resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
            } catch (final IOException e1) {
View Full Code Here

    }

    @Override
    public String export(final List<ExportableField> exportableFields, final List<T> records) throws Exception {
        final StreamResource streamResource = new StreamResource();
        streamResource.open(new StreamHandler() {

            @Override
            public void onStream(final HttpServletRequest req, final HttpServletResponse response) {
                try {
                    response.reset();
View Full Code Here

    }

    public void exportXMLString(final String fileName, final String content) throws Exception {
        // Set MIME type to binary data to prevent opening of PDF in browser window
        final StreamResource streamResource = new StreamResource();
        streamResource.open(new StreamHandler() {

            @Override
            public void onStream(final HttpServletRequest req, final HttpServletResponse response) {
                response.reset();
                response.setContentType("application/xml");
View Full Code Here

TOP

Related Classes of com.ponysdk.core.event.StreamHandler

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.