Examples of Appointment


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

      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);
     
      OmTimeZone omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNameTimeZone);
     
      String timeZoneName = omTimeZone.getIcal();
     
      Calendar cal = Calendar.getInstance();
      cal.setTimeZone(TimeZone.getTimeZone(timeZoneName));
      int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
     
      log.debug("addAppointment appointmentstart :1: "+appointmentstart);
      log.debug("addAppointment appointmentend :1: "+appointmentend);
      log.debug("addAppointment jNameTimeZone :: "+jNameTimeZone);
      log.debug("addAppointment offset :: "+offset);
     
      appointmentstart = new Date(appointmentstart.getTime() - offset);
      appointmentend = new Date(appointmentend.getTime() - offset);
     
      log.debug("addAppointment appointmentstart :2: "+appointmentstart);
      log.debug("addAppointment appointmentend :2: "+appointmentend);
     
      ap.setAppointmentStarttime(appointmentstart);
       ap.setAppointmentEndtime(appointmentend);
      ap.setAppointmentDescription(appointmentDescription);
      ap.setRemind(AppointmentReminderTypDaoImpl.getInstance().getAppointmentReminderTypById(remind));
      ap.setStarttime(new Date());
      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(UsersDaoImpl.getInstance().getUser(userId));
      ap.setAppointmentCategory(AppointmentCategoryDaoImpl.getInstance().getAppointmentCategoryById(categoryId));
      ap.setRoom(room);
      ap.setIsConnectedEvent(isConnectedEvent);
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      ap = session.merge(ap);
      session.flush();
      Long appointment_id = ap.getAppointmentId();

      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return appointment_id;
View Full Code Here

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

   
      log.debug("AppointmentDAOImpl.updateAppointment");
    try {
     
     
      Appointment ap = this.getAppointmentById(appointmentId);
     
      AppointmentReminderTyps appointmentReminderTyps = AppointmentReminderTypDaoImpl.getInstance().getAppointmentReminderTypById(remind);
      AppointmentCategory appointmentCategory = AppointmentCategoryDaoImpl.getInstance().getAppointmentCategoryById(categoryId);
     
      Calendar cal = Calendar.getInstance();
      cal.setTimeZone(TimeZone.getTimeZone(iCalTimeZone));
      int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
     
      log.debug("addAppointment offset :: "+offset);
     
      appointmentstart = new Date(appointmentstart.getTime() - offset);
      appointmentend = new Date(appointmentend.getTime() - offset);
     
      //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.getInstance().updateInvitationByAppointment(appointmentId,appointmentstart,appointmentend);
                 
      ap.setAppointmentName(appointmentName);
      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(UsersDaoImpl.getInstance().getUser(userId));
      ap.setAppointmentCategory(appointmentCategory);
           
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      if (ap.getAppointmentId() == null) {
        session.persist(ap);
          } else {
            if (!session.contains(ap)) {
              session.merge(ap);
          }
      }

      tx.commit();
        PersistenceSessionUtil.closeSession(idf);
       
        // Adding Invitor as Meetingmember
      Users user = Usermanagement.getInstance().getUserById(users_id);
     
      String invitorName = user.getFirstname() + " " + user.getLastname() + " [" + user.getAdresses().getEmail() + "]";
     
        List<MeetingMember> meetingsRemoteMembers = MeetingMemberDaoImpl.getInstance().getMeetingMemberByAppointmentId(ap.getAppointmentId());
       
        //to remove
        for (MeetingMember memberRemote : meetingsRemoteMembers) {
         
          boolean found = false;
View Full Code Here

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

   
      log.debug("AppointmentDAOImpl.updateAppointment");
    try {
     
     
      Appointment ap = this.getAppointmentById(appointmentId);
     
      Calendar cal = Calendar.getInstance();
      cal.setTimeZone(TimeZone.getTimeZone(iCalTimeZone));
      int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
     
      log.debug("addAppointment offset :: "+offset);
     
      appointmentstart = new Date(appointmentstart.getTime() - offset);
      appointmentend = new Date(appointmentend.getTime() - offset);
     
      //change connected events of other participants
      if (ap.getIsConnectedEvent() != null && ap.getIsConnectedEvent()) {
        this.updateConnectedEventsTimeOnly(ap, appointmentstart, appointmentend);
      }
     
      //Update Invitation hash to new time
      Invitationmanagement.getInstance().updateInvitationByAppointment(appointmentId,appointmentstart,appointmentend);
                 
      ap.setAppointmentStarttime(appointmentstart);
       ap.setAppointmentEndtime(appointmentend);
      ap.setUpdatetime(new Date());
           
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      if (ap.getAppointmentId() == null) {
        session.persist(ap);
          } else {
            if (!session.contains(ap)) {
              session.merge(ap);
          }
      }

      tx.commit();
        PersistenceSessionUtil.closeSession(idf);
       
       
        List<MeetingMember> meetingsRemoteMembers = MeetingMemberDaoImpl.getInstance().getMeetingMemberByAppointmentId(ap.getAppointmentId());
       
        // Adding Invitor Name
      Users user = Usermanagement.getInstance().getUserById(users_id);
        String invitorName = user.getFirstname() + " " + user.getLastname() + " [" + user.getAdresses().getEmail() + "]";
       
View Full Code Here

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

 
  public Long deleteAppointement(Long appointmentId) {
    log.debug("deleteAppointMent");
    try {
     
      Appointment app = this.getAppointmentById(appointmentId);
      app.setUpdatetime(new Date());
      app.setDeleted("true");
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (app.getAppointmentId() == null) {
        session.persist(app);
          } else {
            if (!session.contains(app)) {
              session.merge(app);
          }
View Full Code Here

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

      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("deleted", "true");     
      query.setParameter("appointmentStarttime", appointmentStarttime);
     
      Appointment appoint = null;
      try{
        appoint = (Appointment) query.getSingleResult();
        } catch (NoResultException ex) {
        }
      tx.commit();
View Full Code Here

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

  public Long deleteAppointment(Long appointmentId, Long users_id, 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 = AppointmentDaoImpl.getInstance().getAppointmentsByRoomId(point.getRoom().getRooms_id());
       
        for (Appointment appointment : appointments) {
         
          if (!appointment.getAppointmentId().equals(appointmentId)) {
           
            AppointmentDaoImpl.getInstance().deleteAppointement(appointment.getAppointmentId());
           
          }
         
        }
       
      }
     
      Rooms room = point.getRoom();
     
     
      // Deleting/Notifing Meetingmembers
      List<MeetingMember> members = MeetingMemberDaoImpl.getInstance().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());
          MeetingMemberLogic.getInstance().deleteMeetingMember(members.get(i).getMeetingMemberId(), users_id, language_id);
View Full Code Here

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

    Fieldlanguagesvalues labelid1153 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1153), language_id);
    Fieldlanguagesvalues labelid1154 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1154), language_id);
   
   
    for(int i = 0; i < points.size(); i++){
      Appointment ment = points.get(i);
     
     
      // Checking ReminderType - only ReminderType simple mail is concerned!
      if(ment.getRemind().getTypId() == 2 || ment.getRemind().getTypId() == 3){
       
        log.debug("doScheduledMeetingReminder : Found appointment " +  ment.getAppointmentName());
       
        Date appStart = ment.getAppointmentStarttime();
        Date oneHourBeforeAppStart = new Date(System.currentTimeMillis());
        oneHourBeforeAppStart.setTime(appStart.getTime());
        //oneHourBeforeAppStart.setHours(appStart.getHours() -1);
       
        oneHourBeforeAppStart.setMinutes(appStart.getMinutes() - 5);
       
//        System.out.println("doScheduledMeetingReminder : Found appointment 1 " +now);
//        System.out.println("doScheduledMeetingReminder : Found appointment 2 " +appStart);
//        System.out.println("doScheduledMeetingReminder : Found appointment 3 " +oneHourBeforeAppStart);
//        System.out.println("doScheduledMeetingReminder : Found appointment 4 " +now.before(appStart));
//        System.out.println("doScheduledMeetingReminder : Found appointment 5 " +now.after(oneHourBeforeAppStart));
//       
        if(now.before(appStart) && now.after(oneHourBeforeAppStart)){
          log.debug("Meeting " +  ment.getAppointmentName() + " is in reminder range...");
         
          List<MeetingMember> members = MeetingMemberDaoImpl.getInstance().getMeetingMemberByAppointmentId(ment.getAppointmentId());
         
         
          if(members == null || members.size() < 1){
            log.debug("doScheduledMeetingReminder : no members in meeting!");
            continue;
          }
         
          for(int y =0; y < members.size(); y++){
            MeetingMember mm = members.get(y);
           
            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());
            } else {
              // Check if Invitation was updated last time
              Date updateTime = inv.getUpdatetime();
             
              if(updateTime !=null && updateTime.after(oneHourBeforeAppStart)){
                log.debug("Member has been informed within one hour before Meeting start");
                continue;
              }
             
             
              if(inv.getBaseUrl() == null  || inv.getBaseUrl().length() < 1){
                log.error("Error retrieving baseUrl from Invitation ID : " + inv.getInvitations_id());
                continue;
              }
             
              //ment.getAppointmentStarttime().toLocaleString()
             
              Users us = ment.getUserId();
             
              String jNameTimeZone = null;
              if (us != null && us.getOmTimeZone() != null) {
                jNameTimeZone = us.getOmTimeZone().getJname();
              } else {
                Configuration conf = Configurationmanagement.getInstance().getConfKey(3L, "default.timezone");
                if (conf != null) {
                  jNameTimeZone = conf.getConf_value();
                }
              }
             
              OmTimeZone omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNameTimeZone);
             
              String timeZoneName = omTimeZone.getIcal();
             
              Calendar cal = Calendar.getInstance();
              cal.setTimeZone(TimeZone.getTimeZone(timeZoneName));
              int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
             
              Date starttime = new Date(ment.getAppointmentStarttime().getTime() + offset);
              Date endtime = new Date(ment.getAppointmentEndtime().getTime() + offset);
             
//              String message = "Meeting : " + ment.getAppointmentName() + "<br>";
//              if(ment.getAppointmentDescription() != null && ment.getAppointmentDescription().length() > 0)
//                message += "(" + ment.getAppointmentDescription() + ")<br>";
//              message += "Start : " + starttime + "<br>";
//              message += "End : " + endtime + "<br>";
//              message += "Timezone : " + omTimeZone.getIcal() + "<br>";
             
             
              String message = labelid1158.getValue() + " "+ ment.getAppointmentName();
             
              if (ment.getAppointmentDescription().length() != 0) {
               
                Fieldlanguagesvalues labelid1152 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1152), language_id);
                message += labelid1152.getValue() + ment.getAppointmentDescription();
               
              }
             
              message += "<br/>" + labelid1153.getValue() + ' '
                      + CalendarPatterns.getDateWithTimeByMiliSeconds(starttime)
                      + " (" + timeZoneName + ")"
                      + "<br/>";
             
              message += labelid1154.getValue() + ' '
                      + CalendarPatterns.getDateWithTimeByMiliSeconds(endtime)
                      + " (" + timeZoneName + ")"
                      + "<br/>";
             
              //Fieldlanguagesvalues labelid1156 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1156), language_id);
              //message = labelid1156.getValue() + invitorName + "<br/>";
             
              Invitationmanagement.getInstance().sendInvitationReminderLink(message, inv.getBaseUrl(), mm.getEmail(),
                  labelid1158.getValue() + " "+ ment.getAppointmentName(), inv.getHash());
             
              inv.setUpdatetime(now);
              Invitationmanagement.getInstance().updateInvitation(inv);
            }
           
View Full Code Here

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

//              getConfKey(3,"default_lang_id").getConf_value()).longValue();
      String template = InvitationTemplate.getInstance().getRegisterInvitationTemplate(username, message, invitation_link, language_id, starttime, endtime);
   
      IcalHandler handler = new IcalHandler(IcalHandler.ICAL_METHOD_REQUEST);
     
      Appointment point = AppointmentLogic.getInstance().getAppointMentById(appointMentId);
     
      // Transforming Meeting Members
     
      HashMap<String, String> attendeeList = handler.getAttendeeData(email, username, invitor);
     
      Vector<HashMap<String, String>> atts = new Vector<HashMap<String,String>>();
      atts.add(attendeeList);
     
      // Defining Organizer
      Users user = Usermanagement.getInstance().getUserById(organizer_userId);
     
      HashMap<String, String> organizerAttendee = handler.getAttendeeData(email, username, invitor);
      if (user != null) {
        organizerAttendee = handler.getAttendeeData(user.getAdresses().getEmail(), user.getLogin(), invitor);
      }     
     
      GregorianCalendar start = new GregorianCalendar();
      start.setTime(starttime); //Must be the calculated date base on the time zone
     
      GregorianCalendar end = new GregorianCalendar();
      end.setTime(endtime); //Must be the calculated date base on the time zone
     
      //Create ICal Message
      String meetingId = handler.addNewMeeting(start, end, point.getAppointmentName(),
          atts, invitation_link, organizerAttendee,
          point.getIcalId(), jNametimeZone);
     
      // Writing back meetingUid
      if(point.getIcalId() == null || point.getIcalId().length() < 1){
        point.setIcalId(meetingId);
       
        AppointmentLogic.getInstance().updateAppointMent(point);
      }
     
      log.debug(handler.getICalDataAsString());
View Full Code Here

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

         appointmentStatus,  appointmentId,  userid,  email, invitor,
         jNameMemberTimeZone, false);
   
     
      // DefaultInvitation
      Appointment point = AppointmentLogic.getInstance().getAppointMentById(appointmentId);
     
      MeetingMember member = getMemberById(memberId);
     
      Long invitationId = null;
     
      if(point.getRemind() == null){
        log.error("Appointment has no assigned ReminderType!");
        return null;
      }
     
      log.debug(":::: addMeetingMember ..... "+point.getRemind().getTypId());
     
      Users us = Usermanagement.getInstance().getUserById(userid);
      OmTimeZone omTimeZone = null;
     
      String jNameTimeZone = null;
      if (us != null && us.getOmTimeZone() != null) {
        System.out.println("Internal User ");
        //Internal User
        jNameTimeZone = us.getOmTimeZone().getJname();
        omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNameTimeZone);
      } else {
       
        System.out.println("External User ");
        //External User
        jNameTimeZone = jNameMemberTimeZone;
        omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNameTimeZone);
       
      }
     
      //If everything fails
      if (omTimeZone == null) {
        Configuration conf = Configurationmanagement.getInstance().getConfKey(3L, "default.timezone");
        if (conf != null) {
          jNameTimeZone = conf.getConf_value();
        }
        omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNameTimeZone);
      }
     
      String timeZoneName = omTimeZone.getIcal();
     
      Calendar cal = Calendar.getInstance();
      cal.setTimeZone(TimeZone.getTimeZone(omTimeZone.getIcal()));
      int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
     
//      System.out.println("1"+point.getAppointmentStarttime().getTime());
//      System.out.println("2"+point.getAppointmentEndtime().getTime());
     
      Date starttime = new Date(point.getAppointmentStarttime().getTime() + offset);
      Date endtime = new Date(point.getAppointmentEndtime().getTime() + offset);
     
//      System.out.println("jNameTimeZone "+jNameTimeZone);
//      System.out.println("Ical "+omTimeZone.getIcal());
//      System.out.println(offset);
//      System.out.println("3"+starttime);
//      System.out.println("4"+endtime);
     
      Fieldlanguagesvalues labelid1151 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1151), language_id);
     
      String message = labelid1151.getValue() + " " + point.getAppointmentName();
     
      if (point.getAppointmentDescription().length() != 0) {
       
        Fieldlanguagesvalues labelid1152 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1152), language_id);
        message += labelid1152.getValue() + point.getAppointmentDescription();
       
      }
     
      Fieldlanguagesvalues labelid1153 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1153), language_id);
      Fieldlanguagesvalues labelid1154 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1154), language_id);
     
      message += "<br/>" + labelid1153.getValue() + ' '
              + CalendarPatterns.getDateWithTimeByMiliSeconds(starttime)
              + " (" + timeZoneName + ")"
              + "<br/>";
     
      message += labelid1154.getValue() + ' '
              + CalendarPatterns.getDateWithTimeByMiliSeconds(endtime)
              + " (" + timeZoneName + ")"
              + "<br/>";
     
      Fieldlanguagesvalues labelid1156 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1156), language_id);
     
      message += labelid1156.getValue() + invitorName + "<br/>";
     
      if(point.getRemind().getTypId() == 1){
        log.debug("no reminder required");
      } else if(point.getRemind().getTypId() == 2){
        log.debug("Reminder for Appointment : simple email");
       
        Invitations invitation = Invitationmanagement.getInstance().addInvitationLink(
              new Long(2), //userlevel
              firstname + " " + lastname, //username
              message,
              baseUrl, // baseURl
              email, //email
              labelid1151.getValue() + " " + point.getAppointmentName(), //subject
              point.getRoom().getRooms_id(), // room_id
              "public",
              isPasswordProtected, // passwordprotected
              password, // invitationpass
              2, // valid type
              starttime, // valid from
              endtime, // valid to
              meeting_organizer, // created by
              baseUrl, language_id,
              true, //really send mail sendMail
              point.getAppointmentStarttime(),
              point.getAppointmentEndtime(),
              point.getAppointmentId()
            );
       
        invitationId = invitation.getInvitations_id();
       
      } else if(point.getRemind().getTypId() == 3){
        log.debug("Reminder for Appointment : iCal mail");
       
        System.out.println("5"+starttime);
        System.out.println("6"+endtime);
       
        invitationId = Invitationmanagement.getInstance().addInvitationIcalLink(new Long(2), //userlevel
              firstname + " " + lastname, //username
              message,
              baseUrl, // baseURl
              email, //email
              labelid1151.getValue() + " " + point.getAppointmentName(), //subject
              point.getRoom().getRooms_id(), // room_id
              "public",
              isPasswordProtected, // passwordprotected
              password, // invitationpass
              2, // valid
              starttime, // valid from
              endtime, // valid to
              meeting_organizer, // created by
              point.getAppointmentId(),
              member.getInvitor(), language_id,
              jNameTimeZone,
              point.getAppointmentStarttime(),
              point.getAppointmentEndtime(),
              point.getAppointmentId()
            );
       
      }
     
      // Setting InvitationId within MeetingMember
View Full Code Here

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

      if(member == null){
        log.error("could not find meeting member!");
        return null;
      }
     
      Appointment point = member.getAppointment();
      point = AppointmentLogic.getInstance().getAppointMentById(point.getAppointmentId());
     
      if(point == null){
        log.error("could not retrieve appointment!");
        return null;
      }
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.