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

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


  public Long addUserToOrganisation(Long user_id, Long organisation_id,
      Long insertedby, String comment) {
    try {
      if (this.getOrganisation_UserByUserAndOrganisation(user_id,
          organisation_id) == null) {
        Organisation org = this.getOrganisationById(organisation_id);
        log.debug("org: " + org.getName());

        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
        tx.begin();
View Full Code Here


        List<Organisation> returnList = new LinkedList<Organisation>();
        boolean notInList = true;

        for (Iterator it = allOrgs.iterator(); it.hasNext();) {
          Organisation org = (Organisation) it.next();
          notInList = true;
          for (Iterator it2 = orgUser.iterator(); it2.hasNext();) {
            Organisation orgObj = (Organisation) it2.next();
            // log.error("orgObj ID: "+orgObj.getOrganisation_id());
            // log.error("orgUser ID: "+org.getOrganisation_id());
            if (orgObj.getOrganisation_id().equals(
                org.getOrganisation_id())) {
              notInList = false;
              // log.error("found notinList: "+notInList);
              break;
            }
View Full Code Here

   * @param titelname
   * @param user_id
   */
  public Long addOrganisation(String orgname, long user_id) {
    try {
      Organisation org = new Organisation();
      org.setName(orgname);
      org.setInsertedby(new Long(user_id));
      org.setDeleted("false");
      org.setStarttime(new Date());
      org = em.merge(org);

      long id = org.getOrganisation_id();
      return id;
    } catch (Exception ex2) {
      log.error("[addOrganisation]", ex2);
    }
    return null;
View Full Code Here

   */
  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());

      em.merge(org);

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

  public Organisation getOrganisationById(long organisation_id) {
    try {
      TypedQuery<Organisation> query = em.createNamedQuery("getOrganisationById", Organisation.class);
      query.setParameter("organisation_id", organisation_id);
      query.setParameter("deleted", "true");
      Organisation o = null;
      try {
        o = query.getSingleResult();
      } catch (NoResultException e) {
        // o = null;
      }
View Full Code Here

  public Organisation getOrganisationByIdBackup(long organisation_id) {
    try {
      TypedQuery<Organisation> query = em.createNamedQuery("getAnyOrganisationById", Organisation.class);
      query.setParameter("organisation_id", organisation_id);
      Organisation o = null;
      try {
        o = query.getSingleResult();
      } catch (NoResultException e) {
        // o = null;
      }
View Full Code Here

    try {
      em.createNamedQuery("deleteUsersFromOrganisation")
        .setParameter("organisation_id", organisation_id)
        .executeUpdate();

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

      if (org.getOrganisation_id() == null) {
        em.persist(org);
      } else {
        if (!em.contains(org)) {
          em.merge(org);
        }
      }

      return org.getOrganisation_id();

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

            String name = unformatString(orgObject.element("name")
                .getText());
            String deleted = unformatString(orgObject.element(
                "deleted").getText());

            Organisation organisation = new Organisation();
            organisation.setName(name);
            organisation.setDeleted(deleted);

            Long newOrgID = organisationmanagement
                .addOrganisationObj(organisation);
            organisationsMap.put(organisation_id, newOrgID);
          }
View Full Code Here

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

          List<Users> uList = null;
          String downloadName = "users";
          if (moduleName.equals("userorganisations")) {
            Organisation orga = getOrganisationmanagement()
                .getOrganisationById(organisation_id);
            downloadName += "_" + orga.getName();
            uList = getOrganisationmanagement()
                .getUsersByOrganisationId(organisation_id);
          } else {
            uList = getUsersDao().getAllUsers();
          }
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

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.