Package javax.portlet.faces.event

Examples of javax.portlet.faces.event.EventNavigationResult


      redirectEventTest();
   
   
   
    // URL encoded in the faces-config.xml -- based on the testname
    return new EventNavigationResult(null, testName);
  }
View Full Code Here


      String payload = (String) requestMap.get("portlet.bridge.tck.testAttr");
      if (payload == null || !payload.equals(testName))
      {
        sessionMap.put(EVENT_TEST_FAILED, "Event received but request scope wasn't restored.");
      }
      return new EventNavigationResult(null, testName+"EventNavigation");
    }
    else if (testName.equals("eventScopeNotRestoredModeChangedTest"))
    {
      // test -- that the request attr set in action is restored
      String payload = (String) requestMap.get("portlet.bridge.tck.testAttr");
      if (payload == null || !payload.equals(testName))
      {
        sessionMap.put(EVENT_TEST_FAILED, "Event received but request scope wasn't restored.");
      }
      return new EventNavigationResult(null, testName+"EventNavigation");
    }
    else if (testName.equals("eventControllerTest"))
    {
      // Verify the event phase attribute is set
      Bridge.PortletPhase phase = (Bridge.PortletPhase) requestMap.get(Bridge.PORTLET_LIFECYCLE_PHASE);
      requestMap.put("tck.eventPhaseCheck", new Boolean(phase != null && phase == Bridge.PortletPhase.EVENT_PHASE));
     
      // Now verify that a change to a public render parameter is carried forward
      String currentValue = (String) requestMap.get("modelPRP");
      if (currentValue == null) currentValue = "1";
      else currentValue = currentValue.concat("1");
     
      // Config is setup to exclude this value from bridge request scope -- so only get carried forward
      // if received in render request
      requestMap.put("modelPRP", currentValue);
      // Stash copy of value in an attr that is carried forward to compare.
      requestMap.put("tck.compareModelPRPValue", currentValue);

      // Verify that event navigation works
      return new EventNavigationResult(null, testName+"EventNavigation");
    }
   
    return null;
  }
View Full Code Here

      // For actions we only execute the lifecycle phase
      lifecycle.execute(context);
     
      // call the eventhandler to process
      EventNavigationResult result = mEventHandler.handleEvent(context, request.getEvent());
     
      // If redirected either during lifecycle or event handling merely return as new target is already encoded in response.
      if (context.getResponseComplete())
      {
        // clear scopeid render parameter
        removeScope = true;
        return;
      }
     
      if (result != null)
      {
        context.getApplication().getNavigationHandler().handleNavigation(context, result.getFromAction(), result.getOutcome());
        // the navigation rule might indicate a redirect
        if (context.getResponseComplete())
        {
          // clear scopeid render parameter
          removeScope = true;
View Full Code Here

         }
         //get the event from the request
         Event event = request.getEvent();

         //Handle the event and get the result
         EventNavigationResult result = eventHandler.handleEvent(facesContext, event);

         if (result != null)
         {
            facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext,
                                                                                  result.getFromAction(),
                                                                                  result.getOutcome());
            // the navigation rule might indicate a redirect
            if (facesContext.getResponseComplete())
            {
               return;
            }
View Full Code Here

      // For actions we only execute the lifecycle phase
      lifecycle.execute(context);
     
      // call the eventhandler to process
      EventNavigationResult result = mEventHandler.handleEvent(context, request.getEvent());
     
      if (result != null)
      {
        context.getApplication().getNavigationHandler().handleNavigation(context, result.getFromAction(), result.getOutcome());
      }

      finalizeActionResponse(context);
       
      // Process any Public Render parameter changes
View Full Code Here

      // For actions we only execute the lifecycle phase
      lifecycle.execute(context);
     
      // call the eventhandler to process
      EventNavigationResult result = mEventHandler.handleEvent(context, request.getEvent());
     
      if (result != null)
      {
        context.getApplication().getNavigationHandler().handleNavigation(context, result.getFromAction(), result.getOutcome());
      }

      finalizeActionResponse(context);
       
      // Process any Public Render parameter changes
View Full Code Here

        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);
View Full Code Here

  // Logger
  private static final Logger logger = LoggerFactory.getLogger(CustomerSelectedEventHandler.class);

  public EventNavigationResult handleEvent(FacesContext facesContext, Event event) {
    EventNavigationResult eventNavigationResult = null;
    String eventQName = event.getQName().toString();

    if (eventQName.equals("{http://liferay.com/events}ipc.customerSelected")) {
      Serializable value = event.getValue();

      // FACES-1465: If the payload is wrapped, then a redirect may have taken place. In any case, get the
      // payload from the wrapper.
      if (value instanceof EventPayloadWrapper) {
        value = ((EventPayloadWrapper) value).getWrapped();
      }

      Customer customer = (Customer) value;
      BookingsModelBean bookingsModelBean = getBookingsModelBean(facesContext);
      bookingsModelBean.setCustomer(customer);

      String fromAction = null;
      String outcome = "ipc.customerSelected";
      eventNavigationResult = new EventNavigationResult(fromAction, outcome);
      logger.debug("Received event ipc.customerSelected for customerId=[{0}] firstName=[{1}] lastName=[{2}]",
        new Object[] { customer.getCustomerId(), customer.getFirstName(), customer.getLastName() });
    }

    return eventNavigationResult;
View Full Code Here

  // Logger
  private static final Logger logger = LoggerFactory.getLogger(CustomerEditedEventHandler.class);

  public EventNavigationResult handleEvent(FacesContext facesContext, Event event) {
    EventNavigationResult eventNavigationResult = null;
    String eventQName = event.getQName().toString();

    if (eventQName.equals("{http://liferay.com/events}ipc.customerEdited")) {
      Customer customer = (Customer) event.getValue();
      getCustomerService(facesContext).save(customer);
View Full Code Here

TOP

Related Classes of javax.portlet.faces.event.EventNavigationResult

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.