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

      uiPortlet.setTheme(model.getTheme());
      if (model.getAccessPermissions() != null)
         uiPortlet.setAccessPermissions(model.getAccessPermissions());
      uiPortlet.setModifiable(model.isModifiable());

      Portlet portlet = uiPortlet.getProducedOfferedPortlet();
      if (portlet == null || portlet.getInfo() == null)
         return;

      PortletInfo portletInfo = portlet.getInfo();

      /*
       * Define which portlet modes the portlet supports and hence should be shown
       * in the portlet info bar
       */
 
View Full Code Here

   @Override
   public UIPortletManagement.PortletExtra read(PortletContext output) throws Exception
   {
      ExoContainer manager = ExoContainerContext.getCurrentContainer();
      FederatingPortletInvoker portletInvoker = (FederatingPortletInvoker)manager.getComponentInstance(PortletInvoker.class);
      Portlet portlet = portletInvoker.getPortlet(output);
      return new UIPortletManagement.PortletExtra(portlet);
   }
View Full Code Here

   public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");

      Portlet portlet = producerInfo.getPortlet(portletContext);

      if (portlet == null)
      {
         throw new NoSuchPortletException(portletContext.getId());
      }
View Full Code Here

        uiPortlet.setTheme(model.getTheme());
        if (model.getAccessPermissions() != null)
            uiPortlet.setAccessPermissions(model.getAccessPermissions());
        uiPortlet.setModifiable(model.isModifiable());

        Portlet portlet = uiPortlet.getProducedOfferedPortlet();
        if (portlet == null || portlet.getInfo() == null)
            return;

        PortletInfo portletInfo = portlet.getInfo();

        /*
         * Define which portlet modes the portlet supports and hence should be shown in the portlet info bar
         */
        Set<ModeInfo> modes = portletInfo.getCapabilities().getModes(MediaType.create("text/html"));
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

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

      //
      String windowId = context.getWindowId();
      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

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

      //
      String windowId = context.getWindowId();
      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((PortletInvocation)resourceInvocation);
   }
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.