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

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


  {
    AppointmentDaoImpl appDaoImpl = AppointmentDaoImpl.getInstance();
    assertNotNull("Cann't access to appointment dao implimentation", appDaoImpl);
   
    // add new appointment
    Appointment ap = new Appointment();
   
    ap.setAppointmentName("appointmentName");
    ap.setAppointmentLocation("appointmentLocation");
   
    Date appointmentstart = new Date();
    Date appointmentend = new Date();
    appointmentend.setTime(appointmentstart.getTime() + 3600);
   
    ap.setAppointmentStarttime(appointmentstart);
     ap.setAppointmentEndtime(appointmentend);
    ap.setAppointmentDescription("appointmentDescription");
    ap.setStarttime(new Date());
    ap.setDeleted("false");
    ap.setIsDaily(false);
    ap.setIsWeekly(false);
    ap.setIsMonthly(false);
    ap.setIsYearly(false);
    ap.setIsPasswordProtected(false);

    ap.setUserId(UsersDaoImpl.getInstance().getUser(1L));
    ap.setIsConnectedEvent(false);
    Long id = appDaoImpl.addAppointmentObj(ap);
    assertNotNull("Cann't add appointment", id);
   
    // get appointment
    ap = appDaoImpl.getAppointmentById(id);
View Full Code Here


      Long user_level = Usermanagement.getInstance().getUserLevelByID(
          users_id);
     
      if (AuthLevelmanagement.getInstance().checkWebServiceLevel(user_level)){
       
        Appointment appointment = AppointmentDaoImpl.getInstance().getAppointmentByRoom(room_id);
       
        if (appointment == null) {
          return -1L;
        }
        //Not In Remote List available - extern user
        Long memberId = MeetingMemberLogic.getInstance().addMeetingMember(firstname, lastname,
                "0", "0", appointment.getAppointmentId(), null,  email, baseUrl,
                null, new Boolean(false), language_id, false, "", "", "");
       
        return memberId;
       
      } else {
View Full Code Here

      Long user_level = Usermanagement.getInstance().getUserLevelByID(
          users_id);
     
      if (AuthLevelmanagement.getInstance().checkWebServiceLevel(user_level)){
       
        Appointment appointment = AppointmentDaoImpl.getInstance().getAppointmentByRoom(room_id);
       
        if (appointment == null) {
          return -1L;
        }
       
        //Not In Remote List available - extern user
        Long memberId = MeetingMemberLogic.getInstance().addMeetingMember(firstname, lastname,
                "0", "0", appointment.getAppointmentId(), null,  email, baseUrl,
                null, new Boolean(false), language_id, false, "", jNameTimeZone, invitorName);
       
        return memberId;
       
      } else {
View Full Code Here

    Long userId = 1L;
    Users user = Usermanagement.getInstance().getUserById(userId);
    assertNotNull("Cann't get default user", user);
   
    // add new appointment
    Appointment ap = new Appointment();
   
    ap.setAppointmentName("appointmentName");
    ap.setAppointmentLocation("appointmentLocation");
   
    Date appointmentstart = new Date();
    Date appointmentend = new Date();
    appointmentend.setTime(appointmentstart.getTime() + 3600);
   
    ap.setAppointmentStarttime(appointmentstart);
     ap.setAppointmentEndtime(appointmentend);
    ap.setAppointmentDescription("appointmentDescription");
    ap.setStarttime(new Date());
    ap.setDeleted("false");
    ap.setIsDaily(false);
    ap.setIsWeekly(false);
    ap.setIsMonthly(false);
    ap.setIsYearly(false);
    ap.setIsPasswordProtected(false);

    ap.setUserId(UsersDaoImpl.getInstance().getUser(userId));
    ap.setIsConnectedEvent(false);
    Long appointmentId = AppointmentDaoImpl.getInstance().addAppointmentObj(ap);
    assertNotNull("Cann't add appointment", appointmentId);
 
    String jNameMemberTimeZone = "";
    if (user.getOmTimeZone() != null) {
View Full Code Here

  {
    AppointmentDaoImpl appDaoImpl = AppointmentDaoImpl.getInstance();
    assertNotNull("Cann't access to appointment dao implimentation", appDaoImpl);
   
    // add new appointment
    Appointment ap = new Appointment();
   
    ap.setAppointmentName("appointmentName");
    ap.setAppointmentLocation("appointmentLocation");
   
    Date appointmentstart = new Date();
    Date appointmentend = new Date();
    appointmentend.setTime(appointmentstart.getTime() + 3600);
   
    ap.setAppointmentStarttime(appointmentstart);
     ap.setAppointmentEndtime(appointmentend);
    ap.setAppointmentDescription("appointmentDescription");
    ap.setStarttime(new Date());
    ap.setDeleted("false");
    ap.setIsDaily(false);
    ap.setIsWeekly(false);
    ap.setIsMonthly(false);
    ap.setIsYearly(false);
    ap.setIsPasswordProtected(false);
 
    ap.setUserId(UsersDaoImpl.getInstance().getUser(1L));
    ap.setIsConnectedEvent(false);
    Long id = appDaoImpl.addAppointmentObj(ap);
    assertNotNull("Cann't add appointment", id);
    return ap;
  }
View Full Code Here

    Element root = document.addElement("root");
   
    Element appointments = root.addElement("appointments");
   
    for (Iterator<Appointment> it = aList.iterator();it.hasNext();) {
      Appointment a = it.next();
     
      Element appointment = appointments.addElement("appointment");
     
      appointment.addElement("appointmentId").addCDATA(""+a.getAppointmentId());
      appointment.addElement("appointmentName").addCDATA(""+a.getAppointmentName());
      appointment.addElement("appointmentLocation").addCDATA(""+a.getAppointmentLocation());
      appointment.addElement("appointmentDescription").addCDATA(""+a.getAppointmentDescription());
      appointment.addElement("appointmentStarttime").addCDATA(CalendarPatterns.getDateWithTimeByMiliSeconds(a.getAppointmentStarttime()));
      appointment.addElement("appointmentEndtime").addCDATA(CalendarPatterns.getDateWithTimeByMiliSeconds(a.getAppointmentEndtime()));
      if (a.getAppointmentCategory() != null) {
        appointment.addElement("categoryId").addCDATA(""+a.getAppointmentCategory().getCategoryId());
      } else {
        appointment.addElement("categoryId").addCDATA(""+0);
      }
      if (a.getUserId() != null) {
        appointment.addElement("users_id").addCDATA(""+a.getUserId().getUser_id());
      } else {
        appointment.addElement("users_id").addCDATA(""+0);
      }
      appointment.addElement("deleted").addCDATA(""+a.getDeleted());
      appointment.addElement("comment").addCDATA(""+a.getComment());
      if (a.getRemind() != null) {
        appointment.addElement("typId").addCDATA(""+a.getRemind().getTypId());
      } else {
        appointment.addElement("typId").addCDATA(""+0);
      }
      appointment.addElement("isDaily").addCDATA(""+a.getIsDaily());
      appointment.addElement("isWeekly").addCDATA(""+a.getIsWeekly());
      appointment.addElement("isMonthly").addCDATA(""+a.getIsMonthly());
      appointment.addElement("isYearly").addCDATA(""+a.getIsYearly());
      if (a.getRoom() != null) {
        appointment.addElement("room_id").addCDATA(""+a.getRoom().getRooms_id());
      } else {
        appointment.addElement("room_id").addCDATA(""+0);
      }
      appointment.addElement("icalId").addCDATA(""+a.getIcalId());
      appointment.addElement("language_id").addCDATA(""+a.getLanguage_id());
      appointment.addElement("isPasswordProtected").addCDATA(""+a.getIsPasswordProtected());
      appointment.addElement("password").addCDATA(""+a.getPassword());
     
      //Separated XML File
     
//      Element meetingMembers = appointment.addElement("meetingMembers");
//      //List<String> organisations = new LinkedList();
View Full Code Here

                Boolean isPasswordProtected = importBooleanType(unformatString(appointmentsObject.element("isPasswordProtected").getText()));
                String password = unformatString(appointmentsObject.element("password").getText());
                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.getInstance().getAppointmentCategoryById(categoryId));
                app.setAppointmentStarttime(appointmentStarttime);
                app.setAppointmentEndtime(appointmentEndtime);
                app.setDeleted(deleted);
                app.setComment(comment);
                app.setRemind(AppointmentReminderTypDaoImpl.getInstance().getAppointmentReminderTypById(typId));
                app.setIsDaily(isDaily);
                app.setIsWeekly(isWeekly);
                app.setIsMonthly(isMonthly);
                app.setIsYearly(isYearly);
                app.setRoom(Roommanagement.getInstance().getRoomById(room_id));
                app.setIcalId(icalId);
                app.setLanguage_id(language_id);
                app.setIsPasswordProtected(isPasswordProtected);
                app.setPassword(password);
                app.setUserId(Usermanagement.getInstance().getUserById(users_id));
               
                appointmentList.add(app);
               
              }
             
View Full Code Here

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

      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("appointmentId",appointmentId);
     
     
      Appointment appoint = null;
      try{
        appoint = (Appointment) query.getSingleResult();
        } catch (NoResultException ex) {
        }
      tx.commit();
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);
     
      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

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.