Package org.foray.core

Examples of org.foray.core.FOrayTarget


        final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
                OutputTargetType.PDF, null, out, session.getLogger(),
                session.getGraphicServer());

        //Setup FOrayTarget
        new FOrayTarget(document, renderer, null, out);

        // Start the processing.
        session.process();
    }
View Full Code Here


            renderOptions.setConsistentOutput(Boolean.TRUE, SessionConfig.PRECEDENCE_DEFAULT);
            final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
                    rendererType, renderOptions, bos, session.getLogger(),
                    session.getGraphicServer());

            new FOrayTarget(document, renderer, null, bos);

            this.log.debug("ddir:" + this.destdir + " on:" + outname + ".pdf");
            session.process();

            // check difference
View Full Code Here

        final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
                OutputTargetType.PDF, null, out, session.getLogger(),
                session.getGraphicServer());

        //Setup FOrayTarget
        new FOrayTarget(document, renderer, null, out);

        // Start the processing.
        session.process();
    }
View Full Code Here

        final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
                OutputTargetType.PDF, null, out, session.getLogger(),
                session.getGraphicServer());

        //Setup FOrayTarget
        new FOrayTarget(document, renderer, null, out);

        // Start the processing.
        session.process();
    }
View Full Code Here

        //Setup renderer
        final AWTRenderer renderer = new AWTRenderer(getLogger(), null);

        //Setup FOrayTarget
        new FOrayTarget(document, renderer, null, null);

        //Create preview dialog (target for the AWTRenderer)
        PreviewDialog frame;
        try {
            frame = createPreviewDialog(renderer, translator);
View Full Code Here

         * system use the default.
         * Targets that do not need an OutputStream should set that parameter
         * to null.
         */
        final LayoutStrategy layout = new PioneerLS(session.getLogger());
        final FOrayTarget target = new FOrayTarget(document, outputTarget,
                layout, outputStream);

        /*
         * Everything is now ready to go. There are two different processing
         * models possible here. The first is to let FOray manage and
         * complete the processing internally. The second is to manage that
         * process externally, e.g. those integrating with Cocoon or another
         * pipeline-type scheme. If you don't know which of those to use, you
         * should probably let FOray control the processing. The instructions
         * are separated below for the two models. IMPORTANT: Please note that
         * the instructions reunify below for some cleanup code that is common
         * to both.
         */


/* *****************************************************************************
* Start instructions for internal FOray control. Ignore this section
* if you are controlling externally.
* ****************************************************************************/
        /*
         * Just push the button, and let FOray do the rest ...
         */
        session.process();
/* *****************************************************************************
* End instructions for internal FOray control.
* ****************************************************************************/


/* *****************************************************************************
* Start instructions for external control. Ignore this section if
* FOray is controlling the processing internally.
* ****************************************************************************/
        /*
         * The task here is to mimic the internal FOray processing, but to do
         * it outside of FOray. The processing that needs to be duplicated can
         * be found at the FOrayDocument method processTarget(FOrayTarget
         * target). This is the method ultimately called from the FOraySession
         * method process(), documented above as the button to push for
         * internal FOray processing. The commented code below is the outline
         * of the steps that need to be taken:
         */
/*
        document.setTarget(target);
        // Get either a SAX ContentHandler ...
        ContentHandler contentHandler = document.getContentHandler();
        // ... or a JAXP SAXResult
        SAXResult jaxpResult = document.getJAXPResult();
        // Do something with contentHandler or JAXP SaxResult here.
        MyClass.myMethod(contentHandler);
        // Allow the document to do some cleanup.
        document.cleanup(target);
*/
/* *****************************************************************************
* End instructions for external control.
* ****************************************************************************/


/* *****************************************************************************
* Start instructions for common cleanup code.
* ****************************************************************************/
        /*
         * The process of closing the OutputStream is handled here instead of
         * internally within FOray so that those who wish to do something else
         * with it can.
         */
        target.cleanup();
    }
View Full Code Here

            final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
                    OutputTargetType.PDF, null, output,
                    session.getLogger(), session.getGraphicServer());

            // Setup FOrayTarget
            new FOrayTarget(document, renderer, null, output);

            // Run the FOraySession
            session.process();

            final byte[] content = output.toByteArray();
View Full Code Here

            final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
                    OutputTargetType.PDF, null, output,
                    session.getLogger(), session.getGraphicServer());

            // Setup FOrayTarget
            new FOrayTarget(document, renderer, null, output);

            // Run the FOraySession
            session.process();

            final byte[] content = output.toByteArray();
View Full Code Here

        final PrinterJob pj = PrinterJob.getPrinterJob();
        pj.setCopies(1);
        final AWTPrintRenderer renderer = new AWTPrintRenderer(getLogger(),
                null, pj);
        // Setup FOrayTarget
        final FOrayTarget target = new FOrayTarget(document, renderer, null,
                null);
        return target;
    }
View Full Code Here

            final HttpServletResponse response) throws ServletException {
        try {
            final FOraySession session = setupSession(response);
            final FOrayDocument document = setupSAXDocument(session,
                    inputSource);
            final FOrayTarget target = setupTarget(document);
            session.process();
            sendContentToResponse(response, target);
        } catch (final FOrayException ex) {
            throw new ServletException(ex);
        } catch (final IOException ex) {
View Full Code Here

TOP

Related Classes of org.foray.core.FOrayTarget

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.