Package com.volantis.xml.pipeline.sax

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


        };

        serverMock.addTransaction(null, response);

            XMLPipelineConfiguration config = createPipelineConfiguration();
            XMLPipelineContext context =
                pipelineFactory.createPipelineContext(config,
                            createRootEnvironmentInteraction());

            WebDriverAccessor accessor = createWebDriverAccessor();

            context.setProperty(WebDriverAccessor.class, accessor, false);

            doInContextTest(context,
                            "IgnoreErroredContentWhenDisabledTestCase.input.xml",
                            "IgnoreErroredContentWhenDisabledTestCase.expected.xml");
View Full Code Here


            XMLPipelineConfiguration config = createPipelineConfiguration();
            // need to enable ignore mime type feature if we want the ignored
            // content to be saved to the response
            retrieveWebdConfiguration(config).setIgnoreContentEnabled(true);
            XMLPipelineContext context =
                pipelineFactory.createPipelineContext(config,
                            createRootEnvironmentInteraction());

            WebDriverAccessor accessor = createWebDriverAccessor();

            context.setProperty(WebDriverAccessor.class, accessor, false);

            doInContextTest(context,
                            "IgnoreContentForMimeTypeTestCase.input.xml",
                            "IgnoreContentForMimeTypeTestCase.expected.xml");
View Full Code Here

        };

        serverMock.addTransaction(null, response);

            XMLPipelineConfiguration config = createPipelineConfiguration();
            XMLPipelineContext context =
                pipelineFactory.createPipelineContext(config,
                            createRootEnvironmentInteraction());

            WebDriverAccessor accessor = createWebDriverAccessor();

            context.setProperty(WebDriverAccessor.class, accessor, false);

            doInContextTest(context,
                            "IgnoreContentForMimeTypeTestCase.input.xml",
                            "IgnoreContentForMimeTypeTestCase.expected.xml");
View Full Code Here

            XMLPipelineConfiguration config = createPipelineConfiguration();
            WebDriverConfiguration webdConf = retrieveWebdConfiguration(config);

            webdConf.setResponseContainsPipelineMarkup(true);
            XMLPipelineContext context =
                pipelineFactory.createPipelineContext(config,
                                    createRootEnvironmentInteraction());
            context.setProperty(HTTPResponsePreprocessor.class,
                                new HTTPResponsePreprocessor() {
                    public void preprocessResponse(HTTPMessageEntities headers,
                                                       HTTPMessageEntities cookies,
                            int statusCode) {
                            // create a content type header in order to perform a
                            // lookup
                            Header contentType =
                                    HTTPFactory.getDefaultInstance()
                                    .createHeader("Content-Type");

                            // retrieve all the contentType headers
                        Header[] headerArray = (Header[]) headers.retrieve(contentType.getIdentity());

                            // change all contentType headers
                            for (int i = 0; i < headerArray.length; i++) {
                                contentType = headerArray[i];
                                contentType.setValue("text/xml");
                            }
                        }
                    }, false);
            WebDriverAccessor accessor = createWebDriverAccessor();
            context.setProperty(WebDriverAccessor.class, accessor, false);

            doInContextTest(context,
                            "SimpleGetTestCase.input.xml",
                            "SimpleGetTestCase.expected.xml");
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();

        configuration = (TransformConfiguration)
                pipelineConfiguration.retrieveConfiguration(
                        TransformConfiguration.class);

        if (configuration == null) {
            // 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 transform configuration",
                    context.getCurrentLocator());

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

     */
    private Templates createTemplates(String absoluteURI, boolean isCompilable)
            throws IOException, SAXException, TransformerConfigurationException {

        // Get the URLContent manager.
        final XMLPipelineContext context = getPipelineContext();
        URLContentManager manager = PipelineURLContentManager.retrieve(context);

        // Get the content of the template, no timeout is supplied as there
        // is no way to specify an operation specific timeout so it uses the
        // default one associated with the manager.
View Full Code Here

     */
    public void unloadTemplatesHandler(Boolean compilable,
                                       boolean transformation)
            throws SAXException {

        XMLPipelineContext context = getPipelineContext();
        if (null == templatesHandler && !context.inErrorRecoveryMode()) {
            throw new IllegalStateException("No templates handler to unload");
        }

        if (templatesHandler != null) {
            templatesHandler.endDocument();
View Full Code Here

            } else {
                // The compilable attribute was not present in this element so
                // if this is a transformation element we'll check the parent
                // transform element.
                if (transformation) {
                    XMLPipelineContext pipelineContext = getPipelineContext();
                    Object o = pipelineContext.getProperty("TransformOperation");
                    if (o != null) {
                        isCompilable = ((Boolean) o).booleanValue();
                    }
                }
            }
View Full Code Here

     * the correct value for the compilable attribute is used by the nested
     * elements.
     */
    public void pushCompilableAttribute(Boolean compilable) {

        XMLPipelineContext pipelineContext = getPipelineContext();
        Object o = pipelineContext.getProperty("TransformOperation");
        if (o != null) {
            // There is a transform element surrounding this one.
            outerCompilable = (Boolean) o;
        } else {
            // There is no transform element outside of this one
            outerCompilable = null;
        }

        pipelineContext.setProperty("TransformOperation", compilable, false);
    }
View Full Code Here

     * elements.
     */
    public void popCompilableAttribute() {
        // Restore the value of the compilable attribute for the OUTER transform
        // element to the XMLPipelineContext
        XMLPipelineContext pipelineContext = getPipelineContext();
        pipelineContext.setProperty(
                "TransformOperation", outerCompilable, false);

    }
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.