Examples of TreeProcessor


Examples of org.apache.cocoon.components.treeprocessor.TreeProcessor

      throws Exception {

        Map objectModel = env.getObjectModel();

        String resolvedSource = this.source.resolve(context, objectModel);
        TreeProcessor processor = (TreeProcessor)processors.get(resolvedSource);
        if (processor == null) {
            processor = getProcessor(env, resolvedSource);
        }

        String resolvedPrefix = this.prefix.resolve(context, objectModel);

        String oldPrefix = env.getURIPrefix();
        String oldURI    = env.getURI();
        try {
            env.changeContext(resolvedPrefix, resolvedSource);

            if (context.isInternalRequest()) {
                // Propagate pipelines
                ProcessingPipeline pp = processor.processInternal(env);
                if ( pp != null ) {
                    context.setProcessingPipeline( pp );
                    return true;
                } else {
                    return false;
                }
            } else {
                // Processor will create its own pipelines
                return processor.process(env);
            }
        } finally {
            // Restore context
            env.setContext(oldPrefix, oldURI);
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.TreeProcessor

        }
    }

    private synchronized TreeProcessor getProcessor(Environment env, String source) throws Exception {

        TreeProcessor processor = (TreeProcessor)processors.get(source);

        if (processor == null) {
            // Handle directory mounts
            String actualSource;
            if (source.charAt(source.length() - 1) == '/') {
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.TreeProcessor

      throws Exception {

        List mapStack = context.getMapStack();

        String resolvedSource = this.source.resolve(mapStack);
        TreeProcessor processor = (TreeProcessor)processors.get(resolvedSource);
        if (processor == null) {
            processor = getProcessor(env, resolvedSource);
        }

        String resolvedPrefix = this.prefix.resolve(mapStack);

        String oldPrefix = env.getURIPrefix();
        String oldURI    = env.getURI();
        try {
            env.changeContext(resolvedPrefix, resolvedSource);

            if (context.isInternalRequest()) {
                // Propagate pipelines
                return processor.process(env, context.getStreamPipeline(), context.getEventPipeline());
            } else {
                // Processor will create its own pipelines
                return processor.process(env);
            }

        } finally {
            // Restore context
            env.setContext(oldPrefix, oldURI);
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.TreeProcessor

        }
    }

    private synchronized TreeProcessor getProcessor(Environment env, String source) throws Exception {
       
        TreeProcessor processor = (TreeProcessor)processors.get(source);

        if (processor == null) {
           
            // Handle directory mounts
            String actualSource;
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.TreeProcessor

        String resolvedPrefix = this.prefix.resolve(context, objectModel);

        if (resolvedSource.length() == 0) {
            throw new ProcessingException("Source of mount statement is empty");
        }
        TreeProcessor processor = getProcessor(resolvedSource);

        // Save context
        String oldPrefix = env.getURIPrefix();
        String oldURI    = env.getURI();
        String oldContext   = env.getContext();
        Object oldPassThrough = env.getAttribute(COCOON_PASS_THROUGH);
        env.setAttribute(COCOON_PASS_THROUGH, BooleanUtils.toBooleanObject(passThrough));

        boolean pipelineWasBuilt = false;

        try {
            env.changeContext(resolvedPrefix, resolvedSource);

            if (context.isBuildingPipelineOnly()) {
                // Propagate pipelines
                ProcessingPipeline pp = processor.buildPipeline(env);
                if (pp != null) {
                    context.setProcessingPipeline( pp );
                    pipelineWasBuilt = true;
                }
            } else {
                // Processor will create its own pipelines
                pipelineWasBuilt = processor.process(env);
            }
        } finally {
            // We restore the context only if no pipeline was built. This allows the pipeline
            // environment to be left unchanged when we go back to ancestor processors.
            // If no pipeline was built, we restore the context, so that the current processor
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.TreeProcessor

    }

    private synchronized TreeProcessor getProcessor(String source)
    throws Exception {

        TreeProcessor processor = (TreeProcessor) processors.get(source);
        if (processor == null) {
            // Handle directory mounts
            String actualSource;
            if (source.charAt(source.length() - 1) == '/') {
                actualSource = source + "sitemap.xmap";
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.TreeProcessor

        String resolvedPrefix = this.prefix.resolve(context, objectModel);

        if (resolvedSource.length()==0)
            throw new ProcessingException("Source of mount statement is empty");

        TreeProcessor processor = getProcessor(resolvedSource);

        String oldPrefix = env.getURIPrefix();
        String oldURI    = env.getURI();
        String oldContext   = env.getContext();
       
        try {
            env.changeContext(resolvedPrefix, resolvedSource);

            if (context.isBuildingPipelineOnly()) {
                // Propagate pipelines
                ProcessingPipeline pp = processor.buildPipeline(env);
                if ( pp != null ) {
                    context.setProcessingPipeline( pp );
                    return true;
                } else {
                    return false;
                }
            } else {
                // Processor will create its own pipelines
                return processor.process(env);
            }
        } finally {
            // Restore context
            env.setContext(oldPrefix, oldURI, oldContext);
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.TreeProcessor

        }
    }

    private synchronized TreeProcessor getProcessor(String source) throws Exception {

        TreeProcessor processor = (TreeProcessor)processors.get(source);

        if (processor == null) {
            // Handle directory mounts
            String actualSource;
            if (source.charAt(source.length() - 1) == '/') {
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.TreeProcessor

      throws Exception {

        Map objectModel = env.getObjectModel();

        String resolvedSource = this.source.resolve(context, objectModel);
        TreeProcessor processor = (TreeProcessor)processors.get(resolvedSource);
        if (processor == null) {
            processor = getProcessor(env, resolvedSource);
        }

        String resolvedPrefix = this.prefix.resolve(context, objectModel);

        String oldPrefix = env.getURIPrefix();
        String oldURI    = env.getURI();
        String oldContext   = env.getContext();
        try {
            env.changeContext(resolvedPrefix, resolvedSource);

            if (context.isInternalRequest()) {
                // Propagate pipelines
                ProcessingPipeline pp = processor.processInternal(env);
                if ( pp != null ) {
                    context.setProcessingPipeline( pp );
                    return true;
                } else {
                    return false;
                }
            } else {
                // Processor will create its own pipelines
                return processor.process(env);
            }
        } finally {
            // Restore context
      env.setContext(oldPrefix, oldURI, oldContext);
View Full Code Here

Examples of org.apache.cocoon.components.treeprocessor.TreeProcessor

        }
    }

    private synchronized TreeProcessor getProcessor(Environment env, String source) throws Exception {

        TreeProcessor processor = (TreeProcessor)processors.get(source);

        if (processor == null) {
            // Handle directory mounts
            String actualSource;
            if (source.charAt(source.length() - 1) == '/') {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.