Package net.sf.jportlet.impl

Examples of net.sf.jportlet.impl.PortletResponseImpl


        boolean debug = __log.isDebugEnabled(  );
        String  id = getId( proxy, request, response );

        if ( id != null )
        {
            PortletResponseImpl resp = ( PortletResponseImpl ) response;
            PortletDescriptor   descr = proxy.getDescriptor(  );
            CacheDescriptor     cache = descr.getCacheDescriptor( request.getMode(  ) );
            CacheRegion         region = getCacheService( proxy ).getRegion( descr.getName(  ), true );
            CacheableImpl       cacheable = new CacheableImpl( id, resp.getBuffer(  ).toString(  ), 1000 * cache.getExpires(  ) );

            if ( debug )
            {
                __log.debug( "Caching portlet content:" + id );
            }
View Full Code Here


                    {
                        __log.debug( "...writing cached content into the portlet response" );
                    }

                    Object              data = cacheable.getData(  );
                    PortletResponseImpl resp = ( PortletResponseImpl ) response;
                    resp.getBuffer(  ).append( data );
                    return Interceptor.SKIP;
                }
                else
                {
                    if ( debug )
View Full Code Here

        /* Perform the action */
        PortletServiceFactory serviceFactory = _application.getPortletServiceFactory(  );
        PortletProxy          proxy = ( PortletProxy ) _application.getPortlet( uri.getPortletName(  ) );
        PortletRequestImpl    req = new PortletRequestImpl( proxy, request, serviceFactory );
        PortletResponseImpl   resp = new PortletResponseImpl( proxy, req, response );
        HttpServletRequest    hreq = req.getHttpRequest(  );
        String                action = uri.getAction(  );
        ActionEventImpl       event = new ActionEventImpl( action, req, resp );
        proxy.actionPerformed( event );

View Full Code Here

                   IOException
    {
        boolean             debug = _log.isDebugEnabled(  );
        CacheDescriptor     cache = _descriptor.getCacheDescriptor( request.getMode(  ) );
        String              id = getCacheableId( cache, request, response );
        PortletResponseImpl response2 = new PortletResponseImpl( this, request, response.getHttpResponse(  ) );
        String              body = null;
        CacheRegion         region = null;
        Cacheable           cacheable;

        /* Load the body from the cache */
        if ( id != null )
        {
            if ( debug )
            {
                _log.debug( "Loading portlet body from the cache.id=" + id );
            }

            region    = getCacheRegion(  );
            cacheable = region.get( id );
            if ( cacheable != null )
            {
                if ( !isDirty( request ) )
                {
                    if ( debug )
                    {
                        _log.debug( "...Portlet body found in the cache" );
                    }

                    body = ( String ) cacheable.getData(  );
                }
                else
                {
                    if ( debug )
                    {
                        _log.debug( "...Portlet dirty. expiring the portlet body" );
                    }

                    cacheable.expire(  );
                    body = null;
                }
            }
        }
        else
        {
            if ( debug )
            {
                _log.debug( "Caching not supported" );
            }
        }

        if ( body == null )
        {
            /* Generate the body */
            if ( debug )
            {
                _log.debug( "Generating the portlet body" );
            }

            _portlet.service( request, response2 );
            body = response2.getBuffer(  ).toString(  );

            /* Cache the body */
            if ( region != null )
            {
                if ( debug )
View Full Code Here

                HttpServletResponse response = ( HttpServletResponse ) pageContext.getResponse(  );
                PortletApplication  container = getPortletContainer(  );
                PortletProxy        proxy = ( PortletProxy ) getPortletContainer(  ).getPortlet( portletName );
                PortletRequestImpl  req = new PortletRequestImpl( proxy, request, container.getPortletServiceFactory(  ) );
                PortletResponseImpl resp = new PortletResponseImpl( proxy, req, response );
               
                PageTag page = (PageTag)findAncestorWithClass( this, PageTag.class );
                if ( page == null )
                {
                  throw new JspException( "'portlet' tag MUST be inside a 'page' tag");
                }
                _portletPageContext.setSkinContextPath( page.getSkinContextPath());

                req.setPageContext( _portletPageContext );
                proxy.service( req, resp );
                pageContext.getOut(  ).println( resp.getBuffer(  ).toString(  ) );
            }

            return EVAL_PAGE;
        }
        catch ( IOException io )
View Full Code Here

TOP

Related Classes of net.sf.jportlet.impl.PortletResponseImpl

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.