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

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


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

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


          + "WHERE a.appointmentId = :appointmentId ";

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

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

      Long categoryId, Long remind, Room room, Long language_id,
      Boolean isPasswordProtected, String password,
      Boolean isConnectedEvent, String jNameTimeZone) {
    try {

      Appointment ap = new Appointment();

      ap.setAppointmentName(appointmentName);
      ap.setAppointmentLocation(appointmentLocation);

      log.debug("addAppointment appointmentstart :1: "
          + CalendarPatterns
              .getDateWithTimeByMiliSecondsWithZone(appointmentstart));
      log.debug("addAppointment appointmentend :1: "
          + CalendarPatterns
              .getDateWithTimeByMiliSecondsWithZone(appointmentend));

      ap.setAppointmentStarttime(appointmentstart);
      ap.setAppointmentEndtime(appointmentend);
      ap.setAppointmentDescription(appointmentDescription);
      ap.setRemind(appointmentReminderTypDaoImpl
          .getAppointmentReminderTypById(remind));
      ap.setStarttime(new Date());
      ap.setIsReminderEmailSend(false);
      ap.setDeleted(false);
      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.get(userId));
      ap.setAppointmentCategory(appointmentCategoryDaoImpl
          .getAppointmentCategoryById(categoryId));
      ap.setRoom(room);
      ap.setIsConnectedEvent(isConnectedEvent);

      ap = em.merge(ap);

      return ap.getAppointmentId();
    } catch (Exception ex2) {
      log.error("[addAppointment]: ", ex2);
    }
    return null;
  }
View Full Code Here

      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

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

      if (authLevelUtil.checkUserLevel(user_level)) {
        // check if the appointment belongs to the current user
        Appointment appointment = appointmentLogic
            .getAppointMentById(appointmentId);
        if (!appointment.getUserId().getUser_id().equals(users_id)) {
          throw new AxisFault(
              "The Appointment cannot be updated by the given user");
        }
      } else if (authLevelUtil.checkUserLevel(user_level)) {
        // fine
      } else {
        throw new AxisFault(
            "Not allowed to preform that action, Authenticate the SID first");
      }

      List<Map<String, String>> newList = new ArrayList<Map<String, String>>();

      for (String singleClient : mmClient) {
        String[] params = singleClient.split(",");
        Map<String, String> map = new HashMap<String, String>();
        map.put("meetingMemberId", params[0]);
        map.put("firstname", params[1]);
        map.put("lastname", params[2]);
        map.put("email", params[3]);
        map.put("userId", params[4]);
        map.put("jNameTimeZone", params[5]);
        newList.add(map);
      }

      log.debug("updateAppointment");

      RoomType rt = roomManager.getRoomTypesById(roomType);

      Appointment app = appointmentLogic
          .getAppointMentById(appointmentId);

      Room room = app.getRoom();
      if (room != null) {

        room.setComment(appointmentDescription);
        room.setName(appointmentName);
        room.setRoomtype(rt);
View Full Code Here

        return appointmentLogic.deleteAppointment(appointmentId,
            users_id, language_id);

      } else if (authLevelUtil.checkUserLevel(user_level)) {

        Appointment appointment = appointmentLogic
            .getAppointMentById(appointmentId);

        if (!appointment.getUserId().getUser_id().equals(users_id)) {
          throw new AxisFault(
              "The Appointment cannot be deleted by the given user");
        }

        return appointmentLogic.deleteAppointment(appointmentId,
View Full Code Here

      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);
      if (authLevelUtil.checkUserLevel(user_level)) {

        Appointment appointment = new Appointment();

        Appointment appStored = appointmentDao.getAppointmentByRoomId(
            users_id, room_id);

        appointment.setAppointmentStarttime(appStored
            .getAppointmentStarttime());
        appointment.setAppointmentEndtime(appStored
            .getAppointmentEndtime());

        return appointment;
      }
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.