Package net.sf.esims.model.entity

Examples of net.sf.esims.model.entity.User


      List listOfUsers = this.getSession().createCriteria(User.class)
      .add(Expression.like("userName", userName))
      .add(Expression.like("userPassword", password))
      .list();
      if(listOfUsers.size()!=0){
        User u = (User)listOfUsers.get(0);
        UserCredential credentials = new UserCredential();
        credentials.setUser(u);
        return credentials;
      }
      else{
View Full Code Here


      // Makes sure that the new password is confirmed correctly
      if (!this.newPassword1.equals(this.newPassword2))
        message = EsimsUtils.createWarnMessage(this.getContext()
            .getContextPath(), "The New passwords you provided do not match");
      else if (this.newPassword1.equals(this.newPassword2)) {
        User user = this.userManagerService.getUserById(new Long(this
            .getContext().getRequest().getParameter("userId")));
        user.setUserPassword(this.newPassword1);
        this.userManagerService.saveUser(user);
        message = EsimsUtils.createWarnMessage(this.getContext()
            .getContextPath(),
            "The password has been changed succesfully");
      }
View Full Code Here

  public Resolution createUser(){
    Role roleToBeAssigned = this.userManagerService.getRole(role);
    String userName = userManagerService.createUserName(this.firstName, this.lastName);
    String password = userManagerService.createPassWord(userName);
    String message=EsimsConstants._BLANK_STRING ;
    user = new User(roleToBeAssigned,userName,password,this.firstName,this.middleName,this.lastName,this.gender);
    this.userManagerService.saveUser(user);
    //Displaying the password too
    message= EsimsUtils.createInfoMessage(this.getContext().getContextPath(), "User named <strong>" + userName + "</strong> was created succesfully");
    message += "<br>&nbsp;The password is <strong>"+password+"</strong>";
    FlashScope.getCurrent(this.getContext().getRequest(),true).put("message", message);
View Full Code Here

   
    List<Role> listOfRoles = roleDAO.getByQuery(_HQL_GET_ADMIN_ROLE);
    assertEquals(1, listOfRoles.size());
    Role role = listOfRoles.get(0);
   
    user1 = new User(role,"jvictor","test123","Juby",null,"Victor","M");
    //role.getUsersForRole().add(user1);
    userDAO.save(user1);
   
   
    DatabaseOperation.DELETE_ALL.execute(conxn, userDataSet);
View Full Code Here

   
    List<Role> listOfRoles = roleDAO.getByQuery(_HQL_GET_ADMIN_ROLE);
    assertEquals(1, listOfRoles.size());
    Role role = listOfRoles.get(0);
   
    user1 = new User(role,"jvictor","test123","Juby",null,"Victor","M");
    //role.getUsersForRole().add(user1);
    userDAO.save(user1);
   
    List<User> user = userDAO.getAll();
    assertEquals(1, user.size());
View Full Code Here

   
    List<Role> listOfRoles = roleDAO.getByQuery(_HQL_GET_ADMIN_ROLE);
    assertEquals(1, listOfRoles.size());
    Role role = listOfRoles.get(0);
   
    user1 = new User(role,"juby.victor1","test123","Juby",null,"Victor","M");
    userDAO.save(user1);
    user2 = new User(role,"juby.victor2","test123","Juby",null,"Victor","M");
    userDAO.save(user2);
   
    List<User> users = userDAO.getByName("Juby", "Victor");
    assertTrue("Found "+users.size(),users.size()>0);
    DatabaseOperation.DELETE_ALL.execute(conxn, userDataSet);
View Full Code Here

 
    DatabaseOperation.DELETE_ALL.execute(connection, userDataSet);
    DatabaseOperation.DELETE_ALL.execute(connection, rolesDataSet);
    Role testRole = new Role(EsimsConstants._ADMIN_ROLE);
    this.roleDAO.save(testRole);
    User user = new User(testRole,"admin","test123","FirstName","MiddleName","LastName","M");
    this.userDAO.save(user);
    UserCredential credential = this.loginDAO.getUserCredentials("admin", "test123");
    assertNotNull(credential);
    assertEquals("admin", credential.getUserName());
    DatabaseOperation.DELETE_ALL.execute(connection, userDataSet);
View Full Code Here

TOP

Related Classes of net.sf.esims.model.entity.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.