Package com.volantis.xml.pipeline.sax

Examples of com.volantis.xml.pipeline.sax.XMLPipelineContext


     * and the next SAX content encountered will be the content that
     * is to be transformed.
     * @throws SAXException if an error occurs
     */
    public void beginTransform() throws SAXException {
        XMLPipelineContext context = getPipelineContext();
        if (!context.inErrorRecoveryMode()) {
            // run through the list of Transformer handlers and set up the
            // transformations

            XMLProcess cup = new ContextManagerProcess(true);
            cup.setPipeline(getPipeline());
View Full Code Here


     * This method should be called when all content that requires
     * transforming has been received.
     * @throws SAXException if an error occurs
     */
    public void endTransform() throws SAXException {
        XMLPipelineContext context = getPipelineContext();
        if (!context.inErrorRecoveryMode()) {
            if (getTemplateCount() > 0) {
                // contentHandler will be the TransformerHandler at the head of
                // the chain. Need to call endDocument() for the transformers to
                // actually perform the transformations.
                // The DocumentEventFilter will filter the endDocument() event
View Full Code Here

        // We only look for the configuration in the pipeline config if it
        // has not been set on constuction.
        if (configuration == null) {

            // Get hold of the pipeline context
            XMLPipelineContext context = getPipelineContext();

            // Get hold of the pipeline configuration
            XMLPipelineConfiguration pipelineConfiguration =
                    context.getPipelineConfiguration();

            // Retrieve the configuration
            Configuration config =
                    pipelineConfiguration.retrieveConfiguration(
                            URLRewriteProcessConfiguration.class);

            if (config == null ||
                    !(config instanceof URLRewriteProcessConfiguration)) {
                // Cannot get hold of the configuration. As this is fatal
                // deliver a fatal error down the pipeline
                XMLPipelineException error = new XMLPipelineException(
                        "Could not retrieve the URL rewrite process " +
                        "configuration",
                        context.getCurrentLocator());

                try {
                    pipeline.getPipelineProcess().fatalError(error);
                } catch (SAXException e) {
                    // cannot continue so throw a runtime exception
View Full Code Here

    // javadoc inherited
    public void setPipeline(XMLPipeline pipeline) {
        super.setPipeline(pipeline);

        // get hold of the pipeline context
        XMLPipelineContext context = getPipelineContext();

        // get hold of the pipeline configuration
        XMLPipelineConfiguration pipelineConfiguration =
                context.getPipelineConfiguration();

        // retrieve the configuration
        Configuration config =
                pipelineConfiguration.retrieveConfiguration(
                        AbsoluteToRelativeURLConfiguration.class);

        if (config == null ||
                !(config instanceof AbsoluteToRelativeURLConfiguration)) {
            // cannot get hold of the configuration. As this is fatal
            // deliver a fatal error down the pipeline
            XMLPipelineException error = new XMLPipelineException(
                    "Could not retrieve the Absolute to Relative URL " +
                    "converter configuration",
                    context.getCurrentLocator());

            try {
                pipeline.getPipelineProcess().fatalError(error);
            } catch (SAXException e) {
                // cannot continue so throw a runtime exception
View Full Code Here

     * is compilable but there should be no difference between the results of
     * this test and that of testSimpleTransformation()
     * @throws Exception if an error occurs
     */
    public void testCompilableSimpleTransformation() throws Exception {
        XMLPipelineContext pipelineContext =
                pipelineFactory.createPipelineContext(
                        createPipelineConfiguration(),
                        createRootEnvironmentInteraction());

        DefaultTransformConfiguration config = (DefaultTransformConfiguration)
                pipelineContext.getPipelineConfiguration().
                retrieveConfiguration(TransformConfiguration.class);

        config.setTemplateCompilationRequired(true);

        doInContextTest(pipelineContext,
View Full Code Here

     * transformation is compilable but there should be no difference between
     * the results of this test and that of testSimpleTransformation()
     * @throws Exception if an error occurs
     */
    public void testCompilableSimpleTransformation2() throws Exception {
        XMLPipelineContext pipelineContext =
                pipelineFactory.createPipelineContext(
                        createPipelineConfiguration(),
                        createRootEnvironmentInteraction());

        DefaultTransformConfiguration config = (DefaultTransformConfiguration)
                pipelineContext.getPipelineConfiguration().
                retrieveConfiguration(TransformConfiguration.class);

        config.setTemplateCompilationRequired(true);

        doInContextTest(pipelineContext,
View Full Code Here

     * element is compilable but one of its child transformation elements
     * overrides it to be not compilable.
     * @throws Exception if an error occurs
     */
    public void testCompilableNestedTransformations() throws Exception {
        XMLPipelineContext pipelineContext =
                pipelineFactory.createPipelineContext(
                        createPipelineConfiguration(),
                        createRootEnvironmentInteraction());

        DefaultTransformConfiguration config = (DefaultTransformConfiguration)
                pipelineContext.getPipelineConfiguration().
                retrieveConfiguration(TransformConfiguration.class);

        config.setTemplateCompilationRequired(true);

        doInContextTest(pipelineContext,
View Full Code Here

    // javadoc inherited
    public void setPipeline(XMLPipeline pipeline) {
        super.setPipeline(pipeline);

        // get hold of the pipeline context
        XMLPipelineContext context = getPipelineContext();

        // get hold of the pipeline configuration
        XMLPipelineConfiguration pipelineConfiguration =
                context.getPipelineConfiguration();

        // retrieve the configuration
        Configuration config =
                pipelineConfiguration.retrieveConfiguration(
                        URLToURLCConfiguration.class);

        if (config == null ||
                !(config instanceof URLToURLCConfiguration)) {
            // cannot get hold of the configuration. As this is fatal
            // deliver a fatal error down the pipeline
            XMLPipelineException error = new XMLPipelineException(
                    "Could not retrieve the URL To URLC converter " +
                    "configuration",
                    context.getCurrentLocator());

            try {
                pipeline.getPipelineProcess().fatalError(error);
            } catch (SAXException e) {
                // cannot continue so throw a runtime exception
View Full Code Here

    /**
     *
     */
    public void testCache()  throws Exception {
        XMLPipelineContext pipelineContext =
                pipelineFactory.createPipelineContext(
                        createPipelineConfiguration(),
                        createRootEnvironmentInteraction());

        // extract the expression context
        ExpressionContext expresisonContext
                = pipelineContext.getExpressionContext();

        // allow subclasses to register functions that are specific to
        // their tests
        registerExpressionFunctions(expresisonContext);

View Full Code Here

    /**
     * Test that transform template caching works in a multi threaded
     * environment.
     */
    public void testCacheMultiThreaded() throws Exception {
        final XMLPipelineContext pipelineContext =
                pipelineFactory.createPipelineContext(
                        createPipelineConfiguration(),
                        createRootEnvironmentInteraction());

        DefaultTransformConfiguration config = (DefaultTransformConfiguration)
                pipelineContext.getPipelineConfiguration().
                retrieveConfiguration(TransformConfiguration.class);

        config.setTemplateCacheRequired(true);
        config.setTemplateCompilationRequired(true);

View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.XMLPipelineContext

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.