Package org.apache.cocoon.environment

Examples of org.apache.cocoon.environment.Environment


        enterEnvironment(environment);
    }

    public void skippedEntity(String name)
    throws SAXException {
        Environment environment = leaveEnvironment();
        this.consumer.skippedEntity(name);
        enterEnvironment(environment);
    }
View Full Code Here


        enterEnvironment(environment);
    }

    public void startDTD(String name, String publicId, String systemId)
    throws SAXException {
        Environment environment = leaveEnvironment();
        this.consumer.startDTD(name, publicId, systemId);
        enterEnvironment(environment);
    }
View Full Code Here

        enterEnvironment(environment);
    }

    public void endDTD()
    throws SAXException {
        Environment environment = leaveEnvironment();
        this.consumer.endDTD();
        enterEnvironment(environment);
    }
View Full Code Here

        enterEnvironment(environment);
    }

    public void startEntity(String name)
    throws SAXException {
        Environment environment = leaveEnvironment();
        this.consumer.startEntity(name);
        enterEnvironment(environment);
    }
View Full Code Here

        enterEnvironment(environment);
    }

    public void endEntity(String name)
    throws SAXException {
        Environment environment = leaveEnvironment();
        this.consumer.endEntity(name);
        enterEnvironment(environment);
    }
View Full Code Here

        enterEnvironment(environment);
    }

    public void startCDATA()
    throws SAXException {
        Environment environment = leaveEnvironment();
        this.consumer.startCDATA();
        enterEnvironment(environment);
    }
View Full Code Here

        enterEnvironment(environment);
    }

    public void endCDATA()
    throws SAXException {
        Environment environment = leaveEnvironment();
        this.consumer.endCDATA();
        enterEnvironment(environment);
    }
View Full Code Here

        enterEnvironment(environment);
    }

    public void comment(char ch[], int start, int len)
    throws SAXException {
        Environment environment = leaveEnvironment();
        this.consumer.comment(ch, start, len);
        enterEnvironment(environment);
    }
View Full Code Here

        }

        String contentType = null;
        ContextMap ctxMap = null;

        Environment env;
        try{
            if (uri.charAt(0) == '/') {
                uri = uri.substring(1);
            }
            // Pass uri into environment without URLDecoding, as it is already decoded.
            env = getEnvironment(uri, request, res);
        } catch (Exception e) {
            if (getLogger().isErrorEnabled()) {
                getLogger().error("Problem with Cocoon servlet", e);
            }

            manageException(request, res, null, uri,
                            HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                            "Problem in creating the Environment", null, null, e);
            return;
        }

        try {
            try {
                // Initialize a fresh log context containing the object model: it
                // will be used by the CocoonLogFormatter
                ctxMap = ContextMap.getCurrentContext();
                // Add thread name (default content for empty context)
                String threadName = Thread.currentThread().getName();
                ctxMap.set("threadName", threadName);
                // Add the object model
                ctxMap.set("objectModel", env.getObjectModel());
                // Add a unique request id (threadName + currentTime
                ctxMap.set("request-id", threadName + System.currentTimeMillis());

                if (this.cocoon.process(env)) {
                    contentType = env.getContentType();
                } else {
                    // We reach this when there is nothing in the processing change that matches
                    // the request. For example, no matcher matches.
                    getLogger().fatalError("The Cocoon engine failed to process the request.");
                    manageException(request, res, env, uri,
View Full Code Here

            environment = facade.getDelegate();
        }

        // test if this is a call from flow
        boolean isRedirect = (environment.getObjectModel().remove("cocoon:forward") == null);
        Environment newEnv = new ForwardEnvironmentWrapper(environment, this.sitemapComponentManager, uri, getLogger());
        if ( isRedirect ) {
            ((ForwardEnvironmentWrapper)newEnv).setInternalRedirect(true);
        }

        if (facade != null) {
            // Change the facade delegate
            facade.setDelegate((EnvironmentWrapper)newEnv);
            newEnv = facade;
        }

        // Get the processor that should process this request
        // (see https://issues.apache.org/jira/browse/COCOON-1990).
        ConcreteTreeProcessor processor = this;
        if (uri.startsWith("cocoon://")) {
            processor = ((TreeProcessor)getRootProcessor()).concreteProcessor;
            newEnv.changeContext("", ((TreeProcessor)getRootProcessor()).source.getURI());
        }

        // Process the redirect
        // No more reset since with TreeProcessorRedirector, we need to pop values from the redirect location
        // context.reset();
View Full Code Here

TOP

Related Classes of org.apache.cocoon.environment.Environment

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.