Package org.apache.jetspeed.om.page

Examples of org.apache.jetspeed.om.page.ContentPage


     *
     * @return Unique Portlet Entity ID
     */
    public void build( RequestContext context ) throws JetspeedException, IOException
    {
        ContentPage page = context.getPage();
        if (null == page)
        {
            throw new JetspeedException("Failed to find PSML Pin ContentPageAggregator.build");
        }
        ContentFragment root = page.getRootContentFragment();
        if (root == null)
        {
            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
        // handle maximized state
View Full Code Here


     *
     * @return Unique Portlet Entity ID
     */
    public void build( RequestContext context ) throws JetspeedException, IOException
    {
        ContentPage page = context.getPage();
        if (null == page)
        {
            throw new JetspeedException("Failed to find PSML Pin ContentPageAggregator.build");
        }
        ContentFragment root = page.getRootContentFragment();
        if (root == null)
        {
            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
        // handle maximized state
View Full Code Here

    {
        try
        {
            String pathSave = this.getPath();          
            this.setPath(nonProfiledPath);
            ContentPage realPage = this.getPage();
            this.setPage(null);               
            Map locators = null;
            ProfileLocator locator = profiler.getProfile(this, ProfileLocator.PAGE_LOCATOR);
            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

        int configModeIndex = actionTemplates.indexOf(CONFIG_MODE_TEMPLATE);
        if (configModeIndex != -1)
        {
            try
            {
                ContentPage page = rc.getPage();
                page.checkAccess(JetspeedActions.CONFIG);
            }
            catch (SecurityException e)
            {
                actionTemplates.remove(configModeIndex);
            }
        }
       
        int editDefaultsModeIndex = actionTemplates.indexOf(EDIT_DEFAULTS_MODE_TEMPLATE);
        if (editDefaultsModeIndex != -1)
        {
            try
            {
                ContentPage page = rc.getPage();
                page.checkAccess(JetspeedActions.EDIT_DEFAULTS);
            }
            catch (SecurityException e)
            {
                actionTemplates.remove(editDefaultsModeIndex);
            }
View Full Code Here

        if (isAjaxRequest)
        {
            requestContext.setAttribute(IS_AJAX_DECORATION_REQUEST, new Boolean(true));
        }

        ContentPage page = requestContext.getPage();

        // Globaly override all psml themes if override session attribute has been set
        if (requestContext
                .getSessionAttribute(PortalReservedParameters.PAGE_THEME_OVERRIDE_ATTRIBUTE) != null)
        {
            String decoratorName = (String) requestContext
                    .getSessionAttribute(PortalReservedParameters.PAGE_THEME_OVERRIDE_ATTRIBUTE);
            page.setDefaultDecorator(decoratorName, Fragment.LAYOUT);
        }
       
        PageActionAccess pageActionAccess = (PageActionAccess)requestContext.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
        String themeCacheKey = null;
        ContentCacheKey themeContentCacheKey = null;
        Theme theme = null;
       
        if (useCache())
        {
            if (pageActionAccess.isEditing() == false)
            {
                // user helps us with the funky way jetspeed doesn't create  a new session on login
                if (this.useSessionForThemeCaching)
                {
                    themeCacheKey = cache.createSessionKey(requestContext);
                    theme = (Theme) requestContext.getSessionAttribute(themeCacheKey);
                }
                else
                {
                    themeContentCacheKey = cache.createCacheKey(requestContext, page.getId());
                    CacheElement themeCacheElem = cache.get(themeContentCacheKey);
                   
                    if (themeCacheElem != null)
                    {
                        theme = (Theme) themeCacheElem.getContent();
                    }
                }
            }
        }

        if (theme != null)
        {
            theme.init(page, decorationFactory, requestContext);
            requestContext.setAttribute(PortalReservedParameters.PAGE_THEME_ATTRIBUTE, theme);
            boolean solo = isSoloMode(requestContext);           
            SessionPathResolverCache sessionPathResolver = new SessionPathResolverCache( requestContext.getRequest().getSession() );
            initDepthFragmentDecorations(requestContext, theme, page.getRootContentFragment(),
                                                    pageActionAccess, isAjaxRequest,
                                                    ((DecorationFactoryImpl) decorationFactory).getResourceValidator(),
                                                    sessionPathResolver, (theme.isInvalidated() && !solo));
           
            if (theme.isInvalidated() && !solo)
            {
                if (this.useSessionForThemeCaching)
                {
                    requestContext.setSessionAttribute(themeCacheKey, theme);
                }
                else
                {                   
                    CacheElement themeCacheElem = cache.createElement(themeContentCacheKey, theme);
                    cache.put(themeCacheElem);
                }
                theme.setInvalidated(false);                           
            }                       
            return;
        }
        theme = decorationFactory.getTheme(page, requestContext);       
        requestContext.setAttribute(PortalReservedParameters.PAGE_THEME_ATTRIBUTE, theme);
        if ( fragments == null || fragments.size() == 0 )
        {
            ContentFragment rootFragment = page.getRootContentFragment();
            initDepthFragments(requestContext, theme, rootFragment, pageActionAccess, isAjaxRequest, fragments);
        }
        else
        {
            Iterator fragmentsIter = fragments.iterator();
            while ( fragmentsIter.hasNext() )
            {
                ContentFragment fragment = (ContentFragment)fragmentsIter.next();
                initFragment(requestContext, theme, fragment, pageActionAccess, isAjaxRequest);
            }
        }
       
        if (useCache() && !isSoloMode(requestContext))
        {
            if (themeContentCacheKey == null && themeCacheKey == null)
            {
                if (this.useSessionForThemeCaching)
                {
                    themeCacheKey = cache.createSessionKey(requestContext);                   
                    requestContext.getRequest().getSession().removeAttribute(themeCacheKey);
                }
                else
                {
                    themeContentCacheKey = cache.createCacheKey(requestContext, page.getId());
                    cache.remove(themeContentCacheKey);
                }               
            }
            else
            {
                if (this.useSessionForThemeCaching)
                {
                    themeContentCacheKey = cache.createCacheKey(requestContext, page.getId());
                    requestContext.setSessionAttribute(themeCacheKey, theme);
                }
                else
                {
                    CacheElement themeCacheElem = cache.createElement(themeContentCacheKey, theme);
View Full Code Here

                {
                    PortletWindowSessionNavigationalStates sessionStates = (PortletWindowSessionNavigationalStates)session.getAttribute(NavigationalState.NAVSTATE_SESSION_KEY);
                    if ( sessionStates != null )
                    {
                        sessionStates.removeFromCache(context, clearCacheWindowId, cache);
                        ContentPage page = context.getPage();
                        sessionStates.removeFromCache(context, page.getId(), decorationCache);                       
                    }
                }
            }
        }
        else
View Full Code Here

    }

    protected void clearPortletCacheForPage(RequestContext request, PortletWindow actionWindow)
    throws JetspeedException
    {
        ContentPage page = request.getPage();
        if (null == page)
        {
            throw new JetspeedException("Failed to find PSML Pin ContentPageAggregator.build");
        }
        ContentFragment root = page.getRootContentFragment();
        if (root == null)
        {
            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
        if (!isNonStandardAction(actionWindow))
        {
            notifyFragments(root, request, page);
           
            // if the fragment is rendered from a decorator template, the target cache would not be cleared by the above notification.
            // so, let's clear target cache of action window directly again.
            String fragmentId = actionWindow.getId().toString();
            if (page.getFragmentById(fragmentId) == null)
            {
                clearTargetCache(fragmentId, request);
            }
        }
        else
        {
            ContentFragment fragment = page.getContentFragmentById(actionWindow.getId().toString());
           
            if (fragment != null)
            {
                clearTargetCache(fragment, request);
            }
View Full Code Here

        String status = "success";
        try
        {
            resultMap.put( ACTION, action );
           
            ContentPage page = requestContext.getPage();
           
            // Get the necessary parameters off of the request
            ArrayList getActionsForFragments = new ArrayList();
            String[] portletIds = requestContext.getRequest().getParameterValues( PORTLETID );
            if ( portletIds != null && portletIds.length > 0 )
            {
                for ( int i = 0 ; i < portletIds.length ; i++ )
                {
                    String portletId = portletIds[ i ];
                    ContentFragment fragment = (ContentFragment)page.getFragmentById( portletId );
                    if ( fragment == null )
                    {
                        throw new Exception("fragment not found for specified portlet id: " + portletId);
                    }
                    getActionsForFragments.add( fragment );
                }
                getActionsForFragments.add( page.getRootContentFragment() );
            }

            // Run the Decoration valve to get actions
            decorationValve.initFragments( requestContext, true, getActionsForFragments );
           
View Full Code Here

     *
     * @return Unique Portlet Entity ID
     */
    public void build( RequestContext context ) throws JetspeedException, IOException
    {
        ContentPage page = context.getPage();
        if (null == page)
        {
            throw new JetspeedException("Failed to find PSML Pin ContentPageAggregator.build");
        }
        ContentFragment root = page.getRootContentFragment();
        if (root == null)
        {
            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
        // handle maximized state
View Full Code Here

            {
                throw new Exception("fragment id not provided");
            }
            resultMap.put(FRAGMENTID, fragmentId);
           
            ContentPage page = requestContext.getPage();           
            ContentFragment fragment = page.getContentFragmentById(fragmentId);
           
            if ( fragment == null )
            {
              throw new Exception( "fragment specified by id cannot be found" );
            }
            String requestedState = getActionParameter(requestContext, WINDOW_STATE);
            String requestedMode = getActionParameter(requestContext, PORTLET_MODE);   
            if ( "layout".equals( fragment.getType() ) )
            {
              if ( ! fragment.getId().equals( page.getRootFragment().getId() ) )
              {
                throw new Exception( "for layout fragments, change action applies to only to the root layout fragment (i.e. it does not apply to nested layout fragments)" );
              }
              PageActionAccess pageActionAccess = (PageActionAccess)requestContext.getAttribute( PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE );
              if ( pageActionAccess == null )
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.page.ContentPage

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.