Package org.apache.struts2.portlet

Examples of org.apache.struts2.portlet.PortletPhase


     * the {@link PortletActionContext}into an {@link ApplicationMap}.
     *
     * @return a Map of all application attributes.
     */
    protected Map getApplicationMap() {
        return new PortletApplicationMap(getPortletContext());
    }
View Full Code Here


  private static final long serialVersionUID = 6138452063353911784L;

  @Override
  public String intercept(ActionInvocation invocation) throws Exception {
    PortletPhase phase = (PortletPhase) invocation.getInvocationContext().get(PortletConstants.PHASE);
    if (phase.isRender()) {
      restoreStack(invocation);
      return invocation.invoke();
    } else if (phase.isAction()) {
      try {
        return invocation.invoke();
      } finally {
        saveStack(invocation);
      }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.struts2.dispatcher.StrutsResultSupport#doExecute(java.lang.String, com.opensymphony.xwork2.ActionInvocation)
     */
    public void doExecute(String location, ActionInvocation invocation) throws Exception {
        PortletPhase phase = PortletActionContext.getPhase();
        if (phase.isAction()) {
            executeActionResult(location, invocation);
        } else if (phase.isRender()) {
            executeRenderResult(location, invocation);
        }
    }
View Full Code Here

  private static final long serialVersionUID = 6138452063353911784L;

  @Override
  public String intercept(ActionInvocation invocation) throws Exception {
    PortletPhase phase = (PortletPhase) invocation.getInvocationContext().get(PortletConstants.PHASE);
    if (phase.isRender()) {
      restoreStack(invocation);
      return invocation.invoke();
    } else if (phase.isAction()) {
      try {
        return invocation.invoke();
      } finally {
        saveStack(invocation);
      }
View Full Code Here

     * template processing workflow by calling the hooks for preTemplateProcess
     * and postTemplateProcess
     */
    public void doExecute(String location, ActionInvocation invocation)
            throws IOException, TemplateException, PortletException {
        PortletPhase phase = PortletActionContext.getPhase();
        if (phase.isAction()) {
            executeActionResult(location, invocation);
        } else if (phase.isRender()) {
            executeRenderResult(location, invocation);
        }
    }
View Full Code Here

    }

    public void testIsRender() {
        context.put(PHASE, PortletPhase.RENDER_PHASE);

        PortletPhase phase = getPhase();

        assertTrue(phase.isRender());
        assertFalse(phase.isAction());
        assertFalse(phase.isEvent());
    }
View Full Code Here

    }

    public void testIsAction() {
        context.put(PHASE, PortletPhase.ACTION_PHASE);

        PortletPhase phase = getPhase();

        assertTrue(phase.isAction());
        assertFalse(phase.isRender());
        assertFalse(phase.isEvent());
    }
View Full Code Here

    }
   
    public void testIsEvent() {
      context.put(PHASE, PortletPhase.EVENT_PHASE);

        PortletPhase phase = getPhase();

      assertTrue(phase.isEvent());
      assertFalse(phase.isAction());
      assertFalse(phase.isRender());
    }
View Full Code Here

   *
   * @see com.opensymphony.xwork2.Result#execute(com.opensymphony.xwork2.ActionInvocation)
   */
  public void doExecute(String finalLocation, ActionInvocation actionInvocation) throws Exception {

        PortletPhase phase = PortletActionContext.getPhase();
        if (phase.isRender() || phase.isResource()) {
      executeMimeResult(finalLocation);
    } else if (phase.isAction() || phase.isEvent()) {
      executeActionResult(finalLocation, actionInvocation);
    } else {
      executeRegularServletResult(finalLocation, actionInvocation);
    }
  }
View Full Code Here

     * template processing workflow by calling the hooks for preTemplateProcess
     * and postTemplateProcess
     */
    public void doExecute(String location, ActionInvocation invocation)
            throws IOException, TemplateException, PortletException {
        PortletPhase phase = PortletActionContext.getPhase();
        if (phase.isAction()) {
           executeActionResult(location, invocation);
        } else if (phase.isRender()) {
           executeRenderResult(location, invocation);
        } else if (phase.isResource()){
           executeResourceResult(location, invocation);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.struts2.portlet.PortletPhase

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.