Examples of PortletInvocation


Examples of org.gatein.pc.api.invocation.PortletInvocation

    public String getEditModeContent() {
        try {
            PortalRequestContext prcontext = (PortalRequestContext) WebuiRequestContext.getCurrentInstance();
            prcontext.ignoreAJAXUpdateOnPortlets(true);

            PortletInvocation portletInvocation = uiPortlet_.create(RenderInvocation.class, prcontext);
            RenderInvocation renderInvocation = (RenderInvocation) portletInvocation;
            // make sure we are in the EDIT mode, and not whatever the current portlet mode is for the Portlet
            renderInvocation.setMode(Mode.create(PortletMode.EDIT.toString()));

            PortletInvocationResponse portletResponse = uiPortlet_.invoke(renderInvocation);
View Full Code Here

Examples of org.gatein.pc.api.invocation.PortletInvocation

            INVOCATION_THREAD_LOCAL.remove();
        }
    }

    public static String currentPhase() {
        PortletInvocation invocation = getCurrentInvocation();
        if (invocation == null) return null;

        if (invocation instanceof ActionInvocation) {
            return PortletRequest.ACTION_PHASE;
        } else if (invocation instanceof EventInvocation) {
View Full Code Here

Examples of org.gatein.pc.api.invocation.PortletInvocation

            return null;
        }
    }

    public static String currentWindowId() {
        PortletInvocation invocation = getCurrentInvocation();
        if (invocation == null) return null;

        WindowContext wc = invocation.getWindowContext();
        if (wc == null) return null;

        return wc.getId();
    }
View Full Code Here

Examples of org.gatein.pc.api.invocation.PortletInvocation

      WindowContext windowContext = createWindowContext(portletContext.getId(), runtimeContext);

      // prepare the invocation context
      WSRPPortletInvocationContext context = new WSRPPortletInvocationContext(mediaType, securityContext, portalContext, userContext, instanceContext, windowContext);
      // and use it to initialize the invocation that will send to the PortletInvoker
      PortletInvocation invocation = initInvocation(context);

      // mark the invocation as coming from WSRP, useful for bridges and/or web framework
      final HashMap<String, Object> attributes = new HashMap<String, Object>();
      attributes.put(WSRPConstants.FROM_WSRP_ATTRIBUTE_NAME, Boolean.TRUE);
      invocation.setRequestAttributes(attributes);

      invocation.setTarget(portlet.getContext());
      invocation.setWindowState(WSRPUtils.getJSR168WindowStateFromWSRPName(markupRequest.getWindowState()));
      invocation.setMode(WSRPUtils.getJSR168PortletModeFromWSRPName(markupRequest.getMode()));

      NavigationalContext navigationalContext = params.getNavigationalContext();
      if (navigationalContext != null)
      {
         StateString navigationalState = createNavigationalState(navigationalContext.getOpaqueValue());
         invocation.setNavigationalState(navigationalState);

         List<NamedString> publicParams = navigationalContext.getPublicValues();


         if (ParameterValidation.existsAndIsNotEmpty(publicParams))
         {
            Map<String, String[]> publicNS = WSRPUtils.createPublicNSFrom(publicParams);
            invocation.setPublicNavigationalState(publicNS);
         }
      }

      // finish contextualizing the invocation
      context.contextualize(invocation);
View Full Code Here

Examples of org.gatein.pc.api.invocation.PortletInvocation

         // check the registration and make it available to other parts of the code via RegistrationLocal
         Registration registration = producer.getRegistrationOrFailIfInvalid(requestProcessor.getRegistrationContext());
         RegistrationLocal.setRegistration(registration);

         // get the portlet container invocation from the RequestProcessor
         final PortletInvocation invocation = requestProcessor.getInvocation();

         // let the producer invocation handler delegate process the invocation before we perform the actual invocation
         final InvocationHandlerDelegate delegate = InvocationHandlerDelegate.producerDelegate();
         if (delegate != null)
         {
View Full Code Here

Examples of org.gatein.pc.api.invocation.PortletInvocation

    public String getEditModeContent() {
        try {
            PortalRequestContext prcontext = (PortalRequestContext) WebuiRequestContext.getCurrentInstance();
            prcontext.ignoreAJAXUpdateOnPortlets(true);

            PortletInvocation portletInvocation = uiPortlet_.create(RenderInvocation.class, prcontext);
            RenderInvocation renderInvocation = (RenderInvocation) portletInvocation;
            // make sure we are in the EDIT mode, and not whatever the current portlet mode is for the Portlet
            renderInvocation.setMode(Mode.create(PortletMode.EDIT.toString()));

            PortletInvocationResponse portletResponse = uiPortlet_.invoke(renderInvocation);
View Full Code Here

Examples of org.gatein.pc.api.invocation.PortletInvocation

   {
      log.debug(invocationType + " on portlet '" + handle + "'");

      Registration registration = producer.getRegistrationOrFailIfInvalid(registrationContext);
      RegistrationLocal.setRegistration(registration);
      final PortletInvocation invocation = requestProcessor.getInvocation();

      final InvocationHandlerDelegate delegate = InvocationHandlerDelegate.producerDelegate();
      if (delegate != null)
      {
         delegate.processInvocation(invocation);
View Full Code Here

Examples of org.gatein.pc.api.invocation.PortletInvocation

      instanceContext = createInstanceContext(portletContext, getAccessMode(), portletInstanceKey);
      WindowContext windowContext = createWindowContext(portletContext.getId(), runtimeContext);

      // prepare the invocation
      WSRPPortletInvocationContext context = new WSRPPortletInvocationContext(mediaType, securityContext, portalContext, userContext, instanceContext, windowContext);
      PortletInvocation invocation = initInvocation(context);

      // mark the invocation as coming from WSRP
      final HashMap<String, Object> attributes = new HashMap<String, Object>();
      attributes.put(WSRPConstants.FROM_WSRP_ATTRIBUTE_NAME, Boolean.TRUE);
      invocation.setRequestAttributes(attributes);

      invocation.setTarget(portlet.getContext());
      invocation.setWindowState(WSRPUtils.getJSR168WindowStateFromWSRPName(markupRequest.getWindowState()));
      invocation.setMode(WSRPUtils.getJSR168PortletModeFromWSRPName(markupRequest.getMode()));

      NavigationalContext navigationalContext = params.getNavigationalContext();
      if (navigationalContext != null)
      {
         StateString navigationalState = createNavigationalState(navigationalContext.getOpaqueValue());
         invocation.setNavigationalState(navigationalState);

         List<NamedString> publicParams = navigationalContext.getPublicValues();


         if (ParameterValidation.existsAndIsNotEmpty(publicParams))
         {
            Map<String, String[]> publicNS = WSRPUtils.createPublicNSFrom(publicParams);
            invocation.setPublicNavigationalState(publicNS);
         }
      }

      context.contextualize(invocation);
      setInvocation(invocation);
View Full Code Here

Examples of org.gatein.pc.api.invocation.PortletInvocation

   /** The serialVersionUID */
   private static final long serialVersionUID = 8522925340258546845L;

   protected HttpServletRequest getDispatchedRequest()
   {
      PortletInvocation invocation = getInvocation();
      return invocation.getRequest();
   }
View Full Code Here

Examples of org.gatein.pc.api.invocation.PortletInvocation

   /** The serialVersionUID */
   private static final long serialVersionUID = 8522925340258546845L;

   protected HttpServletRequest getDispatchedRequest()
   {
      PortletInvocation invocation = getInvocation();
      return invocation.getDispatchedRequest();
   }
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.