Package org.apache.jetspeed.portalsite

Examples of org.apache.jetspeed.portalsite.PortalSiteRequestContext


                // 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, principal.getName(), 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);

                // get profiled page from portalsite request context
                // and save profile locators map; accessing the request
                // context here and in subsequent valves/decorators
                // latently selects the page and builds menus from the
                // user site view using the request context locators;
                // the managed page accesed here is the raw selected page
                // as returned by the PageManager component; accessing
                // the managed page here selects the current page for the
                // request
                request.setPage(new ContentPageImpl(requestContext.getManagedPage()));
                request.setProfileLocators(requestContext.getLocators());
               
                request.setAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE,getPageActionAccess(request));               
            }

            // continue
View Full Code Here


                resultMap.put(REASON, "Missing required '" + MENU_NAME + "' parameter");
                return success;
            }

            // get request context
            PortalSiteRequestContext siteRequestContext = (PortalSiteRequestContext)requestContext.getAttribute(ProfilerValveImpl.PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY);
            if (siteRequestContext == null)
            {
                success = false;
                resultMap.put(REASON, "Missing portal site request context from ProfilerValve");
                return success;
            }

            // get request locale
            Locale locale = requestContext.getLocale();

            // get menu definition
            Menu menuDefinition = null;
            try
            {
                menuDefinition = siteRequestContext.getMenu(menuName);
            }
            catch (NodeNotFoundException nnfe)
            {
            }
            if (menuDefinition == null)
View Full Code Here

                resultMap.put(REASON, "Insufficient access to get menus");
                return success;
            }

            // get request context
            PortalSiteRequestContext siteRequestContext = (PortalSiteRequestContext)requestContext.getAttribute(ProfilerValveImpl.PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY);
            if (siteRequestContext == null)
            {
                success = false;
                resultMap.put(REASON, "Missing portal site request context from ProfilerValve");
                return success;
            }

            // get menu names
            Set standardMenuNames = siteRequestContext.getStandardMenuNames();
            Set customMenuNames = null;
            try
            {
                customMenuNames = siteRequestContext.getCustomMenuNames();
            }
            catch (NodeNotFoundException nnfe)
            {
            }
View Full Code Here

                // 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);

                // get profiled page from portalsite request context
                // and save profile locators map; accessing the request
                // context here and in subsequent valves/decorators
                // latently selects the page and builds menus from the
                // user site view using the request context locators;
                // the managed page accesed here is the raw selected page
                // as returned by the PageManager component; accessing
                // the managed page here selects the current page for the
                // request
                request.setPage(new ContentPageImpl(requestContext.getManagedPage()));
                request.setProfileLocators(requestContext.getLocators());
               
                request.setAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE,getPageActionAccess(request));               
            }

            // continue
View Full Code Here

            {
                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

                page = retrievePage(requestContext, pageName);
            }
            resultMap.put(STATUS, status);
            resultMap.put(PAGE, page);
           
            PortalSiteRequestContext siteRequestContext = (PortalSiteRequestContext)requestContext.getAttribute(ProfilerValveImpl.PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY);
            if (siteRequestContext == null)
            {
                success = false;
                resultMap.put(REASON, "Missing portal site request context from ProfilerValve");
                return success;
            }
           
            resultMap.put(PROFILED_PATH, siteRequestContext.getPage().getPath() )// requestContext.getPath());
            putSecurityInformation(resultMap, page);                       
            String fragments = getActionParameter(requestContext, FRAGMENTS);
            if (fragments == null)
            {
                resultMap.put(FRAGMENTS, "true");
View Full Code Here

                resultMap.put(REASON, "Missing required '" + MENU_NAME + "' parameter");
                return success;
            }

            // get request context
            PortalSiteRequestContext siteRequestContext = (PortalSiteRequestContext)requestContext.getAttribute(ProfilerValveImpl.PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY);
            if (siteRequestContext == null)
            {
                success = false;
                resultMap.put(REASON, "Missing portal site request context from ProfilerValve");
                return success;
            }

            // get request locale
            Locale locale = requestContext.getLocale();

            // get menu definition
            Menu menuDefinition = null;
            try
            {
                menuDefinition = siteRequestContext.getMenu(menuName);
            }
            catch (NodeNotFoundException nnfe)
            {
            }
            if (menuDefinition == null)
View Full Code Here

            {
                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

                // 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);

                // get profiled page from portalsite request context
                // and save profile locators map; accessing the request
                // context here and in subsequent valves/decorators
                // latently selects the page and builds menus from the
                // user site view using the request context locators;
                // the managed page accesed here is the raw selected page
                // as returned by the PageManager component; accessing
                // the managed page here selects the current page for the
                // request
                request.setPage(new ContentPageImpl(requestContext.getManagedPage()));
                request.setProfileLocators(requestContext.getLocators());
               
                request.setAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE,getPageActionAccess(request));               
            }

            // continue
View Full Code Here

                pageDecoratorName = page.getDefaultDecorator( LAYOUT );
            }
            if ( pageDecoratorName != null )
                resultMap.put( DEFAULT_LAYOUT, pageDecoratorName );
                   
            PortalSiteRequestContext siteRequestContext = (PortalSiteRequestContext)requestContext.getAttribute( ProfilerValveImpl.PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY );
            if ( siteRequestContext == null )
            {
                success = false;
                resultMap.put( REASON, "Missing portal site request context from ProfilerValve" );
                return success;
            }
           
            String profiledPath = siteRequestContext.getPage().getPath();
            resultMap.put( PROFILED_PATH, profiledPath );
            putSecurityInformation( resultMap, page );
    
            PageActionAccess pageActionAccess = (PageActionAccess)requestContext.getAttribute( PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE );
            Boolean userIsAnonymous = Boolean.TRUE;
View Full Code Here

TOP

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

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.