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

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


      currentClient.setUsercolor(colorObj);

      // Inject externalUserId if nothing is set yet
      if (currentClient.getExternalUserId() == null) {
        if (currentClient.getUser_id() != null) {
          User us = usersDao.get(currentClient.getUser_id());
          if (us != null) {
            currentClient.setExternalUserId(us.getExternalUserId());
            currentClient.setExternalUserType(us.getExternalUserType());
          }
        }
      }

      // This can be set without checking for Moderation Flag
View Full Code Here


      // only fill this value from User-Record
      // cause invited users have no associated User, so
      // you cannot set the firstname,lastname from the UserRecord
      if (userId != null) {
        User us = usersDao.get(userId);
       
        if (us != null) {
          currentClient.setExternalUserId(us.getExternalUserId());
          currentClient.setExternalUserType(us.getExternalUserType());
        }
        if (us != null && us.getPictureuri() != null) {
          // set Picture-URI
          currentClient.setPicture_uri(us.getPictureuri());
        }
      }
      this.sessionManager.updateClientByStreamId(streamid,
          currentClient, false, null);
      return currentClient;
View Full Code Here

    return entity;
  }

  public void delete(Organisation_Users entity, Long userId) {
    if (entity.getOrganisation_users_id() != null) {
      User u = usersDao.get(entity.getUser_id());
      int idx = u.getOrganisation_users().indexOf(entity);
      //entity has been detached need to re-fetch
      Organisation_Users ou = u.getOrganisation_users().remove(idx);
      em.remove(ou);
      usersDao.update(u, userId);
    }
  }
View Full Code Here

      // Update Session Data
      log.debug("UDPATE SESSION " + SID + ", " + userId);
      sessiondataDao.updateUserWithoutSession(SID, userId);

      User user = userManager.getUserById(userId);

      if (user != null) {
        currentClient.setExternalUserId(user.getExternalUserId());
        currentClient.setExternalUserType(user.getExternalUserType());
      }

      // only fill this value from User-Record
      // cause invited users have non
      // you cannot set the firstname,lastname from the UserRecord
      User us = usersDao.get(userId);
      if (us != null && us.getPictureuri() != null) {
        // set Picture-URI
        currentClient.setPicture_uri(us.getPictureuri());
      }
      this.sessionManager.updateClientByStreamId(streamid,
          currentClient, false, null);
      return currentClient;
    } catch (Exception err) {
View Full Code Here

            .generateThumb("_profile_", completeName, 126));
        returnError.addItem("processThumb3", generateThumbs
            .generateThumb("_big_", completeName, 240));

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

        //FIXME: After updating the picture url all other users should refresh
      } else {
        returnError.addItem("processThumb", generateThumbs
View Full Code Here

  @Test
  public void testTestLogin(){
    Sessiondata sessionData = mService.getsessiondata();
   
    User us = (User) userManager.loginUser(sessionData.getSession_id(), username, userpass, null, null, false);
   
    assertNotNull("User is unable to login", us);
   
    //mService.getLanguageById(1);
   
View Full Code Here

      private static final long serialVersionUID = 8715559628755439596L;

      @Override
      protected void populateItem(Item<Organisation_Users> item) {
        final Organisation_Users orgUser = item.getModelObject();
        User u = orgUser.getUser();
        if (u != null) {
          item.add(new Label("label", Model.of(getUser(u))));
        } else {
          item.add(new Label("label", Model.of("")));
        }
View Full Code Here

      try {
        TypedQuery<User> query = em.createNamedQuery("getUserById",
            User.class);
        query.setParameter("user_id", user_id);

        User users = null;
        try {
          users = query.getSingleResult();
        } catch (NoResultException ex) {
        }
        return users;
View Full Code Here

  }

  public Long deleteUserID(long userId) {
    try {
      if (userId != 0) {
        User us = get(userId);
        us.setDeleted(true);
        us.setUpdatetime(new Date());
        us.setSipUser(null);
        Address adr = us.getAdresses();
        if (adr != null) {
          adr.setDeleted(true);
        }

        if (us.getUser_id() == null) {
          em.persist(us);
        } else {
          if (!em.contains(us)) {
            em.merge(us);
          }
        }
        return us.getUser_id();
      }
    } catch (Exception ex2) {
      log.error("[deleteUserID]", ex2);
    }
    return null;
View Full Code Here

      long language_id, boolean emptyPass, String userpass, Address address, Date age,
      String hash, String externalUserId, String externalUserType,
      boolean generateSipUserData, String email, String jNameTimeZone,
      String pictureuri) {
    try {
      User users = new User();
      users.setFirstname(firstname);
      users.setLogin(login);
      users.setLastname(lastname);
      users.setAge(age);

      if (address != null) {
        users.setAdresses(address);
      } else {
        users.setAdresses("", "", "", statemanagement.getStateById(1L), "",
            "", "", "", email);
      }

      users.setAvailible(availible);
      users.setLastlogin(new Date());
      users.setLasttrans(new Long(0));
      users.setLevel_id(level_id);
      users.setStatus(status);
      users.setSalutations_id(1L);
      users.setStarttime(new Date());
      users.setActivatehash(hash);
      users.setPictureuri(pictureuri);
      users.setOmTimeZone(omTimeZoneDaoImpl.getOmTimeZone(jNameTimeZone));

      users.setExternalUserId(externalUserId);
      users.setExternalUserType(externalUserType);

      // this is needed cause the language is not a needed data at
      // registering
      if (language_id != 0) {
        users.setLanguage_id(new Long(language_id));
      } else {
        users.setLanguage_id(null);
      }
      users.updatePassword(cryptManager, configurationDao, userpass, emptyPass);
      users.setRegdate(new Date());
      users.setDeleted(false);

      em.persist(users);

      em.refresh(users);

      // em.flush();

      long user_id = users.getUser_id();

      return user_id;

    } catch (Exception ex2) {
      log.error("[registerUser]", ex2);
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.