Examples of ActionResponse


Examples of javax.portlet.ActionResponse

      url = actionURL.toString();
      url = url.replaceAll("\\&amp\\;", "&");
    }
    else
    { // action - write the viewId to navigational state
      ActionResponse actionResponse = (ActionResponse) getResponse();

      // set request params into navigational states
      Enumeration<String> list = queryStr.getParameterNames();
      while (list.hasMoreElements())
      {
        String param = list.nextElement();
        if (param.equals(Bridge.PORTLET_MODE_PARAMETER))
        {
          try
          {
            actionResponse.setPortletMode(new PortletMode(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            //TODO: Ignoring is probably dangerous here as it means that we are
            //      EITHER using exceptions for flow control (which is extreemly
            //      inefficient) or we should log a message saying what the issue
            //      is.  According to the Javadocs an exception is thrown here if the
            //      portlet mode is not allowed or if sendRedirect has already been
            //      called.  In either case we should log an information type message
            //      here.
            ; // do nothing -- just ignore
          }
        }
        else if (param.equals(Bridge.PORTLET_WINDOWSTATE_PARAMETER))
        {
          try
          {
            actionResponse.setWindowState(new WindowState(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            ; // do nothing -- just ignore
          }
        }
        else if (param.equals(Bridge.PORTLET_SECURE_PARAMETER))
        {
          ; // ignore -- do nothing as can't encode into an actionResponse
        }
        else
        {
          actionResponse.setRenderParameter(param, queryStr.getParameter(param));
        }
      }
    }
    // Because we want to support translating a redirect that occurs
    // during a render as an in place navigation AND we can't reverse
View Full Code Here

Examples of javax.portlet.ActionResponse

     * @param location The location string
     * @param invocation The action invocation
     */
    private void executeActionResult(String location,
            ActionInvocation invocation) {
        ActionResponse res = PortletActionContext.getActionResponse();
        // View is rendered outside an action...uh oh...
        res.setRenderParameter(PortletActionConstants.ACTION_PARAM,
                "freemarkerDirect");
        res.setRenderParameter("location", location);
        res.setRenderParameter(PortletActionConstants.MODE_PARAM, PortletActionContext
                .getRequest().getPortletMode().toString());

    }
View Full Code Here

Examples of javax.portlet.ActionResponse

   * @param finalLocation
   * @param invocation
   */
  protected void executeActionResult(String finalLocation, ActionInvocation invocation) throws Exception {
    LOG.debug("Executing result in Event phase");
    ActionResponse res = PortletActionContext.getActionResponse();
    Map sessionMap = invocation.getInvocationContext().getSession();
    LOG.debug("Setting event render parameter: " + finalLocation);
    if (finalLocation.indexOf('?') != -1) {
      convertQueryParamsToRenderParams(res, finalLocation.substring(finalLocation.indexOf('?') + 1));
      finalLocation = finalLocation.substring(0, finalLocation.indexOf('?'));
    }
    if (finalLocation.endsWith(".action")) {
      // View is rendered with a view action...luckily...
      finalLocation = finalLocation.substring(0, finalLocation.lastIndexOf("."));
      res.setRenderParameter(ACTION_PARAM, finalLocation);
    } else {
      // View is rendered outside an action...uh oh...
      res.setRenderParameter(ACTION_PARAM, "renderDirect");
      sessionMap.put(RENDER_DIRECT_LOCATION, finalLocation);
    }
    if(portletMode != null) {
      res.setPortletMode(portletMode);
      res.setRenderParameter(PortletActionConstants.MODE_PARAM, portletMode.toString());
    }
    else {
      res.setRenderParameter(PortletActionConstants.MODE_PARAM, PortletActionContext.getRequest().getPortletMode()
          .toString());
    }
  }
View Full Code Here

Examples of javax.portlet.ActionResponse

  @SuppressWarnings("unchecked")
  private void saveStack(ActionInvocation invocation) {
    Map session = invocation.getInvocationContext().getSession();
    session.put(STACK_FROM_EVENT_PHASE, invocation.getStack());
    ActionResponse actionResponse = (ActionResponse) invocation.getInvocationContext().get(RESPONSE);
    actionResponse.setRenderParameter(EVENT_ACTION, "true");
  }
View Full Code Here

Examples of javax.portlet.ActionResponse

            actionRequest =
            PortletObjectAccess.getActionRequest(portletWindow,
                                                 servletRequest,
                                                 servletResponse);

            ActionResponse actionResponse = PortletObjectAccess.getActionResponse(portletWindow,
                                                                                  servletRequest,
                                                                                  servletResponse);
            invoker = PortletInvokerAccess.getPortletInvoker(portletWindow.getPortletEntity().getPortletDefinition());

            _actionResponse = (InternalActionResponse)actionResponse;
View Full Code Here

Examples of javax.portlet.ActionResponse

    public void testActionPortletRequest() throws NoSuchFieldException,
            IllegalAccessException    {
        ApplicationContext applicationContext = createMock(ApplicationContext.class);
        PortletContext portletContext = createMock(PortletContext.class);
        ActionRequest request = createMock(ActionRequest.class);
        ActionResponse response = createMock(ActionResponse.class);

        replay(applicationContext, portletContext, request, response);
        ActionPortletRequest req = new ActionPortletRequest(applicationContext,
                portletContext, request, response);
        Class<? extends ActionPortletRequest> clazz = req.getClass();
View Full Code Here

Examples of javax.portlet.ActionResponse

            String action = namespace + actionName + "!" + renderMethod;
            if (log.isInfoEnabled())
              log.info("Diverting Portlet render action: " + action);

            // set action name
            ActionResponse res = PortletActionContext.getActionResponse();
            res.setRenderParameter(PortletActionConstants.ACTION_PARAM, action);
            sessionMap.put(WebAction.PORTLET_ACTION_RESULT, resultCode);

            // remove RENDER_DIRECT_LOCATION
      sessionMap.remove(RENDER_DIRECT_LOCATION);
        }  
View Full Code Here

Examples of javax.portlet.ActionResponse

  @SuppressWarnings("unchecked")
  private void saveStack(ActionInvocation invocation) {
    Map session = invocation.getInvocationContext().getSession();
    session.put(STACK_FROM_EVENT_PHASE, invocation.getStack());
    ActionResponse actionResponse = (ActionResponse) invocation.getInvocationContext().get(RESPONSE);
    actionResponse.setRenderParameter(EVENT_ACTION, "true");
  }
View Full Code Here

Examples of javax.portlet.ActionResponse

            Thread.currentThread().setContextClassLoader(paClassLoader);

        if (method == ContainerConstants.METHOD_ACTION)
        {
            ActionRequest actionRequest = (ActionRequest)portletRequest;           
            ActionResponse actionResponse = (ActionResponse)portletResponse;

                portletInstance.processAction(actionRequest, actionResponse);
        }
        else if (method == ContainerConstants.METHOD_RENDER)
        {
View Full Code Here

Examples of javax.portlet.ActionResponse

        PortletInvokerService invoker = getContainerServices().getPortletInvokerService();

        PortletRequestContext requestContext = rcService.getPortletActionRequestContext(this, request, response, portletWindow);
        PortletActionResponseContext responseContext = rcService.getPortletActionResponseContext(this, request, response, portletWindow);
        ActionRequest portletRequest = envService.createActionRequest(requestContext, responseContext);
        ActionResponse portletResponse = envService.createActionResponse(responseContext);

        FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.ACTION_PHASE);

        String location = null;
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.