Examples of PortletResponseImpl


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

Examples of net.sf.jportlet.impl.PortletResponseImpl

                    {
                        __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

Examples of net.sf.jportlet.impl.PortletResponseImpl

        /* 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

Examples of net.sf.jportlet.impl.PortletResponseImpl

                   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

Examples of net.sf.jportlet.impl.PortletResponseImpl

                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

Examples of org.gatein.pc.portlet.impl.jsr168.api.PortletResponseImpl

   {
      HttpServletRequest dreq = invocation.getDispatchedRequest();

      //
      PortletRequestImpl req;
      PortletResponseImpl resp;
      String phase;
      FilterChainImpl<?> chain;
      if (invocation instanceof ActionInvocation)
      {
         req = new ActionRequestImpl(this, (ActionInvocation)invocation);
         resp = new ActionResponseImpl((ActionInvocation)invocation, req);
         phase = PortletRequest.ACTION_PHASE;
         chain = new FilterChainImpl<ActionFilter>(actionFilterList, ActionFilter.class);
      }
      else if (invocation instanceof RenderInvocation)
      {
         req = new RenderRequestImpl(this, (RenderInvocation)invocation);
         resp = new RenderResponseImpl((RenderInvocation)invocation, req);
         phase = PortletRequest.RENDER_PHASE;
         chain = new FilterChainImpl<RenderFilter>(renderFilterList, RenderFilter.class);
      }
      else if (invocation instanceof EventInvocation)
      {
         req = new EventRequestImpl(this, (EventInvocation)invocation);
         resp = new EventResponseImpl((EventInvocation)invocation, req);
         phase = PortletRequest.EVENT_PHASE;
         chain = new FilterChainImpl<EventFilter>(eventFilterList, EventFilter.class);
      }
      else if (invocation instanceof ResourceInvocation)
      {
         req = new ResourceRequestImpl(this, (ResourceInvocation)invocation);
         resp = new ResourceResponseImpl((ResourceInvocation)invocation, req);
         phase = PortletRequest.RESOURCE_PHASE;
         chain = new FilterChainImpl<ResourceFilter>(resourceFilterList, ResourceFilter.class);
      }
      else
      {
        throw new InvocationException("Unexpected invocation " + invocation);
      }

      //
      try
      {
         dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION, invocation);
         dreq.setAttribute(Constants.JAVAX_PORTLET_CONFIG, config);
         dreq.setAttribute(Constants.JAVAX_PORTLET_REQUEST, req);
         dreq.setAttribute(Constants.JAVAX_PORTLET_RESPONSE, resp);
         dreq.setAttribute(Constants.JAVAX_PORTLET_LIFECYCLE_PHASE, phase);

         //
         chain.doFilter(req, resp);

         //
         return resp.getResponse();
      }
      catch (NoClassDefFoundError e)
      {
         //
         return new ErrorResponse(e);
View Full Code Here

Examples of org.gatein.pc.portlet.impl.jsr168.api.PortletResponseImpl

   {
      HttpServletRequest dreq = invocation.getRequest();

      //
      PortletRequestImpl req;
      PortletResponseImpl resp;
      String phase;
      FilterChainImpl<?> chain;
      if (invocation instanceof ActionInvocation)
      {
         req = new ActionRequestImpl(this, (ActionInvocation)invocation);
         resp = new ActionResponseImpl((ActionInvocation)invocation, req);
         phase = PortletRequest.ACTION_PHASE;
         chain = new FilterChainImpl<ActionFilter>(actionFilterList, ActionFilter.class);
      }
      else if (invocation instanceof RenderInvocation)
      {
         req = new RenderRequestImpl(this, (RenderInvocation)invocation);
         resp = new RenderResponseImpl((RenderInvocation)invocation, req);
         phase = PortletRequest.RENDER_PHASE;
         chain = new FilterChainImpl<RenderFilter>(renderFilterList, RenderFilter.class);
      }
      else if (invocation instanceof EventInvocation)
      {
         req = new EventRequestImpl(this, (EventInvocation)invocation);
         resp = new EventResponseImpl((EventInvocation)invocation, req);
         phase = PortletRequest.EVENT_PHASE;
         chain = new FilterChainImpl<EventFilter>(eventFilterList, EventFilter.class);
      }
      else if (invocation instanceof ResourceInvocation)
      {
         req = new ResourceRequestImpl(this, (ResourceInvocation)invocation);
         resp = new ResourceResponseImpl((ResourceInvocation)invocation, req);
         phase = PortletRequest.RESOURCE_PHASE;
         chain = new FilterChainImpl<ResourceFilter>(resourceFilterList, ResourceFilter.class);
      }
      else
      {
         throw new InvocationException("Unexpected invocation " + invocation);
      }

      //
      try
      {
         dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION, invocation);
         dreq.setAttribute(Constants.JAVAX_PORTLET_CONFIG, config);
         dreq.setAttribute(Constants.JAVAX_PORTLET_REQUEST, req);
         dreq.setAttribute(Constants.JAVAX_PORTLET_RESPONSE, resp);
         dreq.setAttribute(Constants.JAVAX_PORTLET_LIFECYCLE_PHASE, phase);

         //
         chain.doFilter(req, resp);

         //
         return resp.getResponse();
      }
      catch (NoClassDefFoundError e)
      {
         //
         return new ErrorResponse(e);
View Full Code Here

Examples of org.gatein.pc.portlet.impl.jsr168.api.PortletResponseImpl

   {
      HttpServletRequest dreq = invocation.getDispatchedRequest();

      //
      PortletRequestImpl req;
      PortletResponseImpl resp;
      String phase;
      FilterChainImpl<?> chain;
      if (invocation instanceof ActionInvocation)
      {
         req = new ActionRequestImpl(this, (ActionInvocation)invocation);
         resp = new ActionResponseImpl((ActionInvocation)invocation, req);
         phase = PortletRequest.ACTION_PHASE;
         chain = new FilterChainImpl<ActionFilter>(actionFilterList, ActionFilter.class);
      }
      else if (invocation instanceof RenderInvocation)
      {
         req = new RenderRequestImpl(this, (RenderInvocation)invocation);
         resp = new RenderResponseImpl((RenderInvocation)invocation, req);
         phase = PortletRequest.RENDER_PHASE;
         chain = new FilterChainImpl<RenderFilter>(renderFilterList, RenderFilter.class);
      }
      else if (invocation instanceof EventInvocation)
      {
         req = new EventRequestImpl(this, (EventInvocation)invocation);
         resp = new EventResponseImpl((EventInvocation)invocation, req);
         phase = PortletRequest.EVENT_PHASE;
         chain = new FilterChainImpl<EventFilter>(eventFilterList, EventFilter.class);
      }
      else if (invocation instanceof ResourceInvocation)
      {
         req = new ResourceRequestImpl(this, (ResourceInvocation)invocation);
         resp = new ResourceResponseImpl((ResourceInvocation)invocation, req);
         phase = PortletRequest.RESOURCE_PHASE;
         chain = new FilterChainImpl<ResourceFilter>(resourceFilterList, ResourceFilter.class);
      }
      else
      {
         throw new InvocationException("Unexpected invocation " + invocation);
      }

      //
      try
      {
         dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION, invocation);
         dreq.setAttribute(Constants.JAVAX_PORTLET_CONFIG, config);
         dreq.setAttribute(Constants.JAVAX_PORTLET_REQUEST, req);
         dreq.setAttribute(Constants.JAVAX_PORTLET_RESPONSE, resp);
         dreq.setAttribute(Constants.JAVAX_PORTLET_LIFECYCLE_PHASE, phase);

         //
         chain.doFilter(req, resp);

         //
         return resp.getResponse();
      }
      catch (NoClassDefFoundError e)
      {
         //
         return new ErrorResponse(e);
View Full Code Here

Examples of org.gatein.pc.portlet.impl.jsr168.api.PortletResponseImpl

   {
      HttpServletRequest dreq = invocation.getRequest();

      //
      PortletRequestImpl req;
      PortletResponseImpl resp;
      String phase;
      FilterChainImpl<?> chain;
      if (invocation instanceof ActionInvocation)
      {
         req = new ActionRequestImpl(this, (ActionInvocation)invocation);
         resp = new ActionResponseImpl((ActionInvocation)invocation, req);
         phase = PortletRequest.ACTION_PHASE;
         chain = new FilterChainImpl<ActionFilter>(actionFilterList, ActionFilter.class);
      }
      else if (invocation instanceof RenderInvocation)
      {
         req = new RenderRequestImpl(this, (RenderInvocation)invocation);
         resp = new RenderResponseImpl((RenderInvocation)invocation, req);
         phase = PortletRequest.RENDER_PHASE;
         chain = new FilterChainImpl<RenderFilter>(renderFilterList, RenderFilter.class);
      }
      else if (invocation instanceof EventInvocation)
      {
         req = new EventRequestImpl(this, (EventInvocation)invocation);
         resp = new EventResponseImpl((EventInvocation)invocation, req);
         phase = PortletRequest.EVENT_PHASE;
         chain = new FilterChainImpl<EventFilter>(eventFilterList, EventFilter.class);
      }
      else if (invocation instanceof ResourceInvocation)
      {
         req = new ResourceRequestImpl(this, (ResourceInvocation)invocation);
         resp = new ResourceResponseImpl((ResourceInvocation)invocation, req);
         phase = PortletRequest.RESOURCE_PHASE;
         chain = new FilterChainImpl<ResourceFilter>(resourceFilterList, ResourceFilter.class);
      }
      else
      {
         throw new InvocationException("Unexpected invocation " + invocation);
      }

      //
      try
      {
         dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION, invocation);
         dreq.setAttribute(Constants.JAVAX_PORTLET_CONFIG, config);
         dreq.setAttribute(Constants.JAVAX_PORTLET_REQUEST, req);
         dreq.setAttribute(Constants.JAVAX_PORTLET_RESPONSE, resp);
         dreq.setAttribute(Constants.JAVAX_PORTLET_LIFECYCLE_PHASE, phase);

         //
         chain.doFilter(req, resp);

         //
         return resp.getResponse();
      }
      catch (NoClassDefFoundError e)
      {
         //
         return new ErrorResponse(e);
View Full Code Here

Examples of org.gatein.pc.portlet.impl.jsr168.api.PortletResponseImpl

   {
      HttpServletRequest dreq = invocation.getDispatchedRequest();

      //
      PortletRequestImpl req;
      PortletResponseImpl resp;
      String phase;
      FilterChainImpl<?> chain;
      if (invocation instanceof ActionInvocation)
      {
         req = new ActionRequestImpl(this, (ActionInvocation)invocation);
         resp = new ActionResponseImpl((ActionInvocation)invocation, req);
         phase = PortletRequest.ACTION_PHASE;
         chain = new FilterChainImpl<ActionFilter>(actionFilterList, ActionFilter.class);
      }
      else if (invocation instanceof RenderInvocation)
      {
         req = new RenderRequestImpl(this, (RenderInvocation)invocation);
         resp = new RenderResponseImpl((RenderInvocation)invocation, req);
         phase = PortletRequest.RENDER_PHASE;
         chain = new FilterChainImpl<RenderFilter>(renderFilterList, RenderFilter.class);
      }
      else if (invocation instanceof EventInvocation)
      {
         req = new EventRequestImpl(this, (EventInvocation)invocation);
         resp = new EventResponseImpl((EventInvocation)invocation, req);
         phase = PortletRequest.EVENT_PHASE;
         chain = new FilterChainImpl<EventFilter>(eventFilterList, EventFilter.class);
      }
      else if (invocation instanceof ResourceInvocation)
      {
         req = new ResourceRequestImpl(this, (ResourceInvocation)invocation);
         resp = new ResourceResponseImpl((ResourceInvocation)invocation, req);
         phase = PortletRequest.RESOURCE_PHASE;
         chain = new FilterChainImpl<ResourceFilter>(resourceFilterList, ResourceFilter.class);
      }
      else
      {
         throw new InvocationException("Unexpected invocation " + invocation);
      }

      //
      try
      {
         dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION, invocation);
         dreq.setAttribute(Constants.JAVAX_PORTLET_CONFIG, config);
         dreq.setAttribute(Constants.JAVAX_PORTLET_REQUEST, req);
         dreq.setAttribute(Constants.JAVAX_PORTLET_RESPONSE, resp);
         dreq.setAttribute(Constants.JAVAX_PORTLET_LIFECYCLE_PHASE, phase);

         //
         chain.doFilter(req, resp);

         //
         return resp.getResponse();
      }
      catch (NoClassDefFoundError e)
      {
         //
         return new ErrorResponse(e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.