Package javax.portlet.faces

Examples of javax.portlet.faces.BridgeException


        // If there were any "handled" exceptions queued, then throw a BridgeException.
        Throwable handledException = getJSF2HandledException(facesContext);

        if (handledException != null) {
          throw new BridgeException(handledException);
        }

        // Otherwise, if there were any "unhandled" exceptions queued, then throw a BridgeException.
        Throwable unhandledException = getJSF2UnhandledException(facesContext);

        if (unhandledException != null) {
          throw new BridgeException(unhandledException);
        }

        // Set a flag on the bridge request scope indicating that the Faces Lifecycle has executed.
        bridgeRequestScope.setFacesLifecycleExecuted(true);

        // If there is a bridgeEventHandler registered in portlet.xml, then invoke the handler so that it
        // can process the event payload.

        logger.debug("Invoking {0} for class=[{1}]", bridgeEventHandlerAttributeName,
          bridgeEventHandler.getClass());

        Event event = eventRequest.getEvent();
        EventNavigationResult eventNavigationResult = bridgeEventHandler.handleEvent(facesContext, event);

        if (eventNavigationResult != null) {
          String oldViewId = facesContext.getViewRoot().getViewId();
          String fromAction = eventNavigationResult.getFromAction();
          String outcome = eventNavigationResult.getOutcome();
          logger.debug("Invoking navigationHandler fromAction=[{0}] outcome=[{1}]", fromAction, outcome);

          NavigationHandler navigationHandler = facesContext.getApplication().getNavigationHandler();
          navigationHandler.handleNavigation(facesContext, fromAction, outcome);

          String newViewId = facesContext.getViewRoot().getViewId();
          bridgeRequestScope.setNavigationOccurred(!oldViewId.equals(newViewId));
        }

        // Save the faces view root and any messages in the faces context so that they can be restored during
        // the RENDER_PHASE of the portlet lifecycle.
        bridgeRequestScope.saveState(facesContext);

        // Assume that the bridge request scope should be maintained from the EVENT_PHASE into the
        // RENDER_PHASE by utilizing render parameters.
        BridgeRequestScope.Transport bridgeRequestScopeTransport =
          BridgeRequestScope.Transport.RENDER_PARAMETER;
        Serializable eventPayload = event.getValue();

        // FACES-1465: If the portlet developer intentionally wrapped the event payload is with an
        // EventPayloadWrapper, then determine whether or not this is happening during a redirect. If this is
        // the case, then the bridge request scope must be maintained from the EVENT_PHASE into the RENDER_PHASE
        // by utilizing a portlet session attribute. This is because render parameters will not survive a
        // redirect.
        if ((eventPayload != null) && (eventPayload instanceof EventPayloadWrapper)) {
          EventPayloadWrapper eventPayloadWrapper = (EventPayloadWrapper) eventPayload;

          if (eventPayloadWrapper.isRedirect()) {

            bridgeRequestScopeTransport = BridgeRequestScope.Transport.PORTLET_SESSION_ATTRIBUTE;
          }
        }

        maintainBridgeRequestScope(eventRequest, eventResponse, bridgeRequestScopeTransport);

        // Process the outgoing public render parameters.
        // TCK TestPage064: eventControllerTest
        processOutgoingPublicRenderParameters(facesLifecycle);
      }

      // Maintain the render parameters set in the ACTION_PHASE so that they carry over to the RENDER_PHASE.
      bridgeContext.getPortletContainer().maintainRenderParameters(eventRequest, eventResponse);

      // Spec 6.6 (Namespacing)
      indicateNamespacingToConsumers(facesContext.getViewRoot(), eventResponse);
    }
    catch (Throwable t) {
      throw new BridgeException(t);
    }
    finally {
      cleanup();
    }
  }
View Full Code Here


      }
      catch (BridgeException e) {
        throw e;
      }
      catch (Throwable t) {
        throw new BridgeException(t);
      }
      finally {
        cleanup();
      }
View Full Code Here

    // If there were any "handled" exceptions queued, then throw a BridgeException.
    Throwable handledException = getJSF2HandledException(facesContext);

    if (handledException != null) {
      throw new BridgeException(handledException);
    }

    // Otherwise, if there were any "unhandled" exceptions queued, then throw a BridgeException.
    Throwable unhandledException = getJSF2UnhandledException(facesContext);

    if (unhandledException != null) {
      throw new BridgeException(unhandledException);
    }

    // Otherwise, if the PortletMode has changed, and a navigation-rule hasn't yet fired (which could have happened
    // in the EVENT_PHASE), then switch to the appropriate PortletMode and navigate to the current viewId in the
    // UIViewRoot.
View Full Code Here

      // If there were any "handled" exceptions queued, then throw a BridgeException.
      Throwable handledException = getJSF2HandledException(facesContext);

      if (handledException != null) {
        throw new BridgeException(handledException);
      }

      // Otherwise, if there were any "unhandled" exceptions queued, then throw a BridgeException.
      Throwable unhandledException = getJSF2UnhandledException(facesContext);

      if (unhandledException != null) {
        throw new BridgeException(unhandledException);
      }

      // Set a flag on the bridge request scope indicating that the Faces Lifecycle has executed.
      bridgeRequestScope.setFacesLifecycleExecuted(true);

      // Since this is a full-page postback, the <head>...</head> section of the portal page needs to be
      // completely re-rendered during the subsequent RENDER_PHASE of the portlet lifecycle. Because of this, the
      // resources in the HeadManagedBean must be cleared so that the bridge will not recognize any resources as
      // already being present in the <head>...</head> section.
      clearHeadManagedBeanResources(facesContext);

      // Save the faces view root and any messages in the faces context so that they can be restored during
      // the RENDER_PHASE of the portlet lifecycle.
      bridgeRequestScope.saveState(facesContext);
      maintainBridgeRequestScope(actionRequest, actionResponse, BridgeRequestScope.Transport.RENDER_PARAMETER);

      // Spec 6.6 (Namespacing)
      indicateNamespacingToConsumers(facesContext.getViewRoot(), actionResponse);
    }
    catch (Throwable t) {
      throw new BridgeException(t);
    }
    finally {
      cleanup();
    }
  }
View Full Code Here

        // Spec 6.6 (Namespacing)
        indicateNamespacingToConsumers(facesContext.getViewRoot(), resourceResponse);
      }
    }
    catch (Throwable t) {
      throw new BridgeException(t);
    }
    finally {
      cleanup();
    }
View Full Code Here

TOP

Related Classes of javax.portlet.faces.BridgeException

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.