Package org.apache.openmeetings.db.entity.calendar

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


  public Appointment get(Long id) {
    TypedQuery<Appointment> query = em.createNamedQuery("getAppointmentById", Appointment.class);
    query.setParameter("id", id);

    Appointment appoint = null;
    try {
      appoint = query.getSingleResult();
    } catch (NoResultException ex) {
    }
    return appoint;
View Full Code Here


    String hql = "select a from Appointment a WHERE a.id = :id ";

    TypedQuery<Appointment> query = em.createQuery(hql, Appointment.class);
    query.setParameter("id", appointmentId);

    Appointment appoint = null;
    try {
      appoint = query.getSingleResult();
    } catch (NoResultException ex) {
    }
View Full Code Here

    roomDao.update(r, userId);
    Set<Long> mmIds = a.getId() == null ? new HashSet<Long>()
        : meetingMemberDao.getMeetingMemberIdsByAppointment(a.getId());
    // update meeting members
    //TODO update email need to be sent on meeting members list update
    Appointment a0 = a.getId() == null ? null : get(a.getId());
    boolean sendMail = a0 == null || !a0.getTitle().equals(a.getTitle()) ||
        !(a0.getDescription() != null ? a0.getDescription().equals(a.getDescription()) : true) ||
        !(a0.getLocation() != null ? a0.getLocation().equals(a.getLocation()) : true) ||
        !a0.getStart().equals(a.getStart()) ||
        !a0.getEnd().equals(a.getEnd());
    List<MeetingMember> mmList = a.getMeetingMembers();
    if (mmList != null){
      for (MeetingMember mm : mmList) {
        if (mm.getId() == null || !mmIds.contains(mm.getId())) {
          invitationManager.processInvitation(a, mm, MessageType.Create);
View Full Code Here

          + "AND a.start > :appointmentStarttime ";

      TypedQuery<Appointment> query = em.createQuery(hql, Appointment.class);
      query.setParameter("appointmentStarttime", appointmentStarttime);

      Appointment appoint = null;
      try {
        appoint = query.getSingleResult();
      } catch (NoResultException ex) {
      }
View Full Code Here

 
  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

  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

    }
    Long language_id = 1L;
    String baseUrl = "http://localhost:5080/openmeetings/";
    Long roomType = 1L;

    Appointment a = appointmentLogic.getAppointment(appointmentName,
        appointmentLocation, appointmentDescription,
        start, end, isDaily, isWeekly,
        isMonthly, isYearly, categoryId, remind, mmClient,
        roomType, baseUrl, language_id, false, "", -1, users_id);
    a = appointmentDao.update(a, baseUrl, 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

    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, OM_URL, userId);
    a2 = appointmentDao.update(a2, OM_URL, userId);
    a3 = appointmentDao.update(a3, OM_URL, 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

 
  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

  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

TOP

Related Classes of org.apache.openmeetings.db.entity.calendar.Appointment

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.