Package org.apache.openmeetings.persistence.beans.user

Examples of org.apache.openmeetings.persistence.beans.user.User


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


    // Delete old one
    File fToDelete = new File(fileFullPath);
    fToDelete.delete();

    String pictureuri = destinationFile.getName();
    User us = usersDao.get(users_id);
    us.setUpdatetime(new java.util.Date());
    us.setPictureuri(pictureuri);
    usersDao.update(us, users_id);

    //FIXME: After uploading a new picture all other clients should refresh
    //scopeApplicationAdapter.updateUserSessionObject(users_id, pictureuri);
View Full Code Here

    assertNotNull("Cann't add appointment", id);
    return ap;
  }

  public User createUser(int rnd) throws Exception {
    User users = new User();
    // add user
    users.setFirstname("firstname" + rnd);
    users.setLastname("lastname" + rnd);
    users.setLogin("login");
    users.updatePassword(cryptManager, configurationDao, "pass" + rnd);
    users.setLanguage_id(1L);
    Long user_id = userManager.addUser(users);
    assertTrue("Cann't add user", user_id > 0);
    users = userManager.getUserByIdAndDeleted(user_id);
    assertNotNull("User should not be null", users);
    return users;
View Full Code Here

            ClassPathXmlApplicationContext ctx = getApplicationContext(ctxName);
            UsersDao udao = ctx.getBean(UsersDao.class);
            for (File profile : profiles.listFiles()) {
              long pSize = OmFileHelper.getSize(profile);
              long userId = getUserIdByProfile(profile.getName());
              User u = udao.get(userId);
              if (profile.isFile() || userId < 0 || u == null) {
                if (cleanup) {
                  FileHelper.removeRec(profile);
                } else {
                  invalid += pSize;
                }
              } else if (u.getDeleted()) {
                if (cleanup) {
                  FileHelper.removeRec(profile);
                } else {
                  deleted += pSize;
                }
              }
            }
            long missing = 0;
            for (User u : udao.getAllUsersDeleted()) {
              if (!u.getDeleted() && !new File(OmFileHelper.getUploadProfilesUserDir(u.getUser_id()), u.getPictureuri()).exists()) {
                missing++;
              }
            }
            long size = OmFileHelper.getSize(profiles);
            long restSize = sectionSize - size;
View Full Code Here

    InputNode listNode1 = root1.getNext(); //HACK to handle Address inside user
    if (listNodeName.equals(listNode.getName())) {
      InputNode item = listNode.getNext();
      InputNode item1 = listNode1.getNext(); //HACK to handle Address inside user
      while (item != null) {
        User u = ser.read(User.class, item, false);
       
        //HACK to handle Address inside user
        if (u.getAdresses() == null) {
          Address a = ser.read(Address.class, item1, false);
          u.setAdresses(a);
        }
        list.add(u);
        item = listNode.getNext();
        do {
          item1 = listNode1.getNext(); //HACK to handle Address inside user
View Full Code Here

      if (point == null) {
        log.error("could not retrieve appointment!");
        return null;
      }

      User user = userManager.getUserById(users_id);

      if (user == null) {
        log.error("could not retrieve user!");
        return null;
      }
View Full Code Here

    return null//unreachable
  }
 
  @Test
  public void getUsersByOrganisationId() {
    User u = getValidUser();
    Long orgId = u.getOrganisation_users().get(0).getOrganisation().getOrganisation_id();
    List<User> ul = orgManagement.getUsersByOrganisationId(orgId, 0, 9999, "login", true);
    assertTrue("Default Organisation should contain at least 1 user: " + ul.size(), ul.size() > 0);
   
    Organisation_Users ou = orgManagement.getOrganisation_UserByUserAndOrganisation(u.getUser_id(), orgId);
    assertNotNull("Unable to found [organisation, user] pair - [" + orgId + "," + u.getUser_id() + "]", ou);
  }
View Full Code Here

   * @param SID
   * @param USER_ID
   * @return - user with SID given
   */
  public User getUser(String SID, int USER_ID) {
    User users = new User();
    Long users_id = sessiondataDao.checkSession(SID);
    long user_level = userManager.getUserLevelByID(users_id);
    if (user_level > 2) {
      users = usersDao.get(new Long(USER_ID));
    } else {
      users.setFirstname("No rights to do this");
    }
    return users;
  }
View Full Code Here

    try {

      Client currentClient;
      IConnection current = Red5.getConnectionLocal();

      User o = null;

      currentClient = sessionManager.getClientByStreamId(current
          .getClient().getId(), null);

      o = userManager.loginUserByRemoteHash(SID, remoteHashId);

      if (o == null)
        return null;

      if (o.getOrganisation_users().isEmpty()) {
        throw new Exception("Users has no organization assigned");
      }

      o.setSessionData(sessiondataDao.getSessionByHash(remoteHashId));
      currentClient.setUser_id(o.getUser_id());
      SessionVariablesUtil.setUserId(current.getClient(), o.getUser_id());
     
      if (currentClient.getUser_id() != null
          && currentClient.getUser_id() > 0) {

        currentClient.setFirstname(o.getFirstname());
        currentClient.setLastname(o.getLastname());
       
        scopeApplicationAdapter.syncMessageToCurrentScope("roomConnect", currentClient, false);

      }
View Full Code Here

        storePermanent, language_id, ldapConfigId);

    if (returnValue instanceof Long) {
      return returnValue;
    } else if (returnValue instanceof User) {
      User us = (User) returnValue;
      if (authLevelUtil.checkUserLevel(
          us.getLevel_id())) {
        return us;
      } else {
        return -52L;
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.persistence.beans.user.User

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.