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

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


          System.out.println("organisation_id: " + organisation_id);

          List<Users> uList = null;
          String downloadName = "users";
          if (moduleName.equals("userorganisations")) {
            Organisation  orga = Organisationmanagement.getInstance().getOrganisationById(organisation_id);
            downloadName += "_"+orga.getName();
            uList = Organisationmanagement.getInstance()
              .getUsersByOrganisationId(organisation_id);
          } else {
            uList = UsersDaoImpl.getInstance().getAllUsers();
          }
View Full Code Here


    List orgUser = Organisationmanagement.getInstance().getOrganisationsByUserId(3, 1, 0, 100, "organisation_id", true);
   
    log.error("testitNow"+orgUser.size());
   
    for (Iterator it2 = orgUser.iterator();it2.hasNext();){
      Organisation orgUserObj = (Organisation) it2.next();
      log.error("testitNow"+orgUserObj.getOrganisation_id());
      log.error(orgUserObj.getName());
    }
   
    List orgUser2 = Organisationmanagement.getInstance().getRestOrganisationsByUserId(3, 1, 0, 100, "organisation_id", true);
   
    log.error("testitNow"+orgUser2.size());
   
    for (Iterator it2 = orgUser2.iterator();it2.hasNext();){
      Organisation orgUserObj = (Organisation) it2.next();
      log.error("testitNow"+orgUserObj.getOrganisation_id());
      log.error(orgUserObj.getName());
    }   
   
  }
View Full Code Here

    Element root = document.addElement("root");
   
    Element organisations = root.addElement("organisations");
   
    for (Iterator<Organisation> it = orgList.iterator();it.hasNext();) {
      Organisation org = it.next();
     
      Element organisation = organisations.addElement("organisation");
     
      organisation.addElement("name").addCDATA(formatString(""+org.getName()));
      organisation.addElement("organisation_id").addCDATA(formatString(""+org.getOrganisation_id()));
      organisation.addElement("deleted").addCDATA(formatString(""+org.getDeleted()));
     
    }
 
    return document;
 
View Full Code Here

               
                Long organisation_id = importLongType(unformatString(orgObject.element("organisation_id").getText()));
                String name = unformatString(orgObject.element("name").getText());
                String deleted = unformatString(orgObject.element("deleted").getText());
               
                Organisation organisation = new Organisation();
                organisation.setOrganisation_id(organisation_id);
                organisation.setName(name);
                organisation.setDeleted(deleted);
               
                orgList.add(organisation);
               
              }
             
View Full Code Here

    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Organisation org = new Organisation();
      org.setName(orgname);
      org.setInsertedby(new Long(user_id));
      org.setDeleted("false");
      org.setStarttime(new Date());
      org = session.merge(org);
      session.flush();
      long id = org.getOrganisation_id();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
      return id;
    } catch (Exception ex2) {
      log.error("[addOrganisation]", ex2);
View Full Code Here

   * @return
   */
  public Long updateOrganisation(Long user_level, long organisation_id,
      String orgname, long users_id) {
    try {
      Organisation org = this.getOrganisationById(organisation_id);
      org.setName(orgname);
      org.setUpdatedby(users_id);
      org.setUpdatetime(new Date());
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (org.getOrganisation_id() == null) {
        session.persist(org);
      } else {
        if (!session.contains(org)) {
          session.merge(org);
        }
      }
      session.flush();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);

      return org.getOrganisation_id();
    } catch (Exception err) {
      log.error("updateOrganisation", err);
    }
    return null;
  }
View Full Code Here

      tx.begin();
      Query query = session
          .createQuery("select c from Organisation as c where c.organisation_id = :organisation_id AND c.deleted <> :deleted");
      query.setParameter("organisation_id", organisation_id);
      query.setParameter("deleted", "true");
      Organisation o = null;
      try {
        o = (Organisation) query.getSingleResult();
      } catch (NoResultException e) {
        // o = null;
      }
View Full Code Here

      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session
          .createQuery("select c from Organisation as c where c.organisation_id = :organisation_id");
      query.setParameter("organisation_id", organisation_id);
      Organisation o = null;
      try {
        o = (Organisation) query.getSingleResult();
      } catch (NoResultException e) {
        // o = null;
      }
View Full Code Here

      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session
          .createQuery("select c from Organisation as c where c.organisation_id = :organisation_id");
      query.setParameter("organisation_id", organisation_id);
      Organisation o = null;
      try {
        o = (Organisation) query.getSingleResult();
      } catch (NoResultException e) {
        // o = null;
      }
View Full Code Here

   * @return
   */
  public Long deleteOrganisation(long organisation_id, long updatedby) {
    try {

      Organisation org = this.getOrganisationById(organisation_id);
      org.setDeleted("true");
      org.setUpdatedby(updatedby);

      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (org.getOrganisation_id() == null) {
        session.persist(org);
      } else {
        if (!session.contains(org)) {
          session.merge(org);
        }
      }
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);

      return org.getOrganisation_id();

    } catch (Exception ex2) {
      log.error("[deleteOrganisation]", ex2);
    }
    return null;
View Full Code Here

TOP

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

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.