Package evolaris.framework.um.datamodel

Examples of evolaris.framework.um.datamodel.User


    }
    return false;
  }

  public static boolean amIInUserRole(long userId,long roleId,Session hibernateSession) {
    User u=findUser(userId, hibernateSession);
    Set<Role> roles=u.getRoles();
    for (Role role : roles) {
      if (role.getId()==roleId) return true;
    }
    return false;
  }
View Full Code Here


    String[] choosen = userSetAssociationListForm.getChoosen();
    Long[] userIds = userSetAssociationListForm.getUserId();   
    if (userIds != null) {
      UserManager userManager = new UserManager(locale,session);
      for (Long userId : userIds) {
        User user = userManager.getUserDetails(userId);
        checkAccessRights(req, user.getGroup());       
        if (Arrays.asList(choosen).contains(userId.toString())) {  // in list and checked
          userSet.getUsers().add(user);              // don't care if already there, as it's a set.
        } else {                          // in list and not checked
          userSet.getUsers().remove(user);            // remove from userset, don't mind if it's not there
        }
View Full Code Here

   */
  @Override
  public User toEntry(User user, Locale locale, Session session, MessageResources resources) {
    UserEnterOrEditForm f = this;
    if (user == null){
      user = new User();
    }
    user.setId(f.getId());
    GroupManager groupManager = new GroupManager(locale, session);
    Group group = groupManager.getGroup(f.getGroupId());
    user.setGroup(group);
View Full Code Here

            Session session = HibernateSessions.startTransaction(getClass(),group.getId(),group.getClientProject().getHibernateConfigurationFile());
            try {
              session.load(invocation,invocation.getId())// reload because from different session; this may actually fail if the invocation entry was deleted

              UserManager userManager = new UserManager(Locale.GERMAN,session);
              User user;
              EventParameters eventParameters = null;
              InteractionLogManager interactionLogManager = new InteractionLogManager(Locale.GERMAN, session);
              InteractionLog log = new InteractionLog();

              if(messageObject instanceof ReceivedSms) {
View Full Code Here

   * This could be implemented more generally but also more complicated with reflection.
   * @param user source user object
   * @return cloned user object
   */
  public static User clone(User user) {
    User newUser = new User();
    newUser.setUsername(user.getUsername());
    newUser.setPassword(user.getPassword());
    newUser.setTitle(user.getTitle());
    newUser.setFirstName(user.getFirstName());
    newUser.setLastName(user.getLastName());
    newUser.setPersonalNumber(user.getPersonalNumber());
    newUser.setCompany(user.getCompany());
    newUser.setAddress(user.getAddress());
    newUser.setPostalCode(user.getPostalCode());
    newUser.setCity(user.getCity());
    newUser.setState(user.getState());
    newUser.setEmail(user.getEmail());
    newUser.setFixedPhone(user.getFixedPhone());
    newUser.setMsisdn(user.getMsisdn());
    newUser.setOperator(user.getOperator());
    newUser.setMobilePhoneProducer(user.getMobilePhoneProducer());
    newUser.setBirthdate(user.getBirthdate());
    newUser.setLocale(user.getLocale());
    newUser.setUnlimitedRedemptions(user.getUnlimitedRedemptions());
    newUser.setGroup(user.getGroup());
    newUser.setCreationdate(user.getCreationdate());
    newUser.setEditedAt(user.getEditedAt());
    newUser.setGender(user.getGender());
    newUser.setSalutation(user.getSalutation());
    newUser.setCustomerNumber(user.getCustomerNumber());
    newUser.setConsultantName(user.getConsultantName());
    newUser.setConsultantOrganization(user.getConsultantOrganization());
    return newUser;
  }
View Full Code Here

   * @param user  source user
   * @param destinationGroup  group in which to create the new user set
   * @return  newly created user
   */
  public User duplicate(User user, Group destinationGroup){
    User newUser =clone(user);
    newUser.setCreationdate(new Date());
    newUser.setEditedAt(null);
    newUser.setGroup(destinationGroup);
    newUser.setUsername(null);
    newUser.setPassword(null);
    createUser(newUser);
    return newUser;
  }
View Full Code Here

    Criteria crit  = session.createCriteria(User.class);
    crit.add(Restrictions.eq("msisdn",msisdn));
    crit.add(Restrictions.eq("group",group));
    crit.addOrder(Order.desc("editedAt"));
    crit.setMaxResults(1);
    User user = (User)crit.uniqueResult();

    return user;
  }
View Full Code Here

    crit.add(Restrictions.eq("customerNumber",customerNumber));
    crit.add(Restrictions.eq("group",group));
    crit.addOrder(Order.desc("editedAt"));
    crit.setMaxResults(1);
   
    User result = (User)crit.uniqueResult();
    return result;
  }
View Full Code Here

    crit.add(Restrictions.eq("personalNumber",personalNumber));
    crit.add(Restrictions.eq("group",group));
    crit.addOrder(Order.desc("editedAt"));
    crit.setMaxResults(1);
   
    User result = (User)crit.uniqueResult();
    return result;
 
View Full Code Here

   * @param operator operator; may be null
   * @param group  the group within which to search and create
   * @return  existing or newly created user
   */
  public User registerUserByMsisdn(long msisdn, String operator, Group group){
    User user = getUserDetails(msisdn,group);
    if (user == null){
      LOGGER.info("the user with the msisdn: " + msisdn + " is not registered for group: " + group.getGroupname() + " and will therefore be created.");
      user = new User();
      user.setGroup(group);
      user.setMsisdn(msisdn);
      user.setOperator(operator);
      user.setCreationdate(new Date(System.currentTimeMillis()));
      session.save(user);
    } else if (operator != null){
      user.setOperator(operator);
      session.save(user);
    }
    return user;
  }
View Full Code Here

TOP

Related Classes of evolaris.framework.um.datamodel.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.