Package org.openmeetings.app.persistence.beans.domain

Examples of org.openmeetings.app.persistence.beans.domain.Organisation_Users


     
     
      Element user_organisations = user.addElement("organisations");
      //List<String> organisations = new LinkedList();
      for (Iterator<Organisation_Users> iterObj = u.getOrganisation_users().iterator();iterObj.hasNext(); ) {
        Organisation_Users orgUsers = iterObj.next();
        user_organisations.addElement("organisation_id").addText(orgUsers.getOrganisation().getOrganisation_id().toString());
      }
     
      //Not need at the moment
      //Element user_groups = user.addElement("groups");
View Full Code Here


          }
     
      Users us = UsersDaoImpl.getInstance().getUser(users_id);
     
      for (Iterator<Organisation_Users> iter = us.getOrganisation_users().iterator();iter.hasNext();) {
        Organisation_Users orgUser = iter.next();
        Long organisation_id = orgUser.getOrganisation().getOrganisation_id();
       
        List<Rooms_Organisation> rOrgList = Roommanagement.getInstance().getRoomsOrganisationByOrganisationId(3, organisation_id);
        for (Iterator<Rooms_Organisation> iterOrgList = rOrgList.iterator();iterOrgList.hasNext();){
          Rooms_Organisation rOrg = iterOrgList.next();
              if (i==0) whereClause += " (";
View Full Code Here

      //List<String> organisations = new LinkedList();
      for (Iterator<Organisation_Users> iterObj = u.getOrganisation_users().iterator();iterObj.hasNext(); ) {
       
        Element user_organisation = user_organisations.addElement("user_organisation");
       
        Organisation_Users orgUsers = iterObj.next();
        if (orgUsers.getOrganisation() != null) {
          user_organisation.addElement("organisation_id").addCDATA(formatString(""+orgUsers.getOrganisation().getOrganisation_id().toString()));
        } else {
          user_organisation.addElement("organisation_id").addCDATA("0");
        }
       
        user_organisation.addElement("deleted").addCDATA(formatString(""+orgUsers.getDeleted()));
        user_organisation.addElement("user_id").addCDATA(formatString(""+orgUsers.getUser_id()));
        user_organisation.addElement("isModerator").addCDATA(formatString(""+orgUsers.getIsModerator()));
        user_organisation.addElement("comment").addCDATA(formatString(""+orgUsers.getComment()));
       
      }
     
      //Not need at the moment
      //Element user_groups = user.addElement("groups");
View Full Code Here

                    Long user_id = importLongType(unformatString(organisationObject.element("user_id").getText()));
                    Boolean isModerator = importBooleanType(unformatString(organisationObject.element("isModerator").getText()));
                    String commentOrg = unformatString(organisationObject.element("comment").getText());
                    String deleted = unformatString(organisationObject.element("deleted").getText());
                   
                    Organisation_Users orgUser = new Organisation_Users();
                    orgUser.setOrganisation(Organisationmanagement.getInstance().getOrganisationByIdBackup(organisation_id));
                    orgUser.setUser_id(user_id);
                    orgUser.setIsModerator(isModerator);
                    orgUser.setComment(commentOrg);
                    orgUser.setStarttime(new Date());
                    orgUser.setDeleted(deleted);
                   
                    orgUsers.add(orgUser);
                   
                  }
                 
                }
               
                Long userId = us.getUser_id();
               
                //check if login does already exists, but only for users that have been created in the OpenMeetings Administration
                //maybe we should check status too
                /*
                if ((us.getExternalUserId() == null || us.getExternalUserId() == 0) && email != null && email.length() > 0){
                 
                  Users storedUser = Usermanagement.getInstance().getUserByLoginOrEmail(us.getLogin());
                 
                  if (storedUser != null) {
                    log.info("A user with the given login does already exist "+us.getLogin());
                  } else {
 
                    storedUser = Usermanagement.getInstance().getUserByLoginOrEmail(email);
                   
                    if (storedUser != null) {
                      log.info("A user with the given email as login does already exist "+email);
                    }
                  }
                  if (storedUser != null) {
                    usersMap.put(userId, storedUser.getUser_id());
                    continue;
                  }
                }
                */

                log.debug("Import User ID "+userId);
                us.setUser_id(null);
                us.setStarttime(new Date());
                Long actualNewUserId = Usermanagement.getInstance().addUserBackup(us);
                usersMap.put(userId, actualNewUserId);
               
                for (Iterator<Organisation_Users> orgUserIterator = orgUsers.iterator();orgUserIterator.hasNext();) {
                 
                  Organisation_Users organisationUsers = orgUserIterator.next();
                 
                  organisationUsers.setUser_id(actualNewUserId);
                 
                  Organisationmanagement.getInstance().addOrganisationUserObj(organisationUsers);
                 
                }
               
View Full Code Here

            }
       
        Users us = UsersDaoImpl.getInstance().getUser(users_id);
       
        for (Iterator<Organisation_Users> iter = us.getOrganisation_users().iterator();iter.hasNext();) {
          Organisation_Users orgUser = iter.next();
          Long organisation_id = orgUser.getOrganisation().getOrganisation_id();
         
          List<Rooms_Organisation> rOrgList = Roommanagement.getInstance().getRoomsOrganisationByOrganisationId(3, organisation_id);
          for (Iterator<Rooms_Organisation> iterOrgList = rOrgList.iterator();iterOrgList.hasNext();){
            Rooms_Organisation rOrg = iterOrgList.next();
                if (i==0) whereClause += " (";
View Full Code Here

        } else {

          log.debug("user_id, organisation_id" + user_id + ", "
              + organisation_id);

          Organisation_Users ou = Organisationmanagement
              .getInstance()
              .getOrganisation_UserByUserAndOrganisation(user_id,
                  organisation_id);

          log.debug("ou: " + ou);

          if (ou != null) {
            if (ou.getIsModerator() != null && ou.getIsModerator()) {
              return 2L;
            } else {
              return us.getLevel_id();
            }
          } else {
View Full Code Here

        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
        tx.begin();
        Organisation_Users orgUser = new Organisation_Users();
        orgUser.setOrganisation(org);
        orgUser.setUser_id(user_id);
        orgUser.setDeleted("false");
        orgUser.setStarttime(new Date());
        orgUser.setComment(comment);
        orgUser = session.merge(orgUser);
        // We need this flush
        session.flush();
        long id = orgUser.getOrganisation_users_id();

        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
        return id;
      } else {
View Full Code Here

      if (AuthLevelmanagement.getInstance().checkAdminLevel(user_level)) {

        log.error("deleteUserFromOrganisation " + user_id + "  "
            + organisation_id);

        Organisation_Users orgUser = this
            .getOrganisation_UserByUserAndOrganisation(user_id,
                organisation_id);
        log.error("org: " + orgUser.getOrganisation().getName());
        orgUser.setDeleted("true");
        orgUser.setUpdatetime(new Date());

        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
        tx.begin();
        if (orgUser.getOrganisation_users_id() == null) {
          session.persist(orgUser);
        } else {
          if (!session.contains(orgUser)) {
            session.merge(orgUser);
          }
        }
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
        return orgUser.getOrganisation_users_id();
      } else {
        log.error("[deleteUserFromOrganisation] authorization required");
      }
    } catch (Exception ex2) {
      log.error("[deleteuserFromOrganisation]", ex2);
View Full Code Here

      long organisation_id) {
    try {
      Users us = UsersDaoImpl.getInstance().getUser(users_id);
      for (Iterator it = us.getOrganisation_users().iterator(); it
          .hasNext();) {
        Organisation_Users orguser = (Organisation_Users) it.next();
        if (orguser.getOrganisation().getOrganisation_id() == organisation_id)
          return true;
      }
    } catch (Exception ex2) {
      log.error("[checkUserContainsOrganisation]", ex2);
    }
View Full Code Here

      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
      List<Users> userL = new LinkedList<Users>();
      for (Iterator<Organisation_Users> it = userOrg.iterator(); it
          .hasNext();) {
        Organisation_Users us = (Organisation_Users) it.next();

        // Only add this single Organization add this point cause
        // cause all the other are not needed at this point
        Users user = UsersDaoImpl.getInstance()
            .getUser(us.getUser_id());

        user.setOrganisation_users(new LinkedList<Organisation_Users>());
        user.getOrganisation_users().add(us);

        userL.add(user);
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.domain.Organisation_Users

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.