Examples of PortletPhase


Examples of javax.portlet.faces.Bridge.PortletPhase

  @Override
  public String getRedirectURL(FacesContext facesContext, String viewId, Map<String, List<String>> parameters,
    boolean includeViewParams) {

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletPhase portletRequestPhase = BridgeUtil.getPortletRequestPhase();

    // Determine whether or not it is necessary to work-around the patch applied to Mojarra in JAVASERVERFACES-3023
    boolean workaroundMojarra = (MOJARRA_DETECTED) &&
      ((portletRequestPhase == Bridge.PortletPhase.ACTION_PHASE) ||
        (portletRequestPhase == Bridge.PortletPhase.EVENT_PHASE));
View Full Code Here

Examples of javax.portlet.faces.Bridge.PortletPhase

    // NOTE: We only care about phases prior to the RENDER_PHASE because we're concerned here about managed beans
    // that get added to the request scope when the BridgeRequestScope begins. We're trying to provide those managed
    // beans with an opportunity to prepare for an unexpected invocation of their methods annotated with
    // @PreDestroy.
    ServletRequest servletRequest = servletRequestAttributeEvent.getServletRequest();
    PortletPhase phase = (PortletPhase) servletRequest.getAttribute(Bridge.PORTLET_LIFECYCLE_PHASE);

    // If this is taking place within a PortletRequest handled by the bridge in any phase prior to the
    // RENDER_PHASE, then
    if ((phase != null) && (phase != PortletPhase.RENDER_PHASE)) {
View Full Code Here

Examples of javax.portlet.faces.Bridge.PortletPhase

    throws MalformedURLException {

    PortletURL redirectURL = null;

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletPhase portletRequestPhase = bridgeContext.getPortletRequestPhase();

    if ((portletRequestPhase == Bridge.PortletPhase.RENDER_PHASE) ||
        (portletRequestPhase == Bridge.PortletPhase.RESOURCE_PHASE)) {

      try {
View Full Code Here

Examples of javax.portlet.faces.Bridge.PortletPhase

    return redirectURL;
  }

  public PortletURL createRenderURL(String fromURL) throws MalformedURLException {
    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletPhase portletRequestPhase = bridgeContext.getPortletRequestPhase();

    if ((portletRequestPhase == Bridge.PortletPhase.RENDER_PHASE) ||
        (portletRequestPhase == Bridge.PortletPhase.RESOURCE_PHASE)) {

      try {
        logger.debug("createRenderURL fromURL=[" + fromURL + "]");

        MimeResponse mimeResponse = (MimeResponse) bridgeContext.getPortletResponse();
        PortletURL renderURL = createRenderURL(mimeResponse);
        copyRequestParameters(fromURL, renderURL);

        return renderURL;
      }
      catch (ClassCastException e) {
        throw new MalformedURLException(e.getMessage());
      }
    }
    else {
      throw new MalformedURLException("Unable to create a RenderURL during " + portletRequestPhase.toString());
    }

  }
View Full Code Here

Examples of javax.portlet.faces.Bridge.PortletPhase

        (beganInPhase == Bridge.PortletPhase.EVENT_PHASE) ||
        (beganInPhase == Bridge.PortletPhase.RESOURCE_PHASE));

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();

    PortletPhase portletRequestPhase = bridgeContext.getPortletRequestPhase();

    if (portletRequestPhase == Bridge.PortletPhase.RENDER_PHASE) {

      if (!portletMode.equals(bridgeContext.getPortletRequest().getPortletMode())) {
        setPortletModeChanged(true);
View Full Code Here

Examples of javax.portlet.faces.Bridge.PortletPhase

  protected BaseURL toBaseURL() throws MalformedURLException {

    BaseURL baseURL = null;

    // If this is executing during the ACTION_PHASE of the portlet lifecycle, then
    PortletPhase portletRequestPhase = BridgeUtil.getPortletRequestPhase();

    if (portletRequestPhase == Bridge.PortletPhase.ACTION_PHASE) {

      // The Mojarra MultiViewHandler.getResourceURL(String) method is implemented in such a way that it calls
      // ExternalContext.encodeActionURL(ExternalContext.encodeResourceURL(url)). The return value of those calls
View Full Code Here

Examples of org.apache.struts2.portlet.PortletPhase

  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

Examples of org.apache.struts2.portlet.PortletPhase

    /* (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

Examples of org.apache.struts2.portlet.PortletPhase

  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

Examples of org.apache.struts2.portlet.PortletPhase

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