Package org.openmeetings.app.persistence.beans.user

Examples of org.openmeetings.app.persistence.beans.user.Usergroups


        }
      } catch (Exception ex2) {
        log.error("getAllGroupUsers",ex2);
      }
    } else {
      usergroups[0] = new Usergroups();
      usergroups[0].setName("Error: Permission denied");
    }
    return usergroups;
  }
View Full Code Here


    }
    return usergroups;
  }

  public Usergroups getGroup(Long usergroup_id) {
    Usergroups usergroups = new Usergroups();
    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
View Full Code Here

        }
      } catch (Exception ex2) {
        log.error("getAllGroup",ex2);
      }
    } else {
      usergroups[0] = new Usergroups();
      usergroups[0].setName("Error: Permission denied");
    }
    return usergroups;
  }
View Full Code Here

  public String addGroup(Long user_level, Long USER_ID, Long level_id,
      String name, String description, String comment) {
    String res = "Addgroup";
    if (checkUserLevel(user_level)) {
      Usergroups usergroups = new Usergroups();
      //Todo: Add business logic for users-history
      //usergroups.setUSER_ID(USER_ID);
      usergroups.setLevel_id(level_id);
      usergroups.setName(name);
      //        usergroups.setDescription(description);
      //        usergroups.setComment(comment);
      usergroups.setStarttime(new Date());
      usergroups.setUpdatetime(null);
      try {
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
        tx.begin();
View Full Code Here

        }
      } catch (Exception ex2) {
        log.error("getAllGroupFree",ex2);
      }
    } else {
      groups[0] = new Usergroups();
      groups[0].setComment("Error: Permission denied");
    }
    return groups;
  }
View Full Code Here

    }
    return groups;
  }

  public Usergroups getSingleGroupFree(Long user_level, Long usergroup_id) {
    Usergroups groups = new Usergroups();
    if (checkConfLevel(user_level)) {
      try {
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
      tx.begin();
        Query query = session
            .createQuery("select c from Usergroups as c where c.usergroup_id = :usergroup_id AND c.level_id = :level_id");
        query.setParameter("usergroup_id", usergroup_id.longValue());
        query.setParameter("level_id", 1);
        for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
          groups = (Usergroups) it2.next();
        }
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
        //Todo: Set user
        //groups.setUsers(ResHandler.getUsermanagement().getUser(groups.getUSER_ID()));

      } catch (Exception ex2) {
        log.error("getSingleGroupFree",ex2);
      }
    } else {
      groups.setComment("Error: Permission denied");
    }
    return groups;
  }
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.user.Usergroups

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.