Package org.sete.vo.project

Examples of org.sete.vo.project.ScienceProjectIdeaVo


* get a list of all Science Project Ideas from the DB
*/
  public List<ScienceProjectIdeaVo> loadAllScienceProjectIdeas() {
    List<ProjectIdea> ideas = projectIdeaDao.getAllScienceProjectIdeas();
    List<ScienceProjectIdeaVo> projectIdeaVos = new ArrayList<ScienceProjectIdeaVo>();
    ScienceProjectIdeaVo vo = null;

    for (ProjectIdea spi : ideas) {
      vo = new ScienceProjectIdeaVo();
            vo.setProjectIdeaId(spi.getIdAsString());
      vo.setTitle(spi.getTitle());
      vo.setDescription(spi.getDescription());
      vo.setProjectCategoryType(spi.getScienceProjectCategoryType()
          .getLabel());
      vo.setSuggestor(spi.getSuggestor().getFirstName()+ " "+spi.getSuggestor().getLastName());
      projectIdeaVos.add(vo);
    }
   
    return projectIdeaVos;   
  }
View Full Code Here


   
    /** gets the project idea
  */
    public ScienceProjectIdeaVo getProjectIdea(String projectIdeaId, boolean forDisplay) {
        ProjectIdea su = projectIdeaDao.findById(Integer.valueOf(projectIdeaId));
        ScienceProjectIdeaVo vo = new ScienceProjectIdeaVo();
        if(su != null){
            vo = this.makeProjectIdeaVo(su,forDisplay);
        } else {
            final String msg = "Invalid Project Idea [id=" + projectIdeaId + "] " +
            "submitted for update, operation aborted.";
View Full Code Here

    }
   
    /** makes a VO
  */
    private ScienceProjectIdeaVo makeProjectIdeaVo(ProjectIdea su,boolean forDisplay){
        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());
        }
       
        vo.setTitle(su.getTitle());
      
        return vo;
    }
View Full Code Here

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

        CreateProjectIdeaForm csuf = (CreateProjectIdeaForm) form;

        ScienceProjectIdeaService service = getService(ScienceProjectIdeaService.class);
        ScienceProjectIdeaVo suvo = service.getProjectIdea(request.getParameter("projectIdeaId"), false);
        BeanUtils.copyProperties(csuf, suvo);

        return mapping.findForward(WebConstants.FORWARD_VIEW);
    }
View Full Code Here

* get a list of all Science Project Ideas from the DB
*/
  public List<ScienceProjectIdeaVo> loadAllScienceProjectIdeas() {
    List<ProjectIdea> ideas = projectIdeaDao.getAllScienceProjectIdeas();
    List<ScienceProjectIdeaVo> projectIdeaVos = new ArrayList<ScienceProjectIdeaVo>();
    ScienceProjectIdeaVo vo = null;

    for (ProjectIdea spi : ideas) {
      vo = new ScienceProjectIdeaVo();
      vo.setTitle(spi.getTitle());
      vo.setDescription(spi.getDescription());
      vo.setProjectCategoryType(spi.getScienceProjectCategoryType()
          .getLabel());
      vo.setSuggestor(spi.getSuggestor().getFirstName()+ " "+spi.getSuggestor().getLastName());
      projectIdeaVos.add(vo);
    }

   
    //Test. Will be removed for production
    ScienceProjectIdeaVo vo1 = new ScienceProjectIdeaVo();
    vo1.setTitle("Do you have a blind spot and if so, how can you determine your blind spot?");
    vo1.setDescription("One of the most dramatic experiments to perform is the demonstration of the blind spot. The blind spot is the area on the retina without receptors that respond to light. Therefore an image that falls on this region will NOT be seen. It is in this region that the optic nerve exits the eye on its way to the brain. To find your blind spot, look at the image below or draw it on a piece of paper: ");
    vo1.setSuggestor("John Smith");
    projectIdeaVos.add(vo1);
   
    ScienceProjectIdeaVo vo2 = new ScienceProjectIdeaVo();
    vo2.setTitle("Can a neural network learn how to play a board game?");
    vo2.setDescription("The goal of this project is to find if a neural network would be able to learn how to play Connect 4 (a board game where the goal is to get four tokens in a row) well enough that it could beat a human opponent. A neural network is an artificial intelligence program that uses a network of connections between input values and output values to eventually learn how to do something.");
    vo2.setSuggestor("Jane Doe");
    projectIdeaVos.add(vo2);
   
    return projectIdeaVos;   
  }
View Full Code Here

TOP

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

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.