Package com.volantis.xml.pipeline.sax

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


        // Get the MCS content handler which will process the XDIME into
        // the target markup.
        ContentHandler mcsContentHandler =
                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();
View Full Code Here


     *
     * @param context used to get the pipeline initilization
     * @return a new pipeline, should not be null.
     */
    private XMLPipeline createPipeline(MarinerRequestContext context) {
        XMLPipelineFactory factory = getPipelineFactory(context);

        ExpressionContext expressionContext =
            MCSExpressionHelper.getExpressionContext(context);

            // create the pipeline configuration. This particular factory will
            // create a configuration based on the MCS config file.
            XMLPipelineConfiguration pipelineConfiguration =
                factory.createPipelineConfiguration();

            XMLPipelineContext pipelineContext =
                    factory.createPipelineContext(pipelineConfiguration,
                                                  expressionContext);

        return factory.createPipeline(pipelineContext);
    }
View Full Code Here

            MarinerConfiguration marinerConfiguration,
            MCSConfiguration mcsConfiguration,
            PluggableAssetTranscoder assetTranscoder) {


        XMLPipelineFactory pipelineFactory =
                XMLPipelineFactory.getDefaultInstance();
        // factor an empty XMLPipelineConfiguration instance. This is the
        // configuration that is required to run the pipeline.
        XMLPipelineConfiguration pipelineConfig =
                pipelineFactory.createPipelineConfiguration();

        PipelineConfiguration configFileInfo =
                marinerConfiguration.getPipelineConfiguration();

        // Create the caches
        final CacheProcessConfiguration cacheProcessConfiguration;
        final CacheOperationConfiguration cacheOperationConfiguration =
            configFileInfo.getCacheOperationConfiguration();
        if (cacheOperationConfiguration != null) {
            // @todo this seems a bit inefficient, iterating over the same
            // collection twice. But the collection is expected to be small.
            // Leaving for now.
            int cacheSize = calculateTotalMaxEntries(
                    cacheOperationConfiguration.getCacheConfigurations());
            cacheProcessConfiguration = new CacheProcessConfiguration();
            createCaches(cacheProcessConfiguration,
                cacheOperationConfiguration.getCacheConfigurations());
            cacheProcessConfiguration.setFixedExpiryMode(
                cacheOperationConfiguration.isFixedExpiryMode());
        } else {
            cacheProcessConfiguration = new CacheProcessConfiguration();
        }

        pipelineConfig.storeConfiguration(CacheProcessConfiguration.class,
                cacheProcessConfiguration);

        // Store the web services driver configuration in the pipeline
        // configurations class so that registration of web services
        // process' may occur.
        WSDriverConfiguration wsDriverConfiguration =
                (configFileInfo.getWsDriverConfiguration() != null)
                ? configFileInfo.getWsDriverConfiguration()
                : new WSDriverConfiguration();

        pipelineConfig.storeConfiguration(WSDriverConfiguration.class,
                wsDriverConfiguration);

        WebDriverConfiguration webDriverConfiguration =
                (configFileInfo.getWebDriverConfiguration() != null)
                ? configFileInfo.getWebDriverConfiguration()
                : WebDriverFactory.getDefaultInstance().createConfiguration();
        pipelineConfig.storeConfiguration(WebDriverConfiguration.class,
                webDriverConfiguration);

        // Store the transformation configuration in the pipeline
        // configurations class so that registration of transformation
        // process may occur. The transformation configuration determines
        // whether xslt or xsltc is used by default.

        TransformConfiguration transformConfiguration =
                (configFileInfo.getTransformConfiguration() != null)
                ? configFileInfo.getTransformConfiguration()
                : PipelineOperationFactory.getDefaultInstance().
                createTransformConfiguration();

        if(LOGGER.isInfoEnabled()){
            if(transformConfiguration.isTemplateCacheRequired()){
                LOGGER.info("transformation-cache-enabled");
            } else {
                LOGGER.info("transformation-cache-disabled");
            }
        }

        // store away the configuration for transforms
        pipelineConfig.storeConfiguration(TransformConfiguration.class,
                transformConfiguration);

        // Store the connection configuration away in the pipeline
        // configuration. This may be null if no configuration is specified
        ConnectionConfigurationImpl connectionConfiguration =
                (ConnectionConfigurationImpl)
                configFileInfo.getConnectionConfiguration();
        pipelineConfig.storeConfiguration(
                ConnectionConfiguration.class,
                connectionConfiguration);

        // Store the URLContentCache configuration if we have a connection
        // configuration.
        final URLContentCacheConfiguration urlContentCacheConfig =
            new URLContentCacheConfiguration(pipelineConfig);
        pipelineConfig.storeConfiguration(URLContentCacheConfiguration.class,
            urlContentCacheConfig);


        // Store the URL to URLC configuration in the pipeline
        // configurations instance so that registration of converter(s)
        // may occur.
        URLToURLCTuple[] tuples =
                {new URLToURLCTuple(null, "img", "url", "urlc"),
                 new URLToURLCTuple(null, "logo", "url", "urlc")};

        pipelineConfig.storeConfiguration(
                URLToURLCConfiguration.class,
                new URLToURLCConfiguration(
                        new TranscoderURLConverter(
                                assetTranscoder.getHostParameter(),
                                assetTranscoder.getPortParameter()),
                        tuples));


        // store away the configuration for the absolute to relative URL
        // converter process
        pipelineConfig.storeConfiguration(
                AbsoluteToRelativeURLConfiguration.class,
                createAbsoluteToRelativeURLConfiguration());

        // create the dynamic configuration
        DynamicProcessConfiguration dynamicConfiguration =
                pipelineFactory.createDynamicProcessConfiguration();

        // get hold of all the rules need for testing
        DynamicRuleConfigurator ruleConfigurator =
                pipelineFactory.getRuleConfigurator();

        // configure the dynamic configuration
        ruleConfigurator.configure(dynamicConfiguration);

        // add the rules that are specified via markup extensions
View Full Code Here

        // bean manages.
        PipelineInitialization pipelineInitialization =
            pageContext.getVolantisBean().getPipelineInitialization();

        // get hold of the Adapter process factory
        XMLPipelineFactory factory =
            pipelineInitialization.getPipelineFactory();

        // create the pipeline context
        XMLPipelineContext pipelineContext = null;

       ExpressionContext expressionContext = null;

        // We might already have a valid expression context set up
        expressionContext =
            MCSExpressionHelper.getExpressionContext(requestContext);

        // create the pipeline configuration. This particular factory will
        // create a configuration based on the MCS config file.
        XMLPipelineConfiguration pipelineConfiguration =
                    factory.createPipelineConfiguration();

        if (expressionContext != null) {
            // We have a valid expression context already set up for us so
            // use this when creating a new pipeline context
            pipelineContext =
                    factory.createPipelineContext(pipelineConfiguration,
                                                  expressionContext);
        } else {
            throw new IllegalStateException("No expression context set up");
//            // create a new pipeline context
//            EnvironmentInteraction rootInteraction =
//                    createRootInteraction(requestContext);
//            pipelineContext =
//                    factory.createPipelineContext(pipelineConfiguration,
//                                                  rootInteraction);
//
//            // If we are running within the context of a servlet or JSP then we
//            // must set up the expression context correctly with the servlet
//            // request and register all the template extension functions
//            pipelineContext.getExpressionContext().setProperty(
//                MarinerRequestContext.class, requestContext, false);
//
//            ExpressionSupport.registerFunctions(
//                pipelineContext.getExpressionContext());
//
//            // Store the expression context in the request context's
//            // environment context, so that any sub-requests can share the
//            // expression context.
//            MCSExpressionHelper.setExpressionContext(
//                    requestContext, pipelineContext.getExpressionContext());
        }

                // get hold of the environment context associated with the request
        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);
        } catch (SAXException se) {
            throw new ExtendedRuntimeException(se);
        }

View Full Code Here

            EnvironmentContext environmentContext,
            final DevicePolicyAccessor devicePolicyValueAccessor) {

        PipelineInitialization pipelineInitialization =
                volantisBean.getPipelineInitialization();
        XMLPipelineFactory xmlFactory =
                pipelineInitialization.getPipelineFactory();

        ExpressionFactory factory =
                xmlFactory.getExpressionFactory();

        // obtain the default EnvironmentFactory
        EnvironmentFactory environmentFactory =
                EnvironmentFactory.getDefaultInstance();
View Full Code Here

        }


        protected XMLFilter createFilter() throws Exception {

            XMLPipelineFactory factory =
                    XMLPipelineFactory.getDefaultInstance();
            XMLPipelineConfiguration configuration =
                    factory.createPipelineConfiguration();
            DynamicProcessConfiguration dynamic =
                    factory.createDynamicProcessConfiguration();
            configuration.storeConfiguration(DynamicProcessConfiguration.class,
                    dynamic);
            TemplateFactory templateFactory =
                    TemplateFactory.getDefaultInstance();
            templateFactory.getRuleConfigurator().configure(dynamic);
            URIDriverFactory uriDriverFactory =
                    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.XMLPipelineFactory

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.