Examples of Appointment


Examples of org.apache.openmeetings.db.entity.calendar.Appointment

 
  public Appointment getAppointment(Date start, Date end) {
    assertNotNull("Can't access to appointment dao implimentation", appointmentDao);

    // add new appointment
    Appointment ap = new Appointment();

    ap.setTitle("appointmentName");
    ap.setLocation("appointmentLocation");

    ap.setStart(start);
    ap.setEnd(end);
    ap.setDescription("appointmentDescription");
    ap.setInserted(new Date());
    ap.setDeleted(false);
    ap.setIsDaily(false);
    ap.setIsWeekly(false);
    ap.setIsMonthly(false);
    ap.setIsYearly(false);
    ap.setPasswordProtected(false);

    ap.setOwner(userDao.get(1L));
    ap.setConnectedEvent(false);

    if (ap.getRemind() == null && !remindTypes.isEmpty()) {
      ap.setRemind(remindTypes.get(0));
    }
   
    Room r = new Room();
    if (!roomTypes.isEmpty()) {
      r.setRoomtype(roomTypes.get(0));
    }
    r.setAppointment(true);
    ap.setRoom(r);
    return ap;
  }
View Full Code Here

Examples of org.apache.openmeetings.db.entity.calendar.Appointment

   
    Calendar now = Calendar.getInstance();
    Calendar a1End = Calendar.getInstance();
    a1End.setTime(now.getTime());
    a1End.add(Calendar.HOUR_OF_DAY, 1);
    Appointment a1 = getAppointment(now.getTime(), a1End.getTime());
    a1.setTitle("GetAppointment");
   
    a1 = appointmentDao.update(a1, userId);
   
    Appointment a = appointmentDao.get(a1.getId());
    assertNotNull("Failed to get Appointment By id", a);
    assertEquals("Inapropriate MeetingMembers count", 0, a.getMeetingMembers() == null ? 0 : a.getMeetingMembers().size());
  }
View Full Code Here

Examples of org.apache.openmeetings.db.entity.calendar.Appointment

  public Appointment createAppointment(Date start, Date end) {
    assertNotNull("Can't access to appointment dao implimentation", appointmentDao);

    // add new appointment
    Appointment ap = new Appointment();

    ap.setTitle("appointmentName");
    ap.setLocation("appointmentLocation");

    ap.setStart(start);
    ap.setEnd(end);
    ap.setDescription("appointmentDescription");
    ap.setInserted(new Date());
    ap.setDeleted(false);
    ap.setIsDaily(false);
    ap.setIsWeekly(false);
    ap.setIsMonthly(false);
    ap.setIsYearly(false);
    ap.setPasswordProtected(false);

    ap.setOwner(userDao.get(1L));
    ap.setConnectedEvent(false);
    Long id = appointmentDao.addAppointmentObj(ap);
    assertNotNull("Cann't add appointment", id);
    return ap;
  }
View Full Code Here

Examples of org.apache.openmeetings.db.entity.calendar.Appointment

          "first" + i + ".last" + i + "@webbase-design.de", "Etc/GMT+1");
    }
    Long language_id = 1L;
    Long roomType = 1L;

    Appointment a = appointmentLogic.getAppointment(appointmentName,
        appointmentLocation, appointmentDescription,
        start, end, isDaily, isWeekly,
        isMonthly, isYearly, categoryId, remind, mmClient,
        roomType, language_id, false, "", -1, users_id);
    a = appointmentDao.update(a, users_id);
   
    Thread.sleep(3000);
   
    appointmentLogic.doScheduledMeetingReminder();
   
    Thread.sleep(3000);
   
    assertTrue("Saved appointment should have valid id: " + a.getId(), a.getId() != null && a.getId() > 0);
  }
View Full Code Here

Examples of org.apache.openmeetings.db.entity.calendar.Appointment

    rangeEnd.setTime(now.getTime());
   
    Calendar a1End = Calendar.getInstance();
    a1End.setTime(now.getTime());
    a1End.add(Calendar.HOUR_OF_DAY, 1);
    Appointment a1 = getAppointment(now.getTime(), a1End.getTime());
    a1.setTitle("AppointmentByRange_a1");

    Appointment a2 = getAppointment(now.getTime(), a1End.getTime());
    a2.setTitle("AppointmentByRange_a2");
    a2.setMeetingMembers(new ArrayList<MeetingMember>());
    MeetingMember mm1 = new MeetingMember();
    mm1.setUser(createUserContact(rnd.nextInt(), userId));
    mm1.setAppointment(a2);
    a2.getMeetingMembers().add(mm1);
   
    Appointment a3 = getAppointment(now.getTime(), a1End.getTime());
    a3.setTitle("AppointmentByRange_a3");
    a3.setMeetingMembers(new ArrayList<MeetingMember>());
    MeetingMember mm2 = new MeetingMember();
    mm2.setUser(createUserContact(rnd.nextInt(), userId));
    mm2.setAppointment(a3);
    a3.getMeetingMembers().add(mm2);
    MeetingMember mm3 = new MeetingMember();
    mm3.setUser(createUserContact(rnd.nextInt(), userId));
    mm3.setAppointment(a3);
    a3.getMeetingMembers().add(mm3);
   
    a1 = appointmentDao.update(a1, userId);
    a2 = appointmentDao.update(a2, userId);
    a3 = appointmentDao.update(a3, userId);
   
    int a1found = 0, a2found = 0, a3found = 0;
    for (Appointment a : appointmentDao.getAppointmentsByRange(userId, rangeStart.getTime(), rangeEnd.getTime())) {
      int mmCount = a.getMeetingMembers() == null ? 0 : a.getMeetingMembers().size();
      if (a.getId().equals(a1.getId())) {
        assertEquals("Inapropriate MeetingMembers count", 0, mmCount);
        a1found++;
      }
      if (a.getId().equals(a2.getId())) {
        assertEquals("Inapropriate MeetingMembers count", 1, mmCount);
        a2found++;
      }
      if (a.getId().equals(a3.getId())) {
        assertEquals("Inapropriate MeetingMembers count", 2, mmCount);
        a3found++;
      }
    }
    assertEquals("Inappropriate count of appointments without members found", 1, a1found);
View Full Code Here

Examples of org.apache.openmeetings.db.entity.calendar.Appointment

        if (rooms_id <= 0) {
          return rooms_id;
        }

        Appointment a = new Appointment();
        a.setTitle("appointmentName");
        a.setOwner(userDao.get(users_id));
        a.setLocation("appointmentLocation");
        a.setDescription("appointmentDescription");
        a.setStart(dFrom);
        a.setEnd(dTo);
        a.setCategory(appointmentCategoryDao.get(1L));
        a.setRemind(appointmentReminderTypDao.get(reminderTypeId));
        a.setRoom(roomDao.get(rooms_id));
        a.setPasswordProtected(isPasswordProtected);
        a.setPassword(password);
        a.setLanguageId(1L); //TODO check
        appointmentDao.update(a, users_id); //FIXME verify !!!

        return rooms_id;

      } else {
View Full Code Here

Examples of org.apache.openmeetings.db.entity.calendar.Appointment

    try {
      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);

      if (AuthLevelUtil.checkWebServiceLevel(user_level)) {
        Appointment a = appointmentLogic.getAppointmentByRoom(room_id);

        if (email == null || a == null) {
          return -1L;
        }
        for (MeetingMember mm : a.getMeetingMembers()) {
          if (email.equals(mm.getUser().getAdresses().getEmail())) {
            return mm.getId();
          }
        }
        MeetingMember mm = new MeetingMember();
        mm.setAppointment(a);
        mm.setUser(userDao.getContact(email, firstname, lastname, language_id, jNameTimeZone, users_id));
        a.getMeetingMembers().add(mm);
        appointmentDao.update(a, users_id);

        return mm.getId(); //FIXME check to return ID
      } else {
        return -2L;
View Full Code Here

Examples of org.apache.openmeetings.db.entity.calendar.Appointment

      // Defining Organizer

      HashMap<String, String> organizerAttendee = handler.getAttendeeData(email, username, isOwner);
      organizerAttendee = handler.getAttendeeData(replyToEmail, owner.getLogin(), isOwner);

      Appointment a = i.getAppointment();
      // Create ICal Message
      //FIXME should be checked to generate valid time
      String meetingId = handler.addNewMeeting(a.getStart(), a.getEnd(),
          a.getTitle(), atts, invitation_link,
          organizerAttendee, a.getIcalId(), timezoneUtil.getTimeZone(owner));

      // Writing back meetingUid
      if (a.getIcalId() == null || a.getIcalId().length() < 1) {
        a.setIcalId(meetingId);
        // TODO should it be saved ???
      }

      log.debug(handler.getICalDataAsString());
      mailHandler.send(new MailMessage(email, replyToEmail, subject, template, handler.getIcalAsByteArray()));
View Full Code Here

Examples of org.apache.openmeetings.db.entity.calendar.Appointment

      Calendar appointmentstart, Calendar appointmentend,
      Boolean isDaily, Boolean isWeekly, Boolean isMonthly,
      Boolean isYearly, Long categoryId, Long remind, String[] mmClient,
      Long roomType, Long languageId,
      Boolean isPasswordProtected, String password, long roomId, Long users_id) {
    Appointment a = new Appointment();
    a.setTitle(appointmentName);
    a.setLocation(appointmentLocation);
    a.setDescription(appointmentDescription);
    a.setStart(appointmentstart.getTime());
    a.setEnd(appointmentend.getTime());
    a.setIsDaily(isDaily);
    a.setIsWeekly(isWeekly);
    a.setIsMonthly(isMonthly);
    a.setIsYearly(isYearly);
    a.setCategory(appointmentCategoryDao.get(categoryId));
    a.setRemind(appointmentReminderTypDao.get(remind));
    if (roomId > 0) {
      a.setRoom(roomDao.get(roomId));
    } else {
      a.setRoom(new Room());
      a.getRoom().setComment(appointmentDescription);
      a.getRoom().setName(appointmentName);
      a.getRoom().setRoomtype(roomTypeDao.get(roomType));
    }
    a.setOwner(userDao.get(users_id));
    a.setPasswordProtected(isPasswordProtected);
    a.setPassword(password);
    a.setMeetingMembers(new ArrayList<MeetingMember>());
    for (String singleClient : mmClient) {
      MeetingMember mm = getMeetingMember(users_id, languageId, singleClient);
      mm.setAppointment(a);
      a.getMeetingMembers().add(mm);
    }
    return a;
  }
View Full Code Here

Examples of org.apache.openmeetings.db.entity.calendar.Appointment

    target.add(feedback);
  }

  @Override
  protected void onSubmit(AjaxRequestTarget target) {
        Appointment a = form.getModelObject();
        final List<MeetingMember> attendees = a.getMeetingMembers() == null ? new ArrayList<MeetingMember>() : a.getMeetingMembers();
        Set<Long> currentIds = new HashSet<Long>();
        for (User u : attendeesModel.getObject()) {
          if (u.getUser_id() != null) {
            currentIds.add(u.getUser_id());
          }
        }
       
        //remove users
        for (Iterator<MeetingMember> i = attendees.iterator(); i.hasNext();) {
          MeetingMember m = i.next();
          if (!currentIds.contains(m.getUser().getUser_id())) {
            i.remove();
          }
        }
        Set<Long> originalIds = new HashSet<Long>();
        for (MeetingMember m : attendees) {
          originalIds.add(m.getUser().getUser_id());
        }
        //add users
        for (User u : attendeesModel.getObject()) {
          if (u.getUser_id() == null || !originalIds.contains(u.getUser_id())) {
            MeetingMember mm = new MeetingMember();
            mm.setUser(u);
            mm.setDeleted(false);
            mm.setInserted(a.getInserted());
            mm.setUpdated(a.getUpdated());
            mm.setAppointment(a);
            attendees.add(mm);
          }
        }
        a.setMeetingMembers(attendees);
        getBean(AppointmentDao.class).update(a, getUserId());
    target.add(feedback);
    calendar.refresh(target);
  }
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.