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

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


    }
    return usersusergroups;
  }

  public Users_Usergroups getUserGroupsSingle(long USER_ID) {
    Users_Usergroups usersusergroups = new Users_Usergroups();
    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
View Full Code Here


  public String addUserToGroup(Long user_level, Long GROUP_ID, Long USER_ID,
      String comment) {
    String res = "addUserToGroup";
    if (checkUserLevel(user_level)) {
      Users_Usergroups usersusergroups = new Users_Usergroups();
      usersusergroups.setUsergroup_id(GROUP_ID);
      usersusergroups.setUser_id(USER_ID);
      usersusergroups.setComment(comment);
      usersusergroups.setStarttime(new Date());
      usersusergroups.setUpdatetime(null);
      try {
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
        tx.begin();
View Full Code Here

    }
    return res;
  }

  public Users_Usergroups getGroupUsers(Long user_level, Long usergroup_id) {
    Users_Usergroups groups = new Users_Usergroups();
    if (checkUserLevel(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");
        query.setParameter("usergroup_id", usergroup_id.longValue());
        for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
          groups = (Users_Usergroups) it2.next();
        }
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
        //TODO: setzen der Usergroups einer Gruppe
        //groups.setUsergroups(getUsergroupsUsers(GROUP_ID));
      } catch (Exception ex2) {
        log.error("getGroupUsers",ex2);
      }
    } else {
      groups.setComment("Error: Permission denied");
    }
    return groups;
  }
View Full Code Here

    }
    return usergroups;
  }

  public Users_Usergroups getSingleGroup(Long user_level, Long usergroup_id) {
    Users_Usergroups groups = new Users_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");
        query.setParameter("usergroup_id", usergroup_id.longValue());
        for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
          groups = (Users_Usergroups) it2.next();
        }
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
        //TODO: Benutzer einer gruppe setzten
        //groups.setUsers(ResHandler.getUsermanagement().getUser(groups()));

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

TOP

Related Classes of org.openmeetings.app.persistence.beans.user.Users_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.