Package org.sete.domain

Examples of org.sete.domain.SeteUser


    }
      return userRoles;
    }
   
    public SeteUserVo loadSeteUser(String creator) {
        SeteUser su = userDao.findById(Integer.valueOf(creator));
        return this.makeUserVo(su);
    }
View Full Code Here


    
      return vo;
    }
   
    public SeteUserVo getSeteUser(String userId, boolean forDisplay) {
        SeteUser su = userDao.findById(Integer.valueOf(userId));
        SeteUserVo vo = new SeteUserVo();
        if(su != null){
          vo = this.makeUserVo(su);
          vo.setUserRoles(this.extractUserRoles(new ArrayList<UserRolePrivilege> (su.getUserRolePrivileges()), forDisplay));
        } else {
          final String msg = "Invalid SeteUser [id=" + userId + "] " +
      "submitted for update, operation aborted.";

      if(log.isErrorEnabled()) {
View Full Code Here

        }
        return vo;
    }
   
    public boolean deleteSeteUser(String userId){
      SeteUser su = userDao.findById(Integer.valueOf(userId));
      if(su == null){       
      final String msg = "Invalid SeteUser [id=" + userId + "] " +
      "submitted for deletion, operation aborted.";

      if(log.isErrorEnabled()) {
View Full Code Here

        validateUser(vo);

        final Set<UserRolePrivilege> rolePrivs = buildUserRolePrivileges(vo);

        final SeteUser su = createSeteUser(vo);
        su.setUserRolePrivileges(rolePrivs);

        seteUserDao.saveSeteUser(su);

    }
View Full Code Here

    public void updateSeteUser(CreateSeteUserVo vo){
       if(vo == null) {
        throw new IllegalArgumentException("Cannot update a null SeteUser.");
      }

        SeteUser su = userDao.findByLoginName(vo.getLoginName());

       if(vo.getUserRoles().length < 1){
        BusinessRuleException bre = new BusinessRuleException();
        bre.addCodedMessage("seteUser.NoRolesSelected", new String[]{vo.getLoginName()});
        throw bre;
      }
     
      su.setFirstName(vo.getFirstName());
      su.setMiddleName(vo.getMiddleName());
      su.setLastName(vo.getLastName());
      final Set<UserRolePrivilege> rolePrivs = buildUserRolePrivileges(vo);
      su.setUserRolePrivileges(rolePrivs);     

        seteUserDao.saveSeteUser(su);
    }
View Full Code Here

     * @return SeteUser - A seteUser Object.
     *
     * @throws DataAccessException thrown if fields of viewObject cannot be accessed.
     */
    private SeteUser createSeteUser(CreateSeteUserVo vo) throws DataAccessException {
      SeteUser su = new SeteUser();
      su.setFirstName(vo.getFirstName());
      su.setMiddleName(vo.getMiddleName());
      su.setLastName(vo.getLastName());

      su.setLoginName(vo.getLoginName());
      su.setPassword(passwordEncoder.encodePassword(vo.getPassword(), null));

      return su;
    }
View Full Code Here

   * Test method for {@link org.sete.service.admin.SeteUserProfileServiceImpl#createNewSeteUserProfile(org.sete.vo.admin.CreateSeteUserProfileVo)}.
   */
  @Test
  public void testCreateNewSeteUserProfile() {

    aSeteUser = new SeteUser();
    aSeteUser.setId(1);
    csupvo = new CreateSeteUserProfileVo();
       
        // user form input from browser
        csupvo.setEmailAddress("nmallic2@uiuc.edu");
View Full Code Here

   * Test method for {@link org.sete.service.admin.SeteUserProfileServiceImpl#editSeteUserProfile(org.sete.vo.admin.CreateSeteUserProfileVo)}.
   */
  @Test
  public void testEditSeteUserProfile() {

    aSeteUser = new SeteUser();
    aSeteUser.setId(1);
    csupvo = new CreateSeteUserProfileVo();
    csupvo.setCreator("1");
    csupvo.setAddress("new address");
      csupvo.setEmailAddress("nevedita@uiuc.edu");
View Full Code Here

  public void testLoadSeteUser(){
    ContactInformation ci = new ContactInformation();
    ci.setAddress("test address");
    ci.setEmailAddress("nm@xyz.edu");
    ci.setPhoneNumber("908-720-7643");
    aSeteUser = new SeteUser();
    aSeteUser.setId(1);
    aSeteUser.setFirstName("nevedita");
    aSeteUser.setLastName("mallick");
    aSeteUser.setContactInformation(ci);
    aSeteUser.setLoginName("nm");
View Full Code Here

          BusinessRuleException bre = new BusinessRuleException();
          bre.addCodedMessage("seteUser.EmailAlreadyExists", new String[]{vo.getEmailAddress()});
          throw bre;
        }

        SeteUser su = new SeteUser();
        su.setFirstName(vo.getFirstName());
        su.setMiddleName(vo.getMiddleName());
        su.setLastName(vo.getLastName());

        //do dob
        SimpleDateFormat sim = new SimpleDateFormat("MM/dd/yyyy");
        java.util.Date date = new java.util.Date();
         try{
             date = sim.parse(vo.getDateOfBirth());
             su.setDateOfBirth(date);
        }
        catch(ParseException pe)
        {
          System.err.println("Invalid date recieved "+vo.getDateOfBirth());
        }

        su.setLoginName(vo.getLoginName());
        su.setPassword(passwordEncoder.encodePassword(vo.getPassword(), null));

        //contactInformation
        ContactInformation ci = new ContactInformation();
        ci.setAddress(vo.getAddress());
        ci.setEmailAddress(vo.getEmailAddress());
        ci.setPhoneNumber( vo.getPhoneNumber());
        su.setContactInformation(ci);


        //massage UserPrivilegeType
        /* Contains all sets of Roles privilege/action mappings for User*/
        Set<UserRolePrivilege> rolePrivs = new HashSet<UserRolePrivilege>();

        /* Contains instance of Role and associated privilege/action mapping */
        UserRolePrivilege p = new UserRolePrivilege();

        p.setUserRoleType(TypeUtil.forKey(UserRoleType.class, vo.getUserRole()));

        Set<UserPrivilege> privs = new HashSet<UserPrivilege>();
        UserPrivilege up = null;
        for(String pk: vo.getUserRolePrivileges())
        {
          up = new UserPrivilege();
          up.setUserPrivilegeType(TypeUtil.forKey(UserPrivilegeType.class, pk));
          up.setPrivilegeActionType(TypeUtil.forKey(PrivilegeActionType.class, PrivilegeActionType.READ));
          privs.add(up);
        }

        p.setUserPrivileges(privs);

        rolePrivs.add(p);

        su.setUserRolePrivileges(rolePrivs);

        seteUserDao.saveSeteUser(su);

    }
View Full Code Here

TOP

Related Classes of org.sete.domain.SeteUser

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.