Package org.apache.cocoon.environment

Examples of org.apache.cocoon.environment.Session


            this.getLogger().debug("BEGIN processInputFields");
        }

        final String formName = this.request.getParameter(SessionConstants.SESSION_FORM_PARAMETER);
        if ( null != formName ) {
            final Session session = this.getSession(false);
            if (session != null) {
                synchronized(session) {
                    final Map inputFields = (Map)session.getAttribute(SessionManager.ATTRIBUTE_INPUTXML_STORAGE);
                    if (inputFields != null) {
                        final Enumeration keys = this.request.getParameterNames();
                        String   currentKey;
                        Object[] contextAndPath;
View Full Code Here


    throws ProcessingException {
        SessionContext context;
        if (SessionManager.isReservedContextName(name) == true) {
            context = this.getReservedContext(name);
        } else {
            Session session = this.getSession(false);
            if (session == null) {
                throw new ProcessingException("SessionManager.getContext: Session is required.");
            }
            synchronized (session) {
                final Map contexts = this.getSessionContexts();
View Full Code Here

    /**
     * Check if a context exists
     */
    public synchronized boolean hasSessionContext()
    throws ProcessingException {
        Session session = this.getSession(false);
        if (session == null) {
            throw new ProcessingException("SessionManager.hasSessionContext: Session is required.");
        }
        synchronized (session) {
            final Map contexts = this.getSessionContexts();
View Full Code Here

     *  If the session context with the given name exists, <CODE>true</CODE> is
     *  returned.
     */
    public synchronized boolean existsContext(String name)
    throws ProcessingException {
        Session session = this.getSession(false);
        if (session == null) {
            throw new ProcessingException("SessionManager.existsContext: Session is required.");
        }
        synchronized (session) {
            final Map contexts = this.getSessionContexts();
View Full Code Here

     */
    public Handler getHandler(String handlerName,
                              Request request) {
        if ( null == handlerName) return null;
        if ( null == this.userHandlers) {
            final Session session = request.getSession(false);
            if ( null != session) {
                this.userHandlers = (Map)session.getAttribute(SESSION_ATTRIBUTE_HANDLERS);
            }
        }
        Handler handler = null;
        if ( null != this.userHandlers) {
            handler = (Handler)this.userHandlers.get(handlerName);
View Full Code Here

    /**
     * Create a handler copy for the user and return it!
     */
    public Handler storeUserHandler(Handler handler,
                                    Request request) {
        final Session session = request.getSession();
        if ( null == this.userHandlers) {
            this.userHandlers = (Map)session.getAttribute(SESSION_ATTRIBUTE_HANDLERS);
        }
        if ( null == this.userHandlers ) {
            this.userHandlers = new HashMap(3);
        }
        handler = handler.copy();
        this.userHandlers.put(handler.getName(), handler);
        // value did change, update attributes
        session.setAttribute(SESSION_ATTRIBUTE_HANDLERS, this.userHandlers);

        return handler;
    }
View Full Code Here

    /**
     * Remove from user handler
     */
    public void removeUserHandler(Handler handler, Request request) {
        final Session session = request.getSession();
        if ( null == this.userHandlers) {
            this.userHandlers = (Map)session.getAttribute(SESSION_ATTRIBUTE_HANDLERS);
        }
        if ( null != this.userHandlers) {
            this.userHandlers.remove( handler.getName() );
            // value did change, update attributes
            session.setAttribute(SESSION_ATTRIBUTE_HANDLERS, this.userHandlers);
        }
    }
View Full Code Here

    /**
     * Check, if a user handler is available (= is authenticated)
     */
    public boolean hasUserHandler(String name, Request request) {
        if ( null == this.userHandlers) {
            final Session session = request.getSession(false);
            if ( null != session) {
                this.userHandlers = (Map)session.getAttribute(SESSION_ATTRIBUTE_HANDLERS);
            }
        }
        if ( null != this.userHandlers) {
            return this.userHandlers.containsKey( name );
        }
View Full Code Here

    /**
     * Check, if any handler is available
     */
    public boolean hasUserHandler(Request request) {
        if ( null == this.userHandlers) {
            final Session session = request.getSession(false);
            if ( null != session) {
                this.userHandlers = (Map)session.getAttribute(SESSION_ATTRIBUTE_HANDLERS);
            }
        }
        if ( null != this.userHandlers) {
            return !this.userHandlers.isEmpty();
        }
View Full Code Here

        String folderName = request.getParameter("folder");
        String userid = request.getParameter("mail-userid");
        String password = request.getParameter("mail-password");

        // assert mailContext is available
        Session session = request.getSession(true);
        MailContext mailContext = (MailContext) session.getAttribute(MailContext.SESSION_MAIL_CONTEXT);
        if (mailContext == null) {
            // no mailContext is yet available
            // create it and put it into http-session
            mailContext = new MailContextHttpSession(null);
            mailContext.enableLogging(getLogger());
            session.setAttribute(MailContext.SESSION_MAIL_CONTEXT, mailContext);
        }

        // assert mailSession is available
        javax.mail.Session mailSession = null;
        Store mailStore = null;
View Full Code Here

TOP

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

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.