Package org.apache.jetspeed.container

Examples of org.apache.jetspeed.container.PortletWindow


                title = f.getPortletContent().getTitle();
            }
           
            if (title == null)
            {
                PortletWindow portletWindow = requestContext.getPortletWindow(f);
               
                if (portletWindow != null)
                {
                    // When a portlet definition is not found from the registry,
                    // portlet windows do not have portlet definition.
                    // So, we have to check if the portlet definition is null or not.
                   
                    PortletDefinition portletDef = portletWindow.getPortletDefinition();
                   
                    if (portletDef != null)
                    {
                        title = requestContext.getPreferedLanguage(portletDef).getTitle();
                       
View Full Code Here


            if (windowId == null || portletUniqueName == null)
            {
                throw new IllegalArgumentException("Parameter windowId and portletUniqueName are both required");
            }
            RequestContext context = getRequestContext();
            PortletWindow window = context.getPortletWindow(windowId);
            if (window == null)
            {
                window = context.getInstantlyCreatedPortletWindow(windowId, portletUniqueName);
            }
            if (window.isValid())
            {
                PortletWindow currentPortletWindow = context.getCurrentPortletWindow();
                try
                {
                    context.setCurrentPortletWindow(window);
                    renderer.renderNow(window.getFragment(), context);
                    return window.getFragment().getRenderedContent();
View Full Code Here

        if (entity == null)
        {
            return;
        }
       
        PortletWindow window = context.resolvePortletWindow(entity);
       
        if (window == null)
        {       
            String name = context.getRequestParameter(PortalReservedParameters.PORTLET);
           
            if (name == null)
            {
                name = (String)context.getAttribute(PortalReservedParameters.PORTLET);
            }
           
            if (name == null)
            {
                return;
            }
           
            window = context.getInstantlyCreatedPortletWindow(entity, name);
        }
       
        PortletMode requetedPortletMode = getRequestedPortletMode(context);
        WindowState requetedWindowState = getRequestedWindowState(context);
       
        NavigationalState navState = context.getPortalURL().getNavigationalState();
       
        if (navState instanceof MutableNavigationalState)
        {
            MutableNavigationalState mutableNavState = (MutableNavigationalState) navState;
           
            if (!requetedPortletMode.equals(navState.getMode(window)))
            {
                mutableNavState.setMode(window, requetedPortletMode);
            }
           
            if (!requetedWindowState.equals(navState.getState(window)))
            {
                mutableNavState.setState(window, requetedWindowState);
            }
        }
       
        ContentFragment contentFragment = window.getFragment();
        renderer.renderNow(contentFragment, context);
       
        if (titleInHeader && contentFragment.getPortletContent() != null)
        {           
            context.getResponse().setHeader( "JS_PORTLET_TITLE", StringEscapeUtils.escapeHtml( contentFragment.getPortletContent().getTitle() ) );
View Full Code Here

        {
            try
            {
                if (log.isWarnEnabled())
                {
                    PortletWindow window = job.getWindow();
                    PortletWindowID windowId = (null != window ? window.getId() : null);
                    log.warn("Portlet Rendering job to be interrupted by timeout (" + job.getTimeout() + "ms): " + windowId.getStringId());
                }

                PortletContent content = job.getPortletContent();
               
View Full Code Here

            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
       
        // handle maximized state
        NavigationalState nav = context.getPortalURL().getNavigationalState();
        PortletWindow window = nav.getMaximizedWindow();
       
        if (null != window)
        {
            renderMaximizedWindow(context, page, root, window);
        }
        else
        {
            aggregateAndRender(root, context, page);
        }
       
        // write all rendered content
        renderContent(context, root);
       
        if (null != window)
        {
            window.removeAttribute(PortalReservedParameters.MAXIMIZED_FRAGMENT_ATTRIBUTE);
            window.removeAttribute(PortalReservedParameters.MAXIMIZED_LAYOUT_ATTRIBUTE);
        }
       
        releaseBuffers(root, context);       
    }
View Full Code Here

    throws PortletAccessDeniedException
    {
        RenderingJob job = null;
        try
        {
            PortletWindow portletWindow = requestContext.getPortletWindow(fragment);
            if (!portletWindow.isValid())
            {
                return null;
            }
            PortletDefinition portletDefinition = portletWindow.getPortletDefinition();    

            long timeoutMetadata = this.getTimeoutOnJob(portletDefinition);
            portletTracking.setExpiration(portletWindow, timeoutMetadata);           
           
            if ((checkSecurityConstraints || this.enforceSecurityConstraint(portletDefinition)) &&
                !checkSecurityConstraint(portletDefinition, fragment))
            {
                throw new PortletAccessDeniedException("Access Denied.");
            }
            if (portletTracking.isOutOfService(portletWindow))
            {
                log.info("Taking portlet out of service: " + portletDefinition.getUniqueName() + " for window " + portletWindow.getId());
                fragment.overrideRenderedContent(outOfServiceMessage);
                return null;
            }
            int expirationCache = getExpirationCache(portletDefinition);
            if (expirationCache != 0)
View Full Code Here

     */
    protected void renderMaximizedWindow( RequestContext context, ContentPage page, ContentFragment layoutContentFragment,
                                          PortletWindow window )
    {
        boolean maxedLayout = false;
        PortletWindow layoutWindow;
        if (window.getFragment().getId().equals(layoutContentFragment.getId()))
        {
            layoutWindow = window;
            maxedLayout = true;
        }
        else
        {
            layoutWindow = context.getPortletWindow(layoutContentFragment);
        }
       
        layoutWindow.setAttribute(PortalReservedParameters.MAXIMIZED_FRAGMENT_ATTRIBUTE, window.getFragment());
        layoutWindow.setAttribute(PortalReservedParameters.MAXIMIZED_LAYOUT_ATTRIBUTE, page.getRootFragment());

        try
        {
            renderer.renderNow(window.getFragment(), context);
            if (!maxedLayout)
View Full Code Here

            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
       
        // handle maximized state
        NavigationalState nav = context.getPortalURL().getNavigationalState();
        PortletWindow window = nav.getMaximizedWindow();
       
        if (null != window)
        {
            renderMaximizedWindow(context, page, root, window);
        }
        else
        {
            aggregateAndRender(root, context, page, true, null, null, null);
        }
       
        renderContent(context, root);
       
        if (null != window)
        {
            window.removeAttribute(PortalReservedParameters.MAXIMIZED_FRAGMENT_ATTRIBUTE);
            window.removeAttribute(PortalReservedParameters.MAXIMIZED_LAYOUT_ATTRIBUTE);
        }
       
        releaseBuffers(root, context);               
    }
View Full Code Here

    }

    protected boolean isSoloMode(RequestContext requestContext)
    {
        boolean solo = false;
        PortletWindow window = requestContext.getPortalURL().getNavigationalState().getMaximizedWindow();
        boolean maximized = (window != null);
        if (maximized)
        {
            solo = JetspeedActions.SOLO_STATE.equals(requestContext.getPortalURL().getNavigationalState().getMappedState(window));
        }
View Full Code Here

                                             PageActionAccess pageActionAccess,
                                             Decoration decoration,
                                             boolean isAjaxRequest)
    {
        boolean fragmentSupportsActions = false;
        PortletWindow window = requestContext.getPortletWindow(fragment);
        if (!window.isValid())
        {
            return fragmentSupportsActions; // allow nothing
        }
        PortletDefinition portlet = window.getPortletDefinition();

        List actions = Collections.EMPTY_LIST;
       
        PortletMode currentMode = requestContext.getPortalURL().getNavigationalState().getMode(window);
        WindowState currentState = requestContext.getPortalURL().getNavigationalState().getState(window);
        List<Supports> supports = portlet.getSupports();
       
        if ( fragment.equals(requestContext.getPage().getRootFragment()) )
        {
            fragmentSupportsActions = true;
            actions = getPageModes(requestContext, window, supports, currentMode, currentState, pageActionAccess, decoration, isAjaxRequest);
        }
        else if ( !Fragment.LAYOUT.equals(fragment.getType()) )
        {
            fragmentSupportsActions = true;
            String fragmentId = fragment.getId();
            PortletApplication pa = window.getPortletDefinition().getApplication();

            String portletName = portlet.getUniqueName();

            PortletMode currentMappedMode = pa.getMappedPortletMode(currentMode);
            WindowState currentMappedState = pa.getMappedWindowState(currentState);
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.container.PortletWindow

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.