Пример #1
0
  private void prepareRemoveFromWaitingList(
      SignupMeeting meeting, SignupTimeslot timeSlot, SignupAttendee removedWaiter)
      throws Exception {

    SignupTimeslot currentTimeSlot = timeSlot;
    List<SignupTimeslot> signupTimeSlots = meeting.getSignupTimeSlots();
    for (SignupTimeslot upToDateTimeslot : signupTimeSlots) {
      if (currentTimeSlot.getId().equals(upToDateTimeslot.getId())) {
        currentTimeSlot = upToDateTimeslot;
        break;
      }
    }
    boolean found = false;
    List<SignupAttendee> waiters = currentTimeSlot.getWaitingList();
    if (waiters != null) {
      for (Iterator iter = waiters.iterator(); iter.hasNext(); ) {
        SignupAttendee waiter = (SignupAttendee) iter.next();
        if (removedWaiter.getAttendeeUserId().equals(waiter.getAttendeeUserId())) {
          iter.remove();
          found = true;
        }
      }
      if (!found) {
        throw new SignupUserActionException(
            Utilities.rb.getString("someone.already.removed_or_promoted_attendee"));
      }
    }
  }
Пример #2
0
  /**
   * This is a getter method for UI.
   *
   * @return true if one of the timeslot is locked or cancelled.
   */
  public boolean isAtleastOneTimeslotLockedOrCanceled() {
    List<SignupTimeslot> signupTimeSlots = meeting.getSignupTimeSlots();
    if (signupTimeSlots == null) return false;

    for (SignupTimeslot timeslot : signupTimeSlots) {
      if (timeslot.isCanceled() || timeslot.isLocked()) return true;
    }

    return false;
  }
Пример #3
0
 protected List<VEvent> eventsWhichUserIsAttending(User user) {
   final List<SignupTimeslot> timeslots = meeting.getSignupTimeSlots();
   List<VEvent> events = new ArrayList<VEvent>();
   for (SignupTimeslot timeslot : timeslots) {
     if (userIsAttendingTimeslot(user, timeslot)) {
       final VEvent event = timeslot.getVevent();
       if (event != null) {
         events.add(event);
       }
     }
   }
   return events;
 }
Пример #4
0
  /**
   * This method perform Remove process for removing attendee from the waiting list in the
   * event/meeting.
   *
   * @param meeting a SignupMeeting object.
   * @param timeslot a SignupTimeslot object.
   * @param waiter a SignupAttendee object.
   * @return a SignupMeeting object, which is a refreshed updat-to-date data.
   * @throws Exception throw if anything goes wrong.
   */
  public SignupMeeting removeFromWaitingList(
      SignupMeeting meeting, SignupTimeslot timeslot, SignupAttendee waiter) throws Exception {
    try {

      handleVersion(meeting, timeslot, waiter);
      if (ToolManager.getCurrentPlacement() != null) {
        String signupEventType =
            isOrganizer
                ? SignupEventTypes.EVENT_SIGNUP_REMOVE_ATTENDEE_WL_L
                : SignupEventTypes.EVENT_SIGNUP_REMOVE_ATTENDEE_WL_S;
        Utilities.postEventTracking(
            signupEventType,
            ToolManager.getCurrentPlacement().getContext()
                + " meetingId:"
                + meeting.getId()
                + " -removed from wlist on TS:"
                + SignupDateFormat.format_date_h_mm_a(timeslot.getStartTime()));
      }
      logger.debug(
          "Meeting Name:"
              + meeting.getTitle()
              + " - UserId:"
              + currentUserId
              + " - has removed attendee(userId):"
              + waiter.getAttendeeUserId()
              + " from waiting list"
              + " at timeslot started at:"
              + SignupDateFormat.format_date_h_mm_a(timeslot.getStartTime()));
    } catch (PermissionException pe) {
      throw new SignupUserActionException(Utilities.rb.getString("no.permissoin.do_it"));
    } finally {
      meeting = reloadMeeting(meeting.getId());
    }
    // TODO calendar event id;
    return meeting;
  }
Пример #5
0
 protected boolean userIsAttendingTimeslot(User user, SignupTimeslot timeslot) {
   return timeslot.getAttendee(user.getId()) != null;
 }