Package org.sete.domain

Examples of org.sete.domain.SeteUser


    /*
     * @see org.sete.service.admin.SeteUserProfileService#createNewSeteUserProfile(org.sete.vo.admin.CreateSeteUserProfileVo)
     */
    public void createNewSeteUserProfile(CreateSeteUserProfileVo csupvo) {

        SeteUser su = userDao.findById(Integer.valueOf(csupvo.getCreator())) ;
     
        //contactInformation
        ContactInformation ci = new ContactInformation();
        ci.setAddress(csupvo.getAddress());
        ci.setEmailAddress(csupvo.getEmailAddress());
        ci.setPhoneNumber( csupvo.getPhoneNumber());
        su.setContactInformation(ci);
       
        try{
        seteUserDao.saveSeteUser(su);
        }
        catch(Exception e){
View Full Code Here


    /*
     * @see org.sete.service.admin.SeteUserProfileService#editSeteUserProfile(org.sete.vo.admin.CreateSeteUserProfileVo)
     */
    public void editSeteUserProfile(CreateSeteUserProfileVo csupvo) {

        SeteUser su = userDao.findById(Integer.valueOf(csupvo.getCreator())) ;
       
        //contactInformation
        ContactInformation ci = new ContactInformation();
        ci.setAddress(csupvo.getAddress());
        ci.setEmailAddress(csupvo.getEmailAddress());
        ci.setPhoneNumber( csupvo.getPhoneNumber());
        su.setContactInformation(ci);

        try{
            seteUserDao.saveSeteUser(su);
            }
            catch(Exception e){
View Full Code Here

              }
             }
    }

    public void resetPassword(AuthenticatedUserVo userVo, String clearPassword) {
        SeteUser su = userDao.findById(userVo.getUserId());       
        su.setPassword(passwordEncoder.encodePassword(clearPassword, null));
        seteUserDao.saveSeteUser(su);
    }
View Full Code Here

     *
     * @see org.sete.service.admin.SeteUserProfileService#changeSeteUserPassword(org.sete.vo.admin.ChangeSeteUserPasswordVo)
     */
    public void changeSeteUserPassword(ChangeSeteUserPasswordVo csupvo){
     
      SeteUser su = userDao.findById(Integer.valueOf(csupvo.getUserId())) ;

        // old password validation
        String oldPassword = su.getPassword() ;
        String userFormOldPassword = passwordEncoder.encodePassword(csupvo.getOldPassword(), null) ;
        if(!oldPassword.equals(userFormOldPassword))
        {
          BusinessRuleException bre = new BusinessRuleException();
      bre.addCodedMessage("seteUser.OldPasswordInvalid");
      throw bre;
        }

        // new password
        su.setPassword(passwordEncoder.encodePassword(csupvo.getNewPassword(), null));

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

    }

    private void createUser(String fn, String mn, String ln, String addr, String pn, String eaddr,
                            Set<UserRolePrivilege> rolePrivs) {

        SeteUser user = new SeteUser();
        user.setFirstName(fn);
        user.setMiddleName(mn);
        user.setLastName(ln);
        user.setDateOfBirth(new Date());
        user.setLoginName(fn);
        user.setPassword(passwordEncoder.encodePassword("sete", null));

        ContactInformation ci = new ContactInformation();
        ci.setAddress(addr);
        ci.setEmailAddress(eaddr);
        ci.setPhoneNumber(pn);
        user.setContactInformation(ci);

        user.setUserRolePrivileges(rolePrivs);
        baseDao.saveOrUpdate(user);
    }
View Full Code Here

        return projectVos;
    }
   
    public List<ScienceProjectVo> loadAllScienceProjectsSponsoredBy(int sponsorID) {
        SeteUser sponsor = userDao.findById(sponsorID);
        List<ScienceProject> projects = projectDao.findSponsoredBy(sponsor);
        List<ScienceProjectVo> projectVos = new ArrayList<ScienceProjectVo>();
        ScienceProjectVo vo = null;
        List<String> students = null;
        for(ScienceProject sp : projects) {
View Full Code Here

        userDao = createMock(UserDao.class);
        service = new SeteUserServiceImpl();
             
        //setup some data
        seteUsers = new ArrayList<SeteUser>();
        SeteUser user1 = new SeteUser();
        user1.setFirstName("Johnny");
        user1.setLastName("Mohseni");
        user1.setLoginName("Johnny");
        user1.setPassword("sete");
        Set<UserRolePrivilege> urps = new HashSet<UserRolePrivilege>();
        UserRolePrivilege urp = new UserRolePrivilege();
        urp.setUserRoleType(TypeUtil.forKey(UserRoleType.class, "student"));
        urps.add(urp);
        user1.setUserRolePrivileges(urps);
              
        SeteUser user2 = new SeteUser();
        user2.setFirstName("Jason");
        user2.setLastName("Clow");
        user2.setLoginName("Jason");
        user2.setPassword("sete");
        user2.setUserRolePrivileges(urps);
       
        seteUsers.add(user1);
        seteUsers.add(user2);       

        //set "mocked" dao Object that talks to database
View Full Code Here

        if(users.size() != 1) {
            throw new IllegalStateException("User with [login=" + loginName + "] was not found.");
        }

        SeteUser su = users.get(0);
        AuthenticatedUserVo vo = new AuthenticatedUserVo();

        vo.setFirstName(su.getFirstName());
        vo.setLastName(su.getLastName());
        vo.setLoginName(su.getLoginName());
        vo.setMiddleName(su.getMiddleName());
        vo.setUserId(su.getId());

        List<UserRolePrivilegeVo> pVos = new ArrayList<UserRolePrivilegeVo>();
        UserRolePrivilegeVo pVo = null;
        List<UserPrivilegeVo> upVos = null;
        UserPrivilegeVo upVo = null;
        for(UserRolePrivilege p : su.getUserRolePrivileges()) {
            pVo = new UserRolePrivilegeVo();
            pVo.setRoleType(p.getUserRoleType());

            upVos = new ArrayList<UserPrivilegeVo>();
            for(UserPrivilege up : p.getUserPrivileges()) {
View Full Code Here

    spi.setTitle(vo.getTitle());
    spi.setDescription(vo.getDescription());
    spi.setScienceProjectCategoryType(TypeUtil.forKey(
        ScienceProjectCategoryType.class, vo.getProjectCategoryType()));
    //suggestor is set to the Authenticated User
    SeteUser suggestor = userDao.findByLoginName(vo.getSuggestor());
    spi.setSuggestor(suggestor);
    projectIdeaDao.saveScienceProjectIdea(spi);
  }
View Full Code Here

    }

    private void createUser(String fn, String mn, String ln, String addr, String pn, String eaddr,
                            Set<UserRolePrivilege> rolePrivs) {

        SeteUser user = new SeteUser();
        user.setFirstName(fn);
        user.setMiddleName(mn);
        user.setLastName(ln);
        user.setDateOfBirth(new Date());
        user.setLoginName(fn);
        user.setPassword(passwordEncoder.encodePassword("sete", null));

        ContactInformation ci = new ContactInformation();
        ci.setAddress(addr);
        ci.setEmailAddress(eaddr);
        ci.setPhoneNumber(pn);
        user.setContactInformation(ci);

        user.setUserRolePrivileges(rolePrivs);
        baseDao.saveOrUpdate(user);
    }
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.