Package org.sete.domain

Examples of org.sete.domain.SeteUser


       
        sponsor1.setId(sponsor1ID);
        project1.setSponsor(sponsor1);
        project1.setScienceProjectCategoryType(t);
        HashSet<SeteUser> students1 = new HashSet<SeteUser>();
        final SeteUser student1 = new SeteUser();
        students1.add(student1);
        project1.setStudents(students1);
       
        sponsor2.setId(sponsor2ID);
        project2.setSponsor(sponsor2);
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

        ScienceProjectIdeaVo vo = new ScienceProjectIdeaVo();
        vo.setProjectIdeaId(su.getIdAsString());
        vo.setDescription(su.getDescription());
        if(forDisplay){
            vo.setProjectCategoryType(su.getScienceProjectCategoryType().getLabel());
            SeteUser suggestor = su.getSuggestor();
            vo.setSuggestor(suggestor.getFirstName()+" "+suggestor.getLastName());
        }
        else{
            vo.setProjectCategoryType(su.getScienceProjectCategoryType().getKey());
            vo.setSuggestor(su.getSuggestor().getIdAsString());
        }
View Full Code Here

        return userVos;
    }

    public SeteUserVo loadSeteUser(String creator) {
        SeteUser su = userDao.findById(Integer.valueOf(creator));
        SeteUserVo vo = new SeteUserVo();

        vo.setFirstName(su.getFirstName());
        vo.setMiddleName(su.getMiddleName());
        vo.setLastName(su.getLastName());
        vo.setLoginName(su.getLoginName());
        vo.setAddress(su.getContactInformation().getAddress());
        vo.setEmailAddress(su.getContactInformation().getEmailAddress());
        vo.setPhoneNumber(su.getContactInformation().getPhoneNumber());

        return vo;
    }
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

     * @param vo
     * @return
     * @throws DataAccessException
     */
    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

      final int seteUserId = 1;
     
      @Override
      protected void setUp() throws Exception {
          super.setUp();
          aSeteUser = new SeteUser();
          csupvo = new ChangeSeteUserPasswordVo();
          aSeteUser.setId(seteUserId);
         
          // user form input from browser
          csupvo.setOldPassword("sete");
View Full Code Here

        this.passwordEncoder = passwordEncoder;
    }

    public void createNewSeteUserProfile(CreateSeteUserProfileVo csupvo) {

        SeteUser su = userDao.findById(Integer.valueOf(csupvo.getCreator())) ;

        // 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));

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

        seteUserDao.saveSeteUser(su);

    }
View Full Code Here

    @Test
    public void testCreateSeteUserBRE1(){
       
      initTestParams();
     
        expect(userDao.findByLoginName(csuvo.getLoginName())).andStubReturn(new SeteUser());
        replay(userDao);
       
        try{
          service.createNewSeteUser(csuvo);
        }
View Full Code Here

        csuvo.setLoginName("Johnny");
        csuvo.setPassword("sete");
        final String [] roles = new String []{"Student"};
        csuvo.setUserRoles(roles);
       
        testUser = new SeteUser();
        testUser.setFirstName("Johnny");
        testUser.setLastName("Mohseni");
        testUser.setLoginName("Johnny");
        testUser.setPassword("sete");
        Set<UserRolePrivilege> urps = new HashSet<UserRolePrivilege>();
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.