Package org.apache.openmeetings.persistence.beans.calendar

Examples of org.apache.openmeetings.persistence.beans.calendar.Appointment


      Boolean isPasswordProtected, String password, String iCalTimeZone, String appointmentLocation) {

    log.debug("AppointmentDAOImpl.updateAppointment");
    try {

      Appointment ap = this.getAppointmentById(appointmentId);

      AppointmentReminderTyps appointmentReminderTyps = appointmentReminderTypDaoImpl
          .getAppointmentReminderTypById(remind);
      AppointmentCategory appointmentCategory = appointmentCategoryDaoImpl
          .getAppointmentCategoryById(categoryId);

      boolean sendMail = !ap.getAppointmentName().equals(appointmentName) ||
          !ap.getAppointmentDescription().equals(appointmentDescription) ||
          !ap.getAppointmentLocation().equals(appointmentLocation) ||
          !ap.getAppointmentStarttime().equals(appointmentstart) ||
          !ap.getAppointmentEndtime().equals(appointmentend);
     
      // change connected events of other participants
      if (ap.getIsConnectedEvent() != null && ap.getIsConnectedEvent()) {
        this.updateConnectedEvents(ap, appointmentName,
            appointmentDescription, appointmentstart,
            appointmentend, isDaily, isWeekly, isMonthly, isYearly,
            appointmentCategory, appointmentReminderTyps, mmClient,
            users_id, baseUrl, language_id, isPasswordProtected,
            password);
      }

      // Update Invitation hash to new time
      invitationManager.updateInvitationByAppointment(appointmentId,
          appointmentstart, appointmentend);

      ap.setAppointmentName(appointmentName);
      ap.setAppointmentLocation(appointmentLocation);
      ap.setAppointmentStarttime(appointmentstart);
      ap.setAppointmentEndtime(appointmentend);
      ap.setAppointmentDescription(appointmentDescription);
      ap.setUpdatetime(new Date());
      ap.setRemind(appointmentReminderTyps);
      ap.setIsDaily(isDaily);
      ap.setIsWeekly(isWeekly);
      ap.setIsMonthly(isMonthly);
      ap.setIsYearly(isYearly);
      ap.setLanguage_id(language_id);
      ap.setIsPasswordProtected(isPasswordProtected);
      ap.setPassword(password);
      // ap.setUserId(usersDao.getUser(userId));
      ap.setAppointmentCategory(appointmentCategory);

      if (ap.getAppointmentId() == null) {
        em.persist(ap);
      } else {
        if (!em.contains(ap)) {
          em.merge(ap);
        }
      }

      // Adding Invitor as Meetingmember
      User user = userManager.getUserById(users_id);

      String invitorName = user.getFirstname() + " " + user.getLastname()
          + " [" + user.getAdresses().getEmail() + "]";

      List<MeetingMember> meetingsRemoteMembers = meetingMemberDao
          .getMeetingMemberByAppointmentId(ap.getAppointmentId());

      // to remove
      for (MeetingMember memberRemote : meetingsRemoteMembers) {

        boolean found = false;
View Full Code Here


      String baseUrl, Long language_id, String iCalTimeZone) {

    log.debug("AppointmentDAOImpl.updateAppointment");
    try {

      Appointment ap = this.getAppointmentById(appointmentId);

      if (!ap.getStarttime().equals(appointmentstart) ||
          !ap.getAppointmentEndtime().equals(appointmentend)) {

      // change connected events of other participants
      if (ap.getIsConnectedEvent() != null && ap.getIsConnectedEvent()) {
        this.updateConnectedEventsTimeOnly(ap, appointmentstart,
            appointmentend);
      }

      // Update Invitation hash to new time
      invitationManager.updateInvitationByAppointment(appointmentId,
          appointmentstart, appointmentend);

      ap.setAppointmentStarttime(appointmentstart);
      ap.setAppointmentEndtime(appointmentend);
      ap.setUpdatetime(new Date());

      if (ap.getAppointmentId() == null) {
        em.persist(ap);
        } else if (!em.contains(ap)) {
          em.merge(ap);
        }

      List<MeetingMember> meetingsRemoteMembers = meetingMemberDao
          .getMeetingMemberByAppointmentId(ap.getAppointmentId());

      // Adding Invitor Name
      User user = userManager.getUserById(users_id);
      String invitorName = user.getFirstname() + " " + user.getLastname()
          + " [" + user.getAdresses().getEmail() + "]";
View Full Code Here

  public Long deleteAppointement(Long appointmentId) {
    log.debug("deleteAppointMent");
    try {

      Appointment app = this.getAppointmentById(appointmentId);
      app.setUpdatetime(new Date());
      app.setDeleted(true);

      if (app.getAppointmentId() == null) {
        em.persist(app);
      } else {
        if (!em.contains(app)) {
          em.merge(app);
        }
View Full Code Here

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

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

    if (room.getAppointment() == false)
      return null;

    try {
      Appointment ment = appointmentLogic.getAppointmentByRoom(room_id);

      return ment;
    } catch (Exception e) {
      log.error("getAppointMentDataForRoom " + e.getMessage());
      return null;
View Full Code Here

 
      if (room.getAppointment() == false) {
        throw new IllegalStateException("Room has no appointment");
      }
   
      Appointment appointment = appointmentLogic
          .getAppointmentByRoom(room_id);

      Map<String, Object> returnMap = new HashMap<String, Object>();

      returnMap.put("appointment", appointment);

      User us = userManager.getUserById(currentClient.getUser_id());
      TimeZone timezone = timezoneUtil.getTimezoneByUser(us);

      returnMap.put("appointment", appointment);

      returnMap.put(
          "start",
          CalendarPatterns.getDateWithTimeByMiliSeconds(
              appointment.getAppointmentStarttime(), timezone));
      returnMap.put(
          "end",
          CalendarPatterns.getDateWithTimeByMiliSeconds(
              appointment.getAppointmentEndtime(), timezone));
      returnMap.put("timeZone", timezone.getDisplayName());

      return returnMap;
    } catch (Exception e) {
      log.error("getAppointMentAndTimeZones " , e );
View Full Code Here

          .getTodaysAppointmentsForUser(users_id);
      List<Room> result = new ArrayList<Room>();

      if (points != null) {
        for (int i = 0; i < points.size(); i++) {
          Appointment ment = points.get(i);

          Long rooms_id = ment.getRoom().getRooms_id();
          Room rooom = roomDao.get(rooms_id);

          if (!rooom.getRoomtype().getRoomtypes_id()
              .equals(room_types_id))
            continue;
View Full Code Here

            .getTodaysAppointmentsForUser(users_id);
        List<Room> result = new ArrayList<Room>();

        if (appointments != null) {
          for (int i = 0; i < appointments.size(); i++) {
            Appointment ment = appointments.get(i);

            Long rooms_id = ment.getRoom().getRooms_id();
            Room rooom = roomDao.get(rooms_id);

            rooom.setCurrentusers(this
                .getRoomClientsListByRoomId(rooom.getRooms_id()));
            result.add(rooom);
View Full Code Here

      Long language_id) {
    log.debug("deleteAppointment : " + appointmentId);

    try {

      Appointment point = getAppointMentById(appointmentId);
     
      if (point == null) {
        log.error("No appointment found for ID " + appointmentId);
        return null;
      }

      if (point.getIsConnectedEvent() != null
          && point.getIsConnectedEvent()) {
        List<Appointment> appointments = appointmentDao
            .getAppointmentsByRoomId(point.getRoom().getRooms_id());

        for (Appointment appointment : appointments) {

          if (!appointment.getAppointmentId().equals(appointmentId)) {

            appointmentDao.deleteAppointement(appointment
                .getAppointmentId());

          }

        }

      }

      Room room = point.getRoom();

      // Deleting/Notifing Meetingmembers
      List<MeetingMember> members = meetingMemberDao
          .getMeetingMemberByAppointmentId(appointmentId);

      if (members == null)
        log.debug("Appointment " + point.getAppointmentName()
            + " has no meeting members");

      if (members != null) {
        for (int i = 0; i < members.size(); i++) {
          log.debug("deleting member " + members.get(i).getEmail());
View Full Code Here

        .getFieldByIdAndLanguage(1153L, language_id);
    Fieldlanguagesvalues labelid1154 = fieldManager
        .getFieldByIdAndLanguage(1154L, language_id);

    for (int i = 0; i < points.size(); i++) {
      Appointment ment = points.get(i);

      // Prevent email from being send twice, even if the cycle takes
      // very long to send each
      if (ment.getIsReminderEmailSend() != null
          && ment.getIsReminderEmailSend()) {
        continue;
      }

      // Checking ReminderType - only ReminderType simple mail is
      // concerned!
      if (ment.getRemind().getTypId() == 2
          || ment.getRemind().getTypId() == 3) {

        // Update Appointment to not send invitation twice
        ment.setIsReminderEmailSend(true);
        appointmentDao.updateAppointment(ment);

        List<MeetingMember> members = meetingMemberDao
            .getMeetingMemberByAppointmentId(ment
                .getAppointmentId());

        if (members == null) {
          log.debug("doScheduledMeetingReminder : no members in meeting!");
          continue;
        }

        // Iterate through all MeetingMembers
        for (MeetingMember mm : members) {

          log.debug("doScheduledMeetingReminder : Member "
              + mm.getEmail());

          Invitations inv = mm.getInvitation();

          if (inv == null) {
            log.error("Error retrieving Invitation for member "
                + mm.getEmail() + " in Appointment "
                + ment.getAppointmentName());
            continue;
          }

          if (inv.getBaseUrl() == null
              || inv.getBaseUrl().length() < 1) {
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.persistence.beans.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.