public void interceptActionResult(
      ARIResult result, ViewParameters incoming, Object actionReturn) {
    // OptionViewParameters outgoing = (OptionViewParameters) result.resultingView;
    // SAK-14726 : Start BugFix
    if (LOG.isDebugEnabled() && actionReturn != null) {
      LOG.debug("actionReturn is of type " + actionReturn.getClass());
    }

    if (actionReturn == null) {
      return;
    }

    Poll poll = null;

    if (actionReturn instanceof org.sakaiproject.poll.model.Poll) {
      poll = (Poll) actionReturn;
    } else {

      PollViewParameters ecvp = (PollViewParameters) incoming;

      if (null == ecvp || null == ecvp.id || "New 0".equals(ecvp.id)) {
        return;

      } else {

        poll = pollListManager.getPollById(Long.valueOf(ecvp.id));
      }
    }
    // SAK-14726 : End BugFix

    if (poll == null) {
      return;
    }

    LOG.debug("Action result got poll: " + poll.getPollId());
    LOG.debug("resulting view is: " + result.resultingView);

    if (poll.getPollOptions() == null || poll.getPollOptions().size() == 0) {
      result.resultingView =
          new OptionViewParameters(PollOptionProducer.VIEW_ID, null, poll.getPollId().toString());
    } else {
      result.resultingView = new SimpleViewParameters(PollToolProducer.VIEW_ID);
    }

    // if (poll != null && outgoing.id == null) {
    //  outgoing.id = poll.getId().toString();
    // }
  }
 /* (non-Javadoc)
  * @see uk.org.ponder.rsf.flow.ActionResultInterceptor#interceptActionResult(uk.org.ponder.rsf.flow.ARIResult, uk.org.ponder.rsf.viewstate.ViewParameters, java.lang.Object)
  */
 public void interceptActionResult(
     ARIResult result, ViewParameters incoming, Object actionReturn) {
   // handles the navigation cases and passing along data from view to view
   EvalViewParameters evp = (EvalViewParameters) incoming;
   Long evalId = evp.evaluationId;
   if ("evalSettings".equals(actionReturn)) {
     result.resultingView = new EvalViewParameters(EvaluationSettingsProducer.VIEW_ID, evalId);
   } else if ("evalAssign".equals(actionReturn)) {
     result.resultingView = new EvalViewParameters(EvaluationAssignProducer.VIEW_ID, evalId);
   } else if ("evalConfirm".equals(actionReturn)) {
     result.resultingView =
         new EvalViewParameters(EvaluationAssignConfirmProducer.VIEW_ID, evalId);
   } else if ("controlEvals".equals(actionReturn)) {
     result.resultingView = new SimpleViewParameters(ControlEvaluationsProducer.VIEW_ID);
   }
 }
Beispiel #3
0
 // new hotness
 public void interceptActionResult(
     ARIResult result, ViewParameters incoming, Object actionReturn) {
   if ("success".equals(actionReturn) || "cancel".equals(actionReturn)) {
     result.resultingView = new SimpleViewParameters(GroupListProducer.VIEW_ID);
   }
 }