Package org.apache.openmeetings.persistence.beans.domain

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


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


    return getModelObject().getOrganisation_id() != null ? getModelObject().getOrganisation_id() : 0;
  }
 
  @Override
  protected void onNewSubmit(AjaxRequestTarget target, Form<?> f) {
    this.setModelObject(new Organisation());
    updateView(target);
  }
View Full Code Here

    updateView(target);
  }
 
  @Override
  protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
    Organisation org = getModelObject();
    if (org.getOrganisation_id() != null) {
      org = Application.getBean(OrganisationDao.class).get(org.getOrganisation_id());
    } else {
      org = new Organisation();
    }
    this.setModelObject(org);
    updateView(target);
  }
View Full Code Here

            target.appendJavaScript("addUsers();");
          }
        });
       
    //Adding the Group Form
    form = new GroupForm("form", listContainer, new Organisation()){
      private static final long serialVersionUID = -3042797340375988889L;

      @Override
      protected void onModelChanged() {
        super.onModelChanged();
        boolean orgEmpty = getModelObject().getOrganisation_id() == null;
        if (orgEmpty) {
          addUsersBtn.add(AttributeModifier.replace("class", "formNewButton disabled"));
        } else {
          addUsersBtn.add(AttributeModifier.replace("class", "formNewButton"));
        }
        addUsersBtn.setEnabled(!orgEmpty);
        addUsersForm.setOrganisation(getModelObject());
      }
     
      @Override
      void updateView(AjaxRequestTarget target) {
        super.updateView(target);
        target.add(addUsersBtn);
      }
    };
        add(form.add(addUsersBtn.setOutputMarkupId(true)));
        addUsersForm = new AddUsersForm("addUsers", form);
    add(addUsersForm);

        //List view
        SearchableDataView<Organisation> dataView = new SearchableDataView<Organisation>("groupList", new SearchableDataProvider<Organisation>(OrganisationDao.class)) {
      private static final long serialVersionUID = 8715559628755439596L;

      @Override
      protected void populateItem(Item<Organisation> item) {
        final Organisation organisation = item.getModelObject();
        item.add(new Label("organisation_id", "" + organisation.getOrganisation_id()));
        item.add(new Label("name", "" + organisation.getName()));
        item.add(new AjaxEventBehavior("onclick") {
          private static final long serialVersionUID = -8069413566800571061L;

          protected void onEvent(AjaxRequestTarget target) {
            form.hideNewRecord();
View Full Code Here

 
  public Organisation read(InputNode node) throws Exception {
    long oldId = getlongValue(node);
    long newId = idMap.containsKey(oldId) ? idMap.get(oldId) : oldId;
   
    Organisation o = orgDao.get(newId);
    return o == null ? new Organisation() : o;
  }
View Full Code Here

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

          List<User> uList = null;
          String downloadName = "users";
          if (moduleName.equals("userorganisations")) {
            Organisation orga = getBean(OrganisationManager.class)
                .getOrganisationById(organisation_id);
            downloadName += "_" + orga.getName();
            uList = getBean(OrganisationManager.class)
                .getUsersByOrganisationId(organisation_id);
          } else {
            uList = getBean(UsersDao.class).getAllUsers();
          }
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 = orgDao.get(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 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

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

          List<User> uList = null;
          String downloadName = "users";
          if (moduleName.equals("userorganisations")) {
            Organisation orga = getBean(OrganisationManager.class)
                .getOrganisationById(organisation_id);
            downloadName += "_" + orga.getName();
            uList = getBean(OrganisationManager.class)
                .getUsersByOrganisationId(organisation_id);
          } else {
            uList = getBean(UsersDao.class).getAllUsers();
          }
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.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.