Package org.openmeetings.app.persistence.beans.calendar

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


      } else {

        // If this is an Appointment then the Moderator will be set to
        // the Invitor

        Appointment ment = appointmentLogic
            .getAppointmentByRoom(room_id);

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

        Long userIdInRoomClient = currentClient.getUser_id();

        boolean found = false;
View Full Code Here


            Long users_id = getNewId(
                importLongType(unformatString(appointmentsObject
                    .element("users_id").getText())),
                Maps.USERS);

            Appointment app = new Appointment();
            app.setAppointmentId(appointmentId);
            app.setAppointmentLocation(appointmentLocation);
            app.setAppointmentName(appointmentName);
            app.setAppointmentDescription(appointmentDescription);
            app.setAppointmentCategory(appointmentCategoryDaoImpl
                .getAppointmentCategoryById(categoryId));
            app.setAppointmentStarttime(appointmentStarttime);
            app.setAppointmentEndtime(appointmentEndtime);
            app.setDeleted(deleted);
            app.setRemind(appointmentReminderTypDaoImpl
                .getAppointmentReminderTypById(typId));
            app.setIsDaily(isDaily);
            app.setIsWeekly(isWeekly);
            app.setIsMonthly(isMonthly);
            app.setIsYearly(isYearly);
            app.setRoom(roommanagement.getRoomById(room_id));
            app.setIcalId(icalId);
            app.setLanguage_id(language_id);
            app.setIsPasswordProtected(isPasswordProtected);
            app.setPassword(password);
            app.setUserId(userManagement.getUserById(users_id));

            appointmentList.add(app);

          }
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());

          }

        }

      }

      Rooms 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(new Long(1153), language_id);
    Fieldlanguagesvalues labelid1154 = fieldmanagment
        .getFieldByIdAndLanguage(new Long(1154), 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

      Long memberId = meetingMemberDao.addMeetingMember(firstname,
          lastname, memberStatus, appointmentStatus, appointmentId,
          userid, email, invitor, omTimeZone, false);

      // DefaultInvitation
      Appointment point = appointmentLogic
          .getAppointMentById(appointmentId);

      MeetingMember member = getMemberById(memberId);
      Boolean isInvitor = member.getInvitor();

      Long invitationId = null;

      if (point.getRemind() == null) {
        log.error("Appointment has no assigned ReminderType!");
        return null;
      }

      log.debug(":::: addMeetingMember ..... "
          + point.getRemind().getTypId());

      String subject = formatSubject(language_id, point, timezone);

      String message = formatMessage(language_id, point, timezone,
          invitorName);

      // point.getRemind().getTypId() == 1 will not receive emails

      if (point.getRemind().getTypId() == 2) {
        log.debug("Invitation for Appointment : simple email");

        Invitations invitation = invitationManagement
            .addInvitationLink(
                new Long(2), // userlevel
                firstname + " " + lastname, // username
                message,
                baseUrl, // baseURl
                email, // email
                subject, // subject
                point.getRoom().getRooms_id(), // room_id
                "public",
                isPasswordProtected, // passwordprotected
                password, // invitationpass
                2, // valid type
                point.getAppointmentStarttime(), // valid from
                point.getAppointmentEndtime(), // valid to
                meeting_organizer, // created by
                baseUrl,
                language_id,
                true, // really send mail sendMail
                point.getAppointmentStarttime(),
                point.getAppointmentEndtime(),
                point.getAppointmentId(),
                invitorName);

        invitationId = invitation.getInvitations_id();

      } else if (point.getRemind().getTypId() == 3) {
        log.debug("Reminder for Appointment : iCal mail");

        System.out.println("### SENDING iCAL EMAIL");

        invitationId = invitationManagement
            .addInvitationIcalLink(
                new Long(2), // userlevel
                firstname + " " + lastname, // username
                message,
                baseUrl, // baseURl
                email, // email
                subject, // subject
                point.getRoom().getRooms_id(), // room_id
                "public",
                isPasswordProtected, // passwordprotected
                password, // invitationpass
                2, // valid
                point.getAppointmentStarttime(), // valid from
                point.getAppointmentEndtime(), // valid to
                meeting_organizer, // created by
                point.getAppointmentId(), isInvitor,
                language_id, timezone,
                point.getAppointmentId(),
                invitorName);

      }

      // Setting InvitationId within MeetingMember
View Full Code Here

      if (member == null) {
        log.error("could not find meeting member!");
        return null;
      }

      Appointment point = member.getAppointment();
      point = appointmentLogic.getAppointMentById(point
          .getAppointmentId());

      if (point == null) {
        log.error("could not retrieve appointment!");
        return null;
View Full Code Here

      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, Rooms 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.getUser(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);

      // 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
      invitationManagement.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
      Users user = userManagement.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

TOP

Related Classes of org.openmeetings.app.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.