Examples of Organisation_Users


Examples of org.apache.openmeetings.db.entity.user.Organisation_Users

        } else {

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

          Organisation_Users ou = organisationManager
              .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

Examples of org.apache.openmeetings.db.entity.user.Organisation_Users

    final List<Organisation_Users> orgUsers;
    if (isAdminForm) {
      List<Organisation> orgList = getBean(OrganisationDao.class).get(0, Integer.MAX_VALUE);
      orgUsers = new ArrayList<Organisation_Users>(orgList.size());
      for (Organisation org : orgList) {
        orgUsers.add(new Organisation_Users(org));
      }
    } else {
      orgUsers = getModelObject().getOrganisation_users();
    }
    add(new Select2MultiChoice<Organisation_Users>("organisation_users", null, new TextChoiceProvider<Organisation_Users>() {
      private static final long serialVersionUID = 1L;

      @Override
      protected String getDisplayText(Organisation_Users choice) {
        return choice.getOrganisation().getName();
      }

      @Override
      protected Object getId(Organisation_Users choice) {
        return choice.getOrganisation().getOrganisation_id();
      }

      @Override
      public void query(String term, int page, Response<Organisation_Users> response) {
        for (Organisation_Users ou : orgUsers) {
          if (Strings.isEmpty(term) || (!Strings.isEmpty(term) && ou.getOrganisation().getName().contains(term))) {
            response.add(ou);
          }
        }
      }

      @Override
      public Collection<Organisation_Users> toChoices(Collection<String> _ids) {
        List<Long> ids = new ArrayList<Long>();
        for (String id : _ids) {
          ids.add(Long.parseLong(id));
        }
        List<Organisation_Users> list = new ArrayList<Organisation_Users>();
        for (Organisation o : getBean(OrganisationDao.class).get(ids)) {
          list.add(new Organisation_Users(o));
        }
        return list;
      }
    }).setEnabled(isAdminForm));
  }
View Full Code Here

Examples of org.apache.openmeetings.db.entity.user.Organisation_Users

    SearchableDataView<Organisation_Users> dataView = new SearchableDataView<Organisation_Users>("userList", new OrgUserDataProvider()) {
      private static final long serialVersionUID = 1L;

      @Override
      protected void populateItem(Item<Organisation_Users> item) {
        final Organisation_Users orgUser = item.getModelObject();
        User u = orgUser.getUser();
        item.add(new CheckBox("isModerator").add(new OnChangeAjaxBehavior() {
          private static final long serialVersionUID = 1L;

          @Override
          protected void onUpdate(AjaxRequestTarget target) {
            if (orgUser.getOrganisation_users_id() != null) {
              getBean(OrganisationUserDao.class).update(orgUser, WebSession.getUserId());
            }
          }
        }));
        Label label = new Label("label", u == null ? "" : GroupForm.formatUser(u));
        if (orgUser.getOrganisation_users_id() == null) {
          label.add(AttributeAppender.append("class", "newItem"));
        }
        item.add(label);
        item.add(new WebMarkupContainer("deleteUserBtn").add(new AjaxEventBehavior("onclick"){
          private static final long serialVersionUID = 1L;

          @Override
          protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            attributes.getAjaxCallListeners().add(new ConfirmCallListener(833L));
          }
         
          @Override
          protected void onEvent(AjaxRequestTarget target) {
            if (orgUser.getOrganisation_users_id() == null) {
              for (int i = 0; i < users2add.size(); ++i) {
                //FIXME ineffective
                if (users2add.get(i).getUser().getUser_id().equals(orgUser.getUser().getUser_id())) {
                  users2add.remove(i);
                  break;
                }
              }
            } else {
View Full Code Here

Examples of org.apache.openmeetings.db.entity.user.Organisation_Users

    User u = getValidUser();
    Long orgId = u.getOrganisation_users().get(0).getOrganisation().getOrganisation_id();
    List<Organisation_Users> ul = orgUserDao.get(orgId, 0, 9999);
    assertTrue("Default Organisation should contain at least 1 user: " + ul.size(), ul.size() > 0);
   
    Organisation_Users ou = orgUserDao.getByOrganizationAndUser(orgId, u.getUser_id());
    assertNotNull("Unable to found [organisation, user] pair - [" + orgId + "," + u.getUser_id() + "]", ou);
  }
View Full Code Here

Examples of org.apache.openmeetings.db.entity.user.Organisation_Users

 
  @Test
  public void createUserWithOrganisation() throws Exception {
    int rnd = random.nextInt();
    User u = getUser(rnd);
    u.getOrganisation_users().add(new Organisation_Users(orgDao.get(1L)));
    u = userDao.update(u, null);
    assertTrue("Password should be set as expected", userDao.verifyPassword(u.getUser_id(), "pass" + rnd));
   
    User u1 = userDao.get(u.getUser_id());
    assertNotNull("Just created user should not be null", u1);
View Full Code Here

Examples of org.apache.openmeetings.db.entity.user.Organisation_Users

  private void updateUser(Organisation_Users entity, boolean delete, Long userId) {
    //entity has been detached need to re-fetch
    User u = usersDao.get(entity.getUser().getUser_id());
    int idx = u.getOrganisation_users().indexOf(entity);
    if (delete && idx > -1) {
      Organisation_Users ou = u.getOrganisation_users().remove(idx);
      em.remove(ou);
    } else if (!delete && idx < 0) {
      u.getOrganisation_users().add(entity);
    }
    usersDao.update(u, userId);
View Full Code Here

Examples of org.apache.openmeetings.db.entity.user.Organisation_Users

            u = new User();
            u.setType(Type.ldap);
            u.setRights(rights);
            u.setDomainId(domainId);
            u.getOrganisation_users().add(new Organisation_Users(orgDao.get(cfgDao.getConfValue("default_domain_id", Long.class, "-1"))));
            u.setLogin(user);
            u.setAge(new Date());
            u.setShowContactDataToContacts(true);
            u.setAdresses(new Address());
            u.setLanguage_id(cfgDao.getConfValue(CONFIG_DEFAUT_LANG_KEY, Long.class, "1"));
View Full Code Here

Examples of org.apache.openmeetings.db.entity.user.Organisation_Users

          rights.remove(Right.Login);
        }

        List<Organisation_Users> orgList = new ArrayList<Organisation_Users>();
        for (Long id : organisations) {
          orgList.add(new Organisation_Users(orgDao.get(id)));
        }
        User u = usersDao.addUser(rights, firstname, login, lastname, language_id,
            password, adr, sendSMS, age, hash, timezone,
            forceTimeZoneCheck, userOffers, userSearchs, showContactData,
            showContactDataToContacts, null, null, orgList, null);
View Full Code Here

Examples of org.apache.openmeetings.db.entity.user.Organisation_Users

              found = true;
              break;
            }
          }
          if (!found) {
            Organisation_Users ou = new Organisation_Users(o);
            ou.setUser(u);
            usersPanel.getUsers2add().add(ou);

            userToadd.setModelObject(null);
            target.add(usersPanel, userToadd);
          }
View Full Code Here

Examples of org.apache.openmeetings.db.entity.user.Organisation_Users

        } else {

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

          Organisation_Users ou = organisationManager
              .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
TOP
Copyright © 2018 www.massapi.com. 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.