Package org.gatein.pc.api

Examples of org.gatein.pc.api.Portlet


      // check if we need to refresh
      boolean justRefreshed = refresh(false);

      // First try caches if caches are still valid or we just refreshed
      Portlet portlet = getPortletFromCaches(portletHandle, justRefreshed);

      if (portlet != null) // we had a match in cache, return it
      {
         log.debug("Portlet was cached");
         return portlet;
View Full Code Here


      }
   }

   private Portlet getPortletFromCaches(String portletHandle, boolean justRefreshed)
   {
      Portlet portlet = null;

      if (justRefreshed || (useCache() && !isCacheExpired()))
      {
         log.debug("Trying cached POPs");
View Full Code Here

   protected abstract PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException;

   public PortletInvocationResponse invoke(String windowId, ActionInvocation actionInvocation) throws PortletInvokerException
   {
      //
      Portlet portlet = getPortlet(windowId);

      //
      actionInvocation.setClientContext(new AbstractClientContext(req));
      actionInvocation.setServerContext(new AbstractServerContext(req, resp));
      actionInvocation.setInstanceContext(new AbstractInstanceContext(portlet.getContext().getId()));
      actionInvocation.setUserContext(new AbstractUserContext(req));
      actionInvocation.setWindowContext(new AbstractWindowContext(windowId));
      actionInvocation.setPortalContext(PORTAL_CONTEXT);
      actionInvocation.setSecurityContext(new AbstractSecurityContext(req));
      actionInvocation.setRequestContext(new AbstractRequestContext(req));
      actionInvocation.setTarget(portlet.getContext());

      //
      return invoke(actionInvocation);
   }
View Full Code Here

      return invoke(actionInvocation);
   }

   public PortletInvocationResponse invoke(String windowId, List<Cookie> requestCookies, EventInvocation eventInvocation) throws PortletInvokerException
   {
      Portlet portlet = getPortlet(windowId);

      //
      eventInvocation.setClientContext(new AbstractClientContext(req, requestCookies));
      eventInvocation.setServerContext(new AbstractServerContext(req, resp));
      eventInvocation.setInstanceContext(new AbstractInstanceContext(portlet.getContext().getId()));
      eventInvocation.setUserContext(new AbstractUserContext(req));
      eventInvocation.setWindowContext(new AbstractWindowContext(windowId));
      eventInvocation.setPortalContext(PORTAL_CONTEXT);
      eventInvocation.setSecurityContext(new AbstractSecurityContext(req));
      eventInvocation.setTarget(portlet.getContext());

      //
      return invoke(eventInvocation);
   }
View Full Code Here

      return invoke(eventInvocation);
   }

   public PortletInvocationResponse invoke(String windowId, List<Cookie> requestCookies, RenderInvocation renderInvocation) throws PortletInvokerException
   {
      Portlet portlet = getPortlet(windowId);

      //
      renderInvocation.setClientContext(new AbstractClientContext(req, requestCookies));
      renderInvocation.setServerContext(new AbstractServerContext(req, resp));
      renderInvocation.setInstanceContext(new AbstractInstanceContext(portlet.getContext().getId()));
      renderInvocation.setUserContext(new AbstractUserContext(req));
      renderInvocation.setWindowContext(new AbstractWindowContext(windowId));
      renderInvocation.setPortalContext(PORTAL_CONTEXT);
      renderInvocation.setSecurityContext(new AbstractSecurityContext(req));
      renderInvocation.setTarget(portlet.getContext());

      //
      return invoke(renderInvocation);
   }
View Full Code Here

      return invoke(renderInvocation);
   }

   public PortletInvocationResponse invoke(String windowId, ResourceInvocation resourceInvocation) throws PortletInvokerException
   {
      Portlet portlet = getPortlet(windowId);

      //
      resourceInvocation.setClientContext(new AbstractClientContext(req));
      resourceInvocation.setServerContext(new AbstractServerContext(req, resp));
      resourceInvocation.setInstanceContext(new AbstractInstanceContext(portlet.getContext().getId()));
      resourceInvocation.setUserContext(new AbstractUserContext(req));
      resourceInvocation.setWindowContext(new AbstractWindowContext(windowId));
      resourceInvocation.setPortalContext(PORTAL_CONTEXT);
      resourceInvocation.setSecurityContext(new AbstractSecurityContext(req));
      resourceInvocation.setRequestContext(new AbstractRequestContext(req));
      resourceInvocation.setTarget(portlet.getContext());

      //
      return invoke(resourceInvocation);
   }
View Full Code Here

      //
      for (String windowId : prepareResponse.getWindowIds())
      {
         try
         {
            Portlet portlet = this.context.getPortlet(windowId);

            //
            if (portlet != null)
            {
               PortletInfo portletInfo = portlet.getInfo();

               //
               if (portletInfo.getEventing().getConsumedEvents().containsKey(producedEvent.getName()))
               {
                  PortletWindowEvent destinationEvent = new PortletWindowEvent(producedEvent.getName(), producedEvent.getPayload(), windowId);
View Full Code Here

         WindowDef windowDef = prepareResponse.getWindowDef(windowId);

         //
         try
         {
            Portlet portlet = portletControllerContext.getPortlet(windowId);

            //
            if (portlet != null)
            {
               PortletInvocationResponse portletResponse = render(null, windowId);
View Full Code Here

   {
      ControllerPortletInvocationContext context = (ControllerPortletInvocationContext)actionInvocation.getContext();

      //
      String windowId = context.getWindowId();
      Portlet portlet = getPortlet(windowId);

      //
      actionInvocation.setClientContext(new AbstractClientContext(req));
      actionInvocation.setServerContext(new AbstractServerContext(req, resp));
      actionInvocation.setInstanceContext(new AbstractInstanceContext(portlet.getContext().getId()));
      actionInvocation.setUserContext(new AbstractUserContext(req));
      actionInvocation.setWindowContext(new AbstractWindowContext(windowId));
      actionInvocation.setPortalContext(PORTAL_CONTEXT);
      actionInvocation.setSecurityContext(new AbstractSecurityContext(req));
      actionInvocation.setRequestContext(new AbstractRequestContext(req));
      actionInvocation.setTarget(portlet.getContext());

      //
      return invoke((PortletInvocation)actionInvocation);
   }
View Full Code Here

   {
      ControllerPortletInvocationContext context = (ControllerPortletInvocationContext)eventInvocation.getContext();

      //
      String windowId = context.getWindowId();
      Portlet portlet = getPortlet(windowId);

      //
      eventInvocation.setClientContext(new AbstractClientContext(req, requestCookies));
      eventInvocation.setServerContext(new AbstractServerContext(req, resp));
      eventInvocation.setInstanceContext(new AbstractInstanceContext(portlet.getContext().getId()));
      eventInvocation.setUserContext(new AbstractUserContext(req));
      eventInvocation.setWindowContext(new AbstractWindowContext(windowId));
      eventInvocation.setPortalContext(PORTAL_CONTEXT);
      eventInvocation.setSecurityContext(new AbstractSecurityContext(req));
      eventInvocation.setTarget(portlet.getContext());

      //
      return invoke(eventInvocation);
   }
View Full Code Here

TOP

Related Classes of org.gatein.pc.api.Portlet

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.