Search in sources :

Example 11 with IPortalRequestInfo

use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.

the class PortletCacheControlServiceImpl method getPortletResourceState.

@Override
public CacheState<CachedPortletResourceData<Long>, Long> getPortletResourceState(HttpServletRequest request, IPortletWindowId portletWindowId) {
    final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
    if (portletWindow == null) {
        logger.warn("portletWindowRegistry returned null for {}, returning default cacheControl and no cached portlet data", portletWindowId);
        return new CacheState<CachedPortletResourceData<Long>, Long>();
    }
    // Generate the public resource cache key
    final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
    final Locale locale = RequestContextUtils.getLocale(request);
    final PublicPortletCacheKey publicCacheKey = PublicPortletCacheKey.createPublicPortletResourceCacheKey(portletWindow, portalRequestInfo, locale);
    return this.<CachedPortletResourceData<Long>, Long>getPortletState(request, portletWindow, publicCacheKey, this.publicScopePortletResourceOutputCache, this.privateScopePortletResourceOutputCache, true);
}
Also used : Locale(java.util.Locale) IPortalRequestInfo(org.apereo.portal.url.IPortalRequestInfo) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow)

Example 12 with IPortalRequestInfo

use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.

the class PortletCacheControlServiceImpl method getPortletRenderState.

@Override
public CacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult> getPortletRenderState(HttpServletRequest request, IPortletWindowId portletWindowId) {
    final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
    if (portletWindow == null) {
        logger.warn("portletWindowRegistry returned null for {}, returning default cacheControl and no cached portlet data", portletWindowId);
        return new CacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult>();
    }
    // Generate the public render cache key
    final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
    final Locale locale = RequestContextUtils.getLocale(request);
    final PublicPortletCacheKey publicCacheKey = PublicPortletCacheKey.createPublicPortletRenderCacheKey(portletWindow, portalRequestInfo, locale);
    return this.<CachedPortletData<PortletRenderResult>, PortletRenderResult>getPortletState(request, portletWindow, publicCacheKey, this.publicScopePortletRenderOutputCache, this.privateScopePortletRenderOutputCache, false);
}
Also used : Locale(java.util.Locale) IPortalRequestInfo(org.apereo.portal.url.IPortalRequestInfo) PortletRenderResult(org.apereo.portal.portlet.rendering.PortletRenderResult) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow)

Example 13 with IPortalRequestInfo

use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.

the class PortletCacheControlServiceImpl method getPortletRenderHeaderState.

@Override
public CacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult> getPortletRenderHeaderState(HttpServletRequest request, IPortletWindowId portletWindowId) {
    final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, portletWindowId);
    if (portletWindow == null) {
        logger.warn("portletWindowRegistry returned null for {}, returning default cacheControl and no cached portlet data", portletWindowId);
        return new CacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult>();
    }
    // Generate the public render-header cache key
    final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
    final Locale locale = RequestContextUtils.getLocale(request);
    final PublicPortletCacheKey publicCacheKey = PublicPortletCacheKey.createPublicPortletRenderHeaderCacheKey(portletWindow, portalRequestInfo, locale);
    return this.<CachedPortletData<PortletRenderResult>, PortletRenderResult>getPortletState(request, portletWindow, publicCacheKey, this.publicScopePortletRenderHeaderOutputCache, this.privateScopePortletRenderHeaderOutputCache, false);
}
Also used : Locale(java.util.Locale) IPortalRequestInfo(org.apereo.portal.url.IPortalRequestInfo) PortletRenderResult(org.apereo.portal.portlet.rendering.PortletRenderResult) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow)

Example 14 with IPortalRequestInfo

use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.

the class LocalPortletRequestContextServiceImpl method getPortletRenderRequestContext.

/* (non-Javadoc)
     * @see org.apache.pluto.container.PortletRequestContextService#getPortletRenderRequestContext(org.apache.pluto.container.PortletContainer, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.pluto.container.PortletWindow)
     */
@Override
public PortletRequestContext getPortletRenderRequestContext(PortletContainer container, HttpServletRequest containerRequest, HttpServletResponse containerResponse, PortletWindow window) {
    final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow(containerRequest, window);
    final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(containerRequest);
    return new PortletRequestContextImpl(container, portletWindow, containerRequest, containerResponse, this.requestPropertiesManager, portalRequestInfo, portletCookieService, requestAttributeService);
}
Also used : IPortalRequestInfo(org.apereo.portal.url.IPortalRequestInfo) PortletRequestContextImpl(org.apereo.portal.portlet.container.PortletRequestContextImpl) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow)

Example 15 with IPortalRequestInfo

use of org.apereo.portal.url.IPortalRequestInfo in project uPortal by Jasig.

the class LocalPortletRequestContextServiceImpl method getPortletResourceRequestContext.

/* (non-Javadoc)
     * @see org.apache.pluto.container.PortletRequestContextService#getPortletResourceRequestContext(org.apache.pluto.container.PortletContainer, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.pluto.container.PortletWindow)
     */
@Override
public PortletResourceRequestContext getPortletResourceRequestContext(PortletContainer container, HttpServletRequest containerRequest, HttpServletResponse containerResponse, PortletWindow window) {
    final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow(containerRequest, window);
    final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(containerRequest);
    return new PortletResourceRequestContextImpl(container, portletWindow, containerRequest, containerResponse, this.requestPropertiesManager, portalRequestInfo, this.portletCookieService, requestAttributeService);
}
Also used : IPortalRequestInfo(org.apereo.portal.url.IPortalRequestInfo) IPortletWindow(org.apereo.portal.portlet.om.IPortletWindow) PortletResourceRequestContextImpl(org.apereo.portal.portlet.container.PortletResourceRequestContextImpl)

Aggregations

IPortalRequestInfo (org.apereo.portal.url.IPortalRequestInfo)25 IPortletWindow (org.apereo.portal.portlet.om.IPortletWindow)12 IPortletWindowId (org.apereo.portal.portlet.om.IPortletWindowId)8 IPortletRequestInfo (org.apereo.portal.url.IPortletRequestInfo)6 UrlState (org.apereo.portal.url.UrlState)6 Locale (java.util.Locale)3 PortletRequestContextImpl (org.apereo.portal.portlet.container.PortletRequestContextImpl)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 PrintWriter (java.io.PrintWriter)2 WindowState (javax.portlet.WindowState)2 CharacterEventReader (org.apereo.portal.character.stream.CharacterEventReader)2 CharacterDataEvent (org.apereo.portal.character.stream.events.CharacterDataEvent)2 CharacterEvent (org.apereo.portal.character.stream.events.CharacterEvent)2 IPortletEntity (org.apereo.portal.portlet.om.IPortletEntity)2 PortletRenderResult (org.apereo.portal.portlet.rendering.PortletRenderResult)2 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)1 ImmutableList (com.google.common.collect.ImmutableList)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1