Package com.volantis.xml.pipeline.sax

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


            // the context - this allows relative references in any
            // returned markup to be resolved.
            pipelineContext.pushBaseURI(remappedURL);

                // Create a pipeline
                XMLPipeline pipeline = pipelineFactory.createPipeline
                    (pipelineContext);
            XMLFilter filter = pipelineFactory.createPipelineFilter(
                    pipeline, true);

            // Create a serializer that will output to the response.
            ServletOutputStream outputStream = httpResponse.getOutputStream();
            XMLSerializer serializer = getSerializer(outputStream);
            filter.setContentHandler(serializer.asContentHandler());

            // Create and initialise the request process.
            HTTPRequestOperationProcess requestOperation =
                    new HTTPRequestOperationProcess();
            requestOperation.setFollowRedirects(
                    Boolean.toString(webdConfig.getFollowRedirects()));
            requestOperation.setUrlString(remappedURL);
            requestOperation.setRequestType(HTTPRequestType.GET);
            // todo this is wrong as the request operation timeout is in
            // todo seconds but the configuration is in milliseconds.
            Period timeout = Period.treatNonPositiveAsIndefinitely(
                    webdConfig.getTimeoutInMillis());
            requestOperation.setTimeout(timeout);

            // This is necessary in order for the request process to be
            // able to pick up the headers, parameters, cookies etc.
            WebDriverAccessor webdAccessor = createWebDriverAccessor(
                    createWebDriverRequest(httpRequest,
                                           marinerRequestContext,
                                           remoteProjectName,
                                           urlRemapper),
                    new WebDriverResponseImpl());
            pipelineContext.setProperty(WebDriverAccessor.class,
                    webdAccessor , false);

            ProxySessionIdOperationProcess proxySessionOperationProcess =
                    new ProxySessionIdOperationProcess();

            XMLProcess urlRewriterProcess =
                    createURLRewriterProcess(httpRequest.getContextPath(),
                                             urlRemapper);

            // Add them to the pipeline, which will start the processes.
            if (transformURL != null) {
                AttributesImpl atts = new AttributesImpl();
                atts.addAttribute("", "href", "href", "string", transformURL);

                pipeline.getPipelineProcess().startElement(Namespace.PIPELINE.getURI(),
                                                       "transform",
                                                       "transform",
                                                       atts);
            }
            pipeline.addHeadProcess(urlRewriterProcess);
            pipeline.addHeadProcess(proxySessionOperationProcess);
            pipeline.addHeadProcess(requestOperation);

            // Removing them from the pipeline will stop the processes.
            pipeline.removeHeadProcess();
            pipeline.removeHeadProcess();
            pipeline.removeHeadProcess();
            if (transformURL != null) {
                pipeline.getPipelineProcess().endElement(Namespace.PIPELINE.getURI(),
                                                       "transform",
                                                       "transform");
            }

            // FLush and close the stream.
View Full Code Here


                MarlinSAXHelper.getContentHandler(requestContext);

        XMLPipelineFactory factory = getPipelineFactory(requestContext);

        // Create a pipeline for the pipeline filter.
        XMLPipeline pipeline = createPipeline(requestContext);

        // get the ContextUpdatingProcess, this will make sure that the
        // name spaces are pushed onto the namespace tracker during
        // the replay.
        XMLProcess contextUpdatingProcess = factory.createContextUpdatingProcess();

        pipeline.addHeadProcess(contextUpdatingProcess);

        XMLPipelineFilter mcsFilter = factory.createPipelineFilter(pipeline);

        mcsFilter.setContentHandler(mcsContentHandler);

        // Replay the SAX events into the pipeline.
        PipelinePlayer player = recording.createPlayer();
        player.play(pipeline.getPipelineProcess());
    }
View Full Code Here

        EnvironmentContext environmentContext =
                ContextInternals.getEnvironmentContext(requestContext);

        environmentContext.initalisePipelineContextEnvironment(pipelineContext);

      XMLPipeline pipeline = factory.createDynamicPipeline(pipelineContext);
      // create the pipeline fiter
      XMLPipelineFilter pipelineFilter = null;
        try {
            pipelineFilter =
            factory.createPipelineFilter(pipeline);
View Full Code Here

                    URIDriverFactory.getDefaultInstance();
            uriDriverFactory.getRuleConfigurator().configure(dynamic);

            XMLPipelineContext context = factory.createPipelineContext(
                    configuration, (EnvironmentInteraction) null);
            XMLPipeline pipeline = factory.createDynamicPipeline(context);
            return factory.createPipelineFilter(pipeline);
        }
View Full Code Here

TOP

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

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.