Examples of SessionContext


Examples of org.apache.cocoon.webapps.session.context.SessionContext

        // synchronized
        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN checkAuthentication coplet="+copletID);
        }
        boolean result = false;
        SessionContext context = this.getContext(false);
        if (context != null
            && (String)context.getAttribute(PortalManager.ATTRIBUTE_PORTAL_ROLE) != null) {

            try {
                this.getSessionManager().startReadingTransaction(context);
                Map theProfile = this.retrieveProfile(this.getProfileID(PortalManager.BUILDTYPE_VALUE_ID,
                     (String)context.getAttribute(PortalManager.ATTRIBUTE_PORTAL_ROLE),
                     (String)context.getAttribute(PortalManager.ATTRIBUTE_PORTAL_ID), false));

                if (theProfile != null) {
                    if (copletID == null || copletID.trim().length() == 0) {
                        result = true;
                    } else {
View Full Code Here

Examples of org.apache.cocoon.webapps.session.context.SessionContext

    /**
     * Get a reserved context
     */
    protected boolean existsReservedContext(String name) {
        // synchronized (not needed)
        SessionContext context = null;
        SessionContextProvider provider = (SessionContextProvider)contextProvider.get(name);
        if (provider != null) {
            if ( null != this.deliveredContexts ) {
                context = (SessionContext)this.deliveredContexts.get(name);
            }
View Full Code Here

Examples of org.apache.cocoon.webapps.session.context.SessionContext

     * Get a reserved context
     */
    protected SessionContext getReservedContext(String name)
    throws ProcessingException {
        // synchronized (not needed)
        SessionContext context = null;
        SessionContextProvider provider = (SessionContextProvider)contextProvider.get(name);
        if (provider != null) {
            if ( null != this.deliveredContexts ) {
                context = (SessionContext)this.deliveredContexts.get(name);
            }
View Full Code Here

Examples of org.apache.cocoon.webapps.session.context.SessionContext

        }
        if (name == null) {
            throw new ProcessingException("CreateContext: Name is required");
        }

        SessionContext context;
        synchronized(session) {
            // test for reserved context
            if (SessionManager.isReservedContextName(name) == true) {
                throw new ProcessingException("SessionContext with name " + name + " is reserved and cannot be created manually.");
            }

            Map contexts = this.getSessionContexts();
            if (this.existsContext(name) == true) {
                context = this.getContext(name);
            } else {
                context = new SimpleSessionContext();
                context.setup(name, loadURI, saveURI);
                contexts.put(name, context);
                this.getSessionContextsTransactionStates().put(context, new TransactionState());
            }
        }
        if (this.getLogger().isDebugEnabled() == true) {
View Full Code Here

Examples of org.apache.cocoon.webapps.session.context.SessionContext

        }

        synchronized(session) {
            final Map contexts = this.getSessionContexts();
            if (contexts.containsKey(name) == true) {
                SessionContext context = (SessionContext)contexts.get(name);
                contexts.remove(name);
                this.getSessionContextsTransactionStates().remove(context);
            }
        }
View Full Code Here

Examples of org.apache.cocoon.webapps.session.context.SessionContext

        }
        if (path == null) {
            throw new ProcessingException("SessionManager.getContextFragment: Path is required");
        }

        SessionContext context;
        if (SessionManager.isReservedContextName(contextName) == true) {
            context = this.getReservedContext(contextName);
        } else {
            Session session = this.getSession(false);
            if (session == null) {
                throw new ProcessingException("SessionManager.getContextFragment: Session is required for context " + contextName);
            }
            context = this.getContext(contextName);
        }
        if (context == null) {
            throw new ProcessingException("SessionManager.getContextFragment: Context '" + contextName + "' not found.");
        }

        DocumentFragment frag;
        frag = context.getXML(path);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END getContextFragment documentFragment=" + (frag == null ? "null" : XMLUtils.serializeNodeToXML(frag)));
        }
        return frag;
View Full Code Here

Examples of org.apache.cocoon.webapps.session.context.SessionContext

        }
        if (path == null) {
            throw new ProcessingException("SessionManager.streamContextFragment: Path is required");
        }

        SessionContext context = this.getContext(contextName);
        if (context == null) {
            throw new ProcessingException("SessionManager.streamContextFragment: Context '" + contextName + "' not found.");
        }

        streamed = context.streamXML(path, consumer, consumer);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END streamContextFragment streamed=" + streamed);
        }
        return streamed;
View Full Code Here

Examples of org.apache.cocoon.webapps.session.context.SessionContext

        if (fragment == null) {
            throw new ProcessingException("SessionManager.setContextFragment: Fragment is required");
        }

        // get context
        SessionContext context = this.getContext(contextName);

        // check context
        if (context == null) {
            throw new ProcessingException("SessionManager.setContextFragment: Context '" + contextName + "' not found.");
        }

        context.setXML(path, fragment);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END setContextFragment");
        }
    }
View Full Code Here

Examples of org.apache.cocoon.webapps.session.context.SessionContext

        if (fragment == null) {
            throw new ProcessingException("SessionManager.appendContextFragment: Fragment is required");
        }

        // get context
        SessionContext context = this.getContext(contextName);

        // check context
        if (context == null) {
            throw new ProcessingException("SessionManager.appendContextFragment: Context '" + contextName + "' not found.");
        }

        context.appendXML(path, fragment);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END appendContextFragment");
        }
    }
View Full Code Here

Examples of org.apache.cocoon.webapps.session.context.SessionContext

        if (fragment == null) {
            throw new ProcessingException("SessionManager.mergeContextFragment: Fragment is required");
        }

        // get context
        SessionContext context = this.getContext(contextName);

        // check context
        if (context == null) {
            throw new ProcessingException("SessionManager.mergeContextFragment: Context '" + contextName + "' not found.");
        }

        Node contextNode = context.getSingleNode(path);
        if (contextNode == null) {
            // no merge required
            context.setXML(path, fragment);
        } else {
            this.importNode(contextNode, fragment, false);
            context.setNode(path, contextNode);
        }

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END mergeContextFragment");
        }
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.