Package org.foray.core

Examples of org.foray.core.FOrayException


    public static AreaTreeCreator getInstance() throws FOrayException {
        if (AreaTreeCreator.theInstance == null) {
            try {
                AreaTreeCreator.theInstance = new AreaTreeCreator();
            } catch (final IOException e) {
                throw new FOrayException(e);
            }
        }
        return AreaTreeCreator.theInstance;
    }
View Full Code Here


            try {
                final PageCollection collection = areaTree.makePageCollection(
                        pageSequence);
                layout.formatPageSequence(collection);
            } catch (final AreaTreeException e) {
                throw new FOrayException(e);
            }
        }
        return areaTree;
    }
View Full Code Here

    public static FoDocumentReader getInstance() throws FOrayException {
        if (FoDocumentReader.theInstance == null) {
            try {
                FoDocumentReader.theInstance = new FoDocumentReader();
            } catch (final IOException e) {
                throw new FOrayException(e);
            }
        }
        return FoDocumentReader.theInstance;
    }
View Full Code Here

        final File foFile = new File(this.testDirectory, file);
        InputStream foInputStream;
        try {
            foInputStream = new FileInputStream(foFile);
        } catch (final FileNotFoundException e) {
            throw new FOrayException(e);
        }
        final InputSource foInputSource = new InputSource(foInputStream);
        XMLReader xmlReader;
        try {
            xmlReader = SaxParser.createSax2Parser();
        } catch (final SAXException e) {
            throw new FOrayException(e);
        } catch (final ParserConfigurationException e) {
            throw new FOrayException(e);
        }
        final FOTreeBuilder foTree = this.treeServer.makeFoTree();
        final FontServer fontServer = this.treeServer.getFontServer();
        final FontConsumer fontConsumer = fontServer.makeFontConsumer();
        foTree.setFontConsumer(fontConsumer);
        xmlReader.setContentHandler(foTree);
        try {
            xmlReader.parse(foInputSource);
        } catch (final IOException e) {
            throw new FOrayException(e);
        } catch (final SAXException e) {
            throw new FOrayException(e);
        }
        return foTree;
    }
View Full Code Here

                if (testcase.getNodeName().equals("testcases")) {
                    runTestCase(testcase);
                }
            }
        } catch (final IOException e) {
            throw new FOrayException(e);
        } catch (final SAXException e) {
            throw new FOrayException(e);
        } catch (final ParserConfigurationException e) {
            throw new FOrayException(e);
        }
        return this.differ;
    }
View Full Code Here

                if (! FileUtils.contentEquals(f1, f2)) {
                    this.differ.put(outname + ".at.xml", new Boolean(pass));
                }
            }
        } catch (final IOException e) {
            throw new FOrayException(e);
        }
    }
View Full Code Here

        final TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer;
        try {
            transformer = factory.newTransformer(new StreamSource(xslt));
        } catch (final TransformerConfigurationException e) {
            throw new FOrayException(e);
        }
        // Setup JAXP input source
        final Source source = new StreamSource(xml);
        /*
         * Create the FOrayDocument using the JAXP constructor. Resulting SAX
         * events (the generated FO) will be piped through to FOray.
         */
        final FOrayDocument document = new FOrayDocument(session, transformer,
                source);

        //Setup Renderer
        OutputStream out;
        try {
            out = new FileOutputStream(pdf);
        } catch (final FileNotFoundException e) {
            throw new FOrayException(e);
        }
        final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
                OutputTargetType.PDF, null, out, session.getLogger(),
                session.getGraphicServer());

View Full Code Here

        final TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer;
        try {
            transformer = factory.newTransformer(new StreamSource(xslt));
        } catch (final TransformerConfigurationException e) {
            throw new FOrayException(e);
        }
        // Setup JAXP input source
        final Source source = team.getSourceForProjectTeam();
        /*
         * Create the FOrayDocument using the JAXP constructor. Resulting SAX
         * events (the generated FO) will be piped through to FOray.
         */
        final FOrayDocument document = new FOrayDocument(session, transformer,
                source);

        //Setup Renderer
        OutputStream out;
        try {
            out = new FileOutputStream(pdf);
        } catch (final FileNotFoundException e) {
            throw new FOrayException(e);
        }
        final OutputTarget renderer = OutputTargetFactory.makeOutputTarget(
                OutputTargetType.PDF, null, out, session.getLogger(),
                session.getGraphicServer());

View Full Code Here

        //Create preview dialog (target for the AWTRenderer)
        PreviewDialog frame;
        try {
            frame = createPreviewDialog(renderer, translator);
        } catch (final OutputException e) {
            throw new FOrayException(e);
        }
        renderer.setComponent(frame);

        // TODO: This is probably not right. Needs to run session.process().
        // build FO tree: time
View Full Code Here

        }
        try {
            final InputSource inputSource = new InputSource(userConfigFile.openStream());
            loadUserconfiguration(inputSource);
        } catch (final IOException e) {
            throw new FOrayException(e);
        } catch (final FOrayException e) {
            throw new FOrayException("Could not load user configuration:\n"
                    + "  " + userConfigFile.toExternalForm() + "\n"
                    + "  Error: " + e.getMessage() + "\n"
                    + "  Using default values.", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.foray.core.FOrayException

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.