Package org.sete.vo.project

Examples of org.sete.vo.project.ScienceProjectVo


      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());
           
      if(p.getForms() != null) {
        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


        checkAuthorization(userHasPrivilege(request.getSession(),
                                            getPrivileges()));

        ScienceProjectService service = getService(ScienceProjectService.class);
        ScienceProjectVo project = service.loadScienceProjectByStudentUserId(getAuthenticatedUser(request).getUserId());
        request.setAttribute("project", project);
        return mapping.findForward(WebConstants.FORWARD_VIEW);
    }
View Full Code Here

    private ScienceProjectDao projectDao;

    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());
            }
           
            if(sp.getScienceProjectStatusType()!=null){
              vo.setStatus(sp.getScienceProjectStatusType().getLabel());
            }

            if(sp.getAwards()!=null){
            Set<Award> awards = sp.getAwards();
            vo.setAwards(awards);
            }
           
            projectVos.add(vo);
        }
View Full Code Here

        return projectVos;
    }
   
    public ScienceProjectVo loadScienceProject(String projectId) {
        ScienceProject sp = projectDao.findById(projectId);
        ScienceProjectVo spvo = new ScienceProjectVo();
        List<String> students = new ArrayList<String>();
       
        spvo.setId(sp.getId());
        spvo.setName(sp.getName());
        spvo.setDescription(sp.getDescription());
        spvo.setExhibitId(sp.getExhibitIdentifier());
        spvo.setCategory(sp.getScienceProjectCategoryType().getLabel());

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

        if(sp.getSponsor() != null) {
            spvo.setSponsor(sp.getSponsor().getFirstName() + " " + sp.getSponsor().getLastName());
        }
        if(sp.getScienceProjectStatusType()!=null){
          spvo.setStatus(sp.getScienceProjectStatusType().getLabel());
        }
        if(sp.getAwards()!=null){
        Set<Award> awards = sp.getAwards();
        spvo.setAwards(awards);
        }
        return spvo;
    }
View Full Code Here

  ScienceProjectStatusType spst = ScienceProjectStatusType.forKey(scored_key);
  AwardType awtp = TypeUtil.forKey(AwardType.class, awardType);
 
  List<ScienceProject> projects = projectDao.findByAwardType(awtp, spst);
    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());
            vo.setScore(sp.getScore().getScore());
           
            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

    checkAuthorization(userHasPrivilege(request.getSession(),
        getPrivileges()));

    ScienceProjectService service = getService(ScienceProjectService.class);
    ScienceProjectVo project = service.loadScienceProjectByStudentUserId(getAuthenticatedUser(request).getUserId());
    request.setAttribute("project", project);
    return mapping.findForward("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.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> 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.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;
        for(ScienceProject sp : projects) {
            vo = new ScienceProjectVo();
            students = new ArrayList<String>();

            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.