Package org.apache.jetspeed.portalsite

Examples of org.apache.jetspeed.portalsite.PortalSiteSessionContext


                // during the session so the session view of the site can
                // be cached unless locators do change; if the context
                // is invalid, (perhaps because the session was persisted
                // and is now being reloaded in a new server), it must be
                // replaced with a newly created session context
                PortalSiteSessionContext sessionContext = (PortalSiteSessionContext)request.getSessionAttribute(PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY);
                String pipeline = request.getPipeline().getName();
                if ((sessionContext == null) || !sessionContext.isValid())
                {
                    sessionContext = portalSite.newSessionContext();
                    sessionContext.setPipeline(pipeline);
                    request.setSessionAttribute(PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY, sessionContext);
                }

                // construct and save a new portalsite request context
                // using session context, locators map, fallback, and
                // folder page histories; the request context uses the
                // locators to initialize or resets the session context if
                // locators have changed for this request; the request
                // context also acts as a short term request cache for the
                // selected page and built menus; however, creating the
                // request context here does not select the page or build
                // menus: that is done when the request context is
                // accessed subsequently
                PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, requestFallback, useHistory);
                request.setAttribute(PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY, requestContext);

                // additionally save request context under legacy key
                // to support existing decorator access
                request.setAttribute(PROFILED_PAGE_CONTEXT_ATTR_KEY, requestContext);
View Full Code Here


            if ( locator != null )
            {
                locators = new HashMap();
                locators.put(ProfileLocator.PAGE_LOCATOR, locator);
            }              
            PortalSiteSessionContext sessionContext = (PortalSiteSessionContext)getSessionAttribute(ProfilerValveImpl.PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY);
            PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, true, true);
            ContentPage cpage = new ContentPageImpl(requestContext.getManagedPage());
            //System.out.println("page is " + cpage.getPath());
            this.setPage(realPage);           
            this.setPath(pathSave);
            return cpage;
View Full Code Here

        // cached in the session because the session view does
        // not frequently change; if the context is invalid,
        // (perhaps because the session was persisted and is
        // now being reloaded in a new server), it must be
        // replaced with a newly created session context
        PortalSiteSessionContext sessionContext = (PortalSiteSessionContext)request.getSessionAttribute(PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY);
        if ((sessionContext == null) || !sessionContext.isValid())
        {
            sessionContext = portalSite.newSessionContext();
            request.setSessionAttribute(PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY, sessionContext);
        }

        // construct and save a new portal site request context
        // using session context, fallback, and folder page
        // histories; the request context acts as a short term
        // request cache for the selected page and built menus;
        // however, creating the request context here does not
        // select the page or build menus: that is done when the
        // request context is accessed subsequently
        String requestServerName = ((request.getRequest() != null) ? request.getRequest().getServerName() : null);
        PortalSiteRequestContext requestContext = sessionContext.newRequestContext(requestPath, requestServerName, requestUserPrincipal.getName(), requestFallback, useHistory, true);

        // save request context and set request page from portal
        // site request context
        setRequestPage(request, requestPath, requestContext);
    }
View Full Code Here

            // during the session so the session view of the site can
            // be cached unless locators do change; if the context
            // is invalid, (perhaps because the session was persisted
            // and is now being reloaded in a new server), it must be
            // replaced with a newly created session context
            PortalSiteSessionContext sessionContext = (PortalSiteSessionContext)request.getSessionAttribute(PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY);
            if ((sessionContext == null) || !sessionContext.isValid())
            {
                sessionContext = portalSite.newSessionContext();
                request.setSessionAttribute(PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY, sessionContext);
            }

            // construct and save a new portal site request context
            // using session context, locators map, fallback, and
            // folder page histories; the request context uses the
            // locators to initialize or resets the session context if
            // locators have changed for this request; the request
            // context also acts as a short term request cache for the
            // selected page and built menus; however, creating the
            // request context here does not select the page or build
            // menus: that is done when the request context is
            // accessed subsequently
            String pipeline = request.getPipeline().getName();
            boolean forceReservedFoldersVisible = (pipeline.equals(PortalReservedParameters.CONFIG_PIPELINE_NAME) ||
                                                   pipeline.equals(PortalReservedParameters.DESKTOP_CONFIG_PIPELINE_NAME));
            PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, requestUserPrincipal.getName(), requestFallback, useHistory, forceReservedFoldersVisible, true);

            // save request context and set request page from portal
            // site request context
            setRequestPage(request, requestPath, requestContext);
        }
View Full Code Here

            if ( locator != null )
            {
                locators = new HashMap();
                locators.put(ProfileLocator.PAGE_LOCATOR, locator);
            }              
            PortalSiteSessionContext sessionContext = (PortalSiteSessionContext)getSessionAttribute(ProfilerValveImpl.PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY);
            String userPrincipal = ((getUserPrincipal() != null) ? getUserPrincipal().getName() : null);
            PortalSiteRequestContext requestContext = sessionContext.newRequestContext(locators, userPrincipal, true, true);
            BaseFragmentsElement managedPageOrTemplate = requestContext.getManagedPageOrTemplate();
            PageTemplate managedPageTemplate = requestContext.getManagedPageTemplate();
            Map managedFragmentDefinitions = requestContext.getManagedFragmentDefinitions();
            ContentPage cpage = pageLayoutComponent.newContentPage(managedPageOrTemplate, managedPageTemplate, managedFragmentDefinitions);
            //System.out.println("page is " + cpage.getPath());
View Full Code Here

            locators.put(ProfileLocator.PAGE_LOCATOR, profiler.getProfile(request, ProfileLocator.PAGE_LOCATOR));
        }

        // get new portal site request context from portal site
        // component using the profile locators for new user request
        PortalSiteSessionContext sessionContext = portalSite.newSessionContext();
        return sessionContext.newRequestContext(locators, user.getName());
    }   
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.portalsite.PortalSiteSessionContext

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.