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

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


  final public void testAppointmentCategoryDaoImpl() throws Exception{

    Long id = AppointmentCategoryDaoImpl.getInstance().addAppointmentCategory(1L, "Category", "comment");
    assertNotNull("Cann't add Appointment category", id);

    AppointmentCategory ac = AppointmentCategoryDaoImpl.getInstance().getAppointmentCategoryById(id);  
    assertNotNull("Cann't get Appointment Category", ac);
   
    id = AppointmentCategoryDaoImpl.getInstance().deleteAppointmentCategory(id);
    assertNotNull("Cann't delete Appointment Category", id);
  }
View Full Code Here


     
     
      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);
     
View Full Code Here

           
            if(res == null || res.size() < 1)
              log.debug("no AppointmentCategories found");
            else{
              for(int i = 0; i < res.size(); i++){
                AppointmentCategory ac = res.get(i);
                log.debug("found appCategory : " + ac.getName());
              }
            }
           
            return res;
          }
View Full Code Here

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

 
  public Long updateAppointmentCategory(Long categoryId, String name) {
    try {
     
     
      AppointmentCategory ac = this.getAppointmentCategoryById(categoryId);
                 
      ac.setName(name);
      ac.setUpdatetime(new Date());
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      if (ac.getCategoryId() == null) {
        session.persist(ac);
          } else {
            if (!session.contains(ac)) {
              session.merge(ac);
          }
View Full Code Here

  }
 
  public Long addAppointmentCategory( Long user_id, String name, String comment) {
    try {
     
      AppointmentCategory ac = new AppointmentCategory();
     
      ac.setName(name);
      ac.setStarttime(new Date());
      ac.setDeleted("false");
      ac.setUser(UsersDaoImpl.getInstance().getUser(user_id));
      ac.setComment(comment);
     
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      ac = session.merge(ac);
      Long category_id = ac.getCategoryId();

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

  }
 
  public Long deleteAppointmentCategory(Long categoryId) {
    try {
     
      AppointmentCategory ac = this.getAppointmentCategoryById(categoryId);
     
      log.debug("ac: "+ac);
     
      if (ac == null) {
        log.debug("Already deleted / Could not find: "+categoryId);
        return categoryId;
      }
      ac.setUpdatetime(new Date());
      ac.setDeleted("true");
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (ac.getCategoryId() == null) {
        session.persist(ac);
          } else {
            if (!session.contains(ac)) {
              session.merge(ac);
          }
View Full Code Here

        if (res == null || res.size() < 1)
          log.debug("no AppointmentCategories found");
        else {
          for (int i = 0; i < res.size(); i++) {
            AppointmentCategory ac = res.get(i);
            log.debug("found appCategory : " + ac.getName());
          }
        }

        return res;
      } else {
View Full Code Here

        if (res == null || res.size() < 1)
          log.debug("no AppointmentCategories found");
        else {
          for (int i = 0; i < res.size(); i++) {
            AppointmentCategory ac = res.get(i);
            log.debug("found appCategory : " + ac.getName());
          }
        }

        return res;
      } else {
View Full Code Here

      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,
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.calendar.AppointmentCategory

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.