Package org.sete.vo.project

Examples of org.sete.vo.project.ScienceProjectVo



    public List<ScienceProjectVo> loadAllScienceProjects() {
        List<ScienceProject> projects = projectDao.getAllScienceProjects();
        List<ScienceProjectVo> projectVos = new ArrayList<ScienceProjectVo>();
        ScienceProjectVo vo = null;
        List<String> students = null;

        for(ScienceProject sp : projects) {
            vo = new ScienceProjectVo();
            students = new ArrayList<String>();
           
            vo.setId(sp.getId());
            vo.setName(sp.getName());
            vo.setDescription(sp.getDescription());
            vo.setExhibitId(sp.getExhibitIdentifier());
            vo.setCategory(sp.getScienceProjectCategoryType().getLabel());

            for(SeteUser u : sp.getStudents()) {
                students.add(u.getFirstName() + " " + u.getLastName());
            }
            vo.setStudents(students);

            if(sp.getSponsor() != null) {
                vo.setSponsor(sp.getSponsor().getFirstName() + " " + sp.getSponsor().getLastName());
            }

            projectVos.add(vo);
        }
View Full Code Here


   
    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()){
            return projectVos;
        }
        for(ScienceProject sp : projects) {
            vo = new ScienceProjectVo();
            students = new ArrayList<String>();
            vo.setId(sp.getId());
            vo.setName(sp.getName());
            vo.setDescription(sp.getDescription());
            vo.setExhibitId(sp.getExhibitIdentifier());
            vo.setCategory(sp.getScienceProjectCategoryType().getLabel());

            for(SeteUser u : sp.getStudents()) {
                students.add(u.getFirstName() + " " + u.getLastName());
            }
            vo.setStudents(students);

            projectVos.add(vo);
        }

        return projectVos;
View Full Code Here

      SeteUser student = userDao.findById(userId);
      ScienceProject p = projectDao.findBy(student);
            if(p == null){
                return null;
            }
      ScienceProjectVo vo = new ScienceProjectVo();
      List<AttachmentVo> files = new ArrayList<AttachmentVo>();
      List<String> partner = new ArrayList<String>();
            vo.setId(p.getId());
      vo.setName(p.getName());
      vo.setDescription(p.getDescription());
      vo.setCategory(p.getScienceProjectCategoryType().getLabel());
      vo.setSponsor(p.getSponsor().getFirstName()+" "+p.getSponsor().getLastName());
           
      for(Attachment a: p.getForms()){
                AttachmentVo avo = new AttachmentVo();
                avo.setId(a.getId());
                avo.setType(a.getType());
                files.add(avo);
            }
      vo.setFiles(files);
     
            for(SeteUser a: p.getStudents()){
              //add the Student Partner to the ProjectVo
                if(a.getId() != userId){                
                  partner.add(a.getFirstName()+" "+a.getLastName());
                }
            }
            //Add a message if there is no student partner.
            if(partner.size()< 1)
              partner.add("No partner selected");
           
            vo.setStudents(partner);
      return vo;
    }
   
  }
View Full Code Here

    expect(spDaoMock.findBy(studentA)).andReturn(project);
    replay(spDaoMock);

    // test it
    ScienceProjectVo spVo = service
        .loadScienceProjectByStudentUserId(studentAId);

    assert (spVo != null);
    assertEquals(spVo.getCategory(), "cs");
  }
View Full Code Here

    expect(spDaoMock.findBy(studentB)).andReturn(null);
    replay(spDaoMock);

    // test it
    ScienceProjectVo spVo = service
        .loadScienceProjectByStudentUserId(studentBId);

    assert (spVo == null);
    // assertEquals(spVo.getCategory(), "cs");
  }
View Full Code Here

    expect(spDaoMock.findBy(sponsor)).andReturn(null);
    replay(spDaoMock);

    // test it
    ScienceProjectVo spVo = service
        .loadScienceProjectByStudentUserId(sponsorId);

    assert (spVo == null);
    // assertEquals(spVo.getCategory(), "cs");
  }
View Full Code Here

       
        checkAuthorization(userHasPrivilege(request.getSession(), getPrivileges()));
        ScoreProjectService service = getService(ScoreProjectService.class);
        ViewProjectsToScoreVo vptsvo = new ViewProjectsToScoreVo();
        BeanUtils.copyProperties(vptsvo, form);
        ScienceProjectVo projectVo = service.loadScienceProject(vptsvo.getProjectId());
        request.setAttribute("project", projectVo);
        request.setAttribute("projectId", vptsvo.getProjectId());
        request.setAttribute("projectName", projectVo.getName());
       
        return mapping.findForward(WebConstants.FORWARD_VIEW);
       
    }
View Full Code Here

        }
        else{
            displaySuccessMessage(request,"scienceProject.award.remove.error",success);
        }
       
        ScienceProjectVo projectVo = service.loadScienceProject(projectId);
        request.setAttribute("project", projectVo);
        request.setAttribute("projectId", projectId);
        request.setAttribute("projectName", projectVo.getName());
       
        return mapping.findForward(WebConstants.FORWARD_VIEW);
       
    }
View Full Code Here


    public List<ScienceProjectVo> loadAllScienceProjects() {
        List<ScienceProject> projects = projectDao.getAllScienceProjects();
        List<ScienceProjectVo> projectVos = new ArrayList<ScienceProjectVo>();
        ScienceProjectVo vo = null;
        List<String> students = null;

        for(ScienceProject sp : projects) {
            vo = new ScienceProjectVo();
            students = new ArrayList<String>();
           
            vo.setId(sp.getId());
            vo.setName(sp.getName());
            vo.setDescription(sp.getDescription());
            vo.setExhibitId(sp.getExhibitIdentifier());
            vo.setCategory(sp.getScienceProjectCategoryType().getLabel());

            for(SeteUser u : sp.getStudents()) {
                students.add(u.getFirstName() + " " + u.getLastName());
            }
            vo.setStudents(students);

            if(sp.getSponsor() != null) {
                vo.setSponsor(sp.getSponsor().getFirstName() + " " + sp.getSponsor().getLastName());
            }

            projectVos.add(vo);
        }
View Full Code Here

   
    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()){
            return projectVos;
        }
        for(ScienceProject sp : projects) {
            vo = new ScienceProjectVo();
            students = new ArrayList<String>();
            vo.setId(sp.getId());
            vo.setName(sp.getName());
            vo.setDescription(sp.getDescription());
            vo.setExhibitId(sp.getExhibitIdentifier());
            vo.setCategory(sp.getScienceProjectCategoryType().getLabel());

            for(SeteUser u : sp.getStudents()) {
                students.add(u.getFirstName() + " " + u.getLastName());
            }
            vo.setStudents(students);

            projectVos.add(vo);
        }

        return projectVos;
View Full Code Here

TOP

Related Classes of org.sete.vo.project.ScienceProjectVo

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.