Package javax.portlet

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


            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

    // org.apache.pluto.factory.ActionResponseFactory implementation ------------------------------
    public ActionResponse getActionResponse(PortletWindow portletWindow,
                                            javax.servlet.http.HttpServletRequest servletRequest,
                                            javax.servlet.http.HttpServletResponse servletResponse)
    {
        ActionResponse actionResponse = new ActionResponseImpl(portletWindow,
                                                               servletRequest,
                                                               servletResponse );
        return actionResponse;
    }
View Full Code Here

    /**
     * @param location
     * @param invocation
     */
    protected void executeActionResult(String location, ActionInvocation invocation) {
        ActionResponse res = PortletActionContext.getActionResponse();

        res.setRenderParameter(PortletConstants.ACTION_PARAM, "tilesDirect");

        Map<String, Object> sessionMap = invocation.getInvocationContext().getSession();
        sessionMap.put(PortletConstants.RENDER_DIRECT_LOCATION, location);

        res.setRenderParameter(PortletConstants.MODE_PARAM, PortletActionContext.getRequest().getPortletMode().toString());
    }
View Full Code Here

      super.setUp();
    interceptor = new PortletStateInterceptor();
  }
 
  public void testCopyValueStackFromEventToRenderPhase() throws Exception {
    ActionResponse actionResponse = EasyMock.createNiceMock(ActionResponse.class);
    ActionInvocation invocation = EasyMock.createNiceMock(ActionInvocation.class);
   
    Map<String, Object> ctxMap = new HashMap<String, Object>();
    ctxMap.put(PHASE, PortletPhase.ACTION_PHASE);
    ctxMap.put(RESPONSE, actionResponse);
    Map<String, Object> session = new HashMap<String, Object>();
   
    ActionContext ctx = new ActionContext(ctxMap);
    ctx.setSession(session);
    EasyMock.expect(invocation.getInvocationContext()).andStubReturn(ctx);
    actionResponse.setRenderParameter(EVENT_ACTION, "true");
   
    ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack();
    EasyMock.expect(invocation.getStack()).andStubReturn(stack);
   
    EasyMock.replay(actionResponse);
View Full Code Here

            executeRenderResult(location, invocation);
        }
    }

    private void executeActionResult(String location, ActionInvocation invocation) {
        ActionResponse res = PortletActionContext.getActionResponse();
        // View is rendered outside an action...uh oh...
        invocation.getInvocationContext().getSession().put(PortletConstants.RENDER_DIRECT_LOCATION, location);
        res.setRenderParameter(PortletConstants.ACTION_PARAM, "freemarkerDirect");
        res.setRenderParameter("location", location);
        res.setRenderParameter(PortletConstants.MODE_PARAM, PortletActionContext.getRequest().getPortletMode().toString());

    }
View Full Code Here

        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

            // The requested method is ACTION: call Portlet.processAction(..)
            else if (methodId == PortletInvokerService.METHOD_ACTION)
            {
                ActionRequest actionRequest = (ActionRequest) portletRequest;
                ActionResponse actionResponse = (ActionResponse) portletResponse;
                filterManager.processFilter(actionRequest, actionResponse,
                        portlet, portletContext);
            }

            // The request methode is Event: call Portlet.processEvent(..)
View Full Code Here

      super.setUp();
    interceptor = new PortletStateInterceptor();
  }
 
  public void testCopyValueStackFromEventToRenderPhase() throws Exception {
    ActionResponse actionResponse = EasyMock.createNiceMock(ActionResponse.class);
    ActionInvocation invocation = EasyMock.createNiceMock(ActionInvocation.class);
   
    Map<String, Object> ctxMap = new HashMap<String, Object>();
    ctxMap.put(PHASE, ACTION_PHASE);
    ctxMap.put(RESPONSE, actionResponse);
    Map<String, Object> session = new HashMap<String, Object>();
   
    ActionContext ctx = new ActionContext(ctxMap);
    ctx.setSession(session);
    EasyMock.expect(invocation.getInvocationContext()).andStubReturn(ctx);
    actionResponse.setRenderParameter(EVENT_ACTION, "true");
   
    ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack();
    EasyMock.expect(invocation.getStack()).andStubReturn(stack);
   
    EasyMock.replay(actionResponse);
View Full Code Here

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

TOP

Related Classes of javax.portlet.ActionResponse

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.