Package org.sete.domain

Examples of org.sete.domain.SeteUser


        }
        return file;
    }
   
    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;
        if(projects == null || projects.isEmpty()){
View Full Code Here


  public ScienceProjectVo loadScienceProjectByStudentUserId(Integer userId) {
    if(userId == null){
      throw new IllegalArgumentException("UserId cannot be null.");     
    }
    else{
      SeteUser student = userDao.findById(userId);
      ScienceProject p = projectDao.findBy(student);
            if(p == null){
                return null;
            }
      ScienceProjectVo vo = new ScienceProjectVo();
View Full Code Here

  } catch (IOException e) {
    e.printStackTrace();
  }
 
  //determine the student uploading the file
  SeteUser student = userDao.findById(ufvo.getUserId());
 
  //get the student's project for update
  ScienceProject project = projectDao.findBy(student);
 
  /*Get the existing project forms,
View Full Code Here

        }
        return file;
    }
   
    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;
        if(projects == null || projects.isEmpty()){
View Full Code Here

    }
    return Boolean.TRUE;
  }
 
  public Boolean isStudentInProject(Integer userId, String projectId) {
    SeteUser su = userDao.findById(Integer.valueOf(userId));
    if(projectDao.findById(projectId).getStudents().contains(su)){
      return Boolean.TRUE;
    } else {
      return Boolean.FALSE;
    }
View Full Code Here

      BusinessRuleException bre = new BusinessRuleException();
       if(vo == null) {
        throw new IllegalArgumentException("Cannot update a null ScienceProject.");
      }
       if(StringUtils.isNotBlank(vo.getCreator())) {
         SeteUser creator = userDao.findById(Integer.valueOf(vo.getCreator()));
         if( projectDao.isStudentInAnotherProject(Integer.valueOf(vo.getCreator())) &&
           !(projectDao.findBy(creator).getIdAsString().equals(vo.getProjId())) ){
           bre.addCodedMessage("scienceProject.error.student.already.projectMember",
                        new String[]{creator.getFirstName() + " " + creator.getLastName()});
           throw bre;
         }
       }
       if(StringUtils.isNotBlank(vo.getPartner())){
         SeteUser partner = userDao.findById(Integer.valueOf(vo.getPartner()));
         if( projectDao.isStudentInAnotherProject(Integer.valueOf(vo.getPartner())) &&
           !(projectDao.findBy(partner).getIdAsString().equals(vo.getProjId())) ){
           bre.addCodedMessage("scienceProject.error.student.already.projectMember",
                        new String[]{partner.getFirstName() + " " + partner.getLastName()});
           throw bre;
         }        
       }
        
       if(StringUtils.isNotBlank(vo.getPartner()) &&
View Full Code Here

    if(userId == null){
      throw new IllegalArgumentException("UserId cannot be null.");     
    }
    else{
      System.out.println("\nUser ID is: "+userId+"\n");
      SeteUser student = userDao.findById(userId);
      ScienceProject p = projectDao.findBy(student);
            if(p == null){
                return null;
            }
      ScienceProjectVo vo = new ScienceProjectVo();
View Full Code Here

  } catch (IOException e) {
    e.printStackTrace();
  }
 
  //determine the student uploading the file
  SeteUser student = userDao.findById(ufvo.getUserId());
 
  //get the student's project for update
  ScienceProject project = projectDao.findBy(student);
 
  /*Get the existing project forms,
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

        CreateScienceProjectVo cspVo = new CreateScienceProjectVo();
        cspVo.setCreator("1");
        cspVo.setSponsor("3");
        cspVo.setCategory("physics");

        SeteUser creator = new SeteUser();
        creator.setId(Integer.valueOf(cspVo.getCreator()));

        SeteUser sponsor = new SeteUser();
        sponsor.setId(Integer.valueOf(cspVo.getSponsor()));

        EasyMock.expect(mockScienceProjectDao.isStudentInAnotherProject(
                                    Integer.valueOf(cspVo.getCreator()))).andReturn(Boolean.FALSE);

        EasyMock.expect(mockUserDao.findById(Integer.valueOf(cspVo.getCreator()))).andReturn(creator);
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.