Package org.sete.domain

Examples of org.sete.domain.ScienceProject


    public void testLoadAllScienceProjectsSponsoredByOneProjects(){
        int toTestID = 2;
        SeteUser p = new SeteUser();
        p.setId(toTestID);
        List<ScienceProject> projects = new ArrayList<ScienceProject>();
        ScienceProject proj = new ScienceProject();
        projects.add(proj);
        ScienceProjectCategoryType t = new ScienceProjectCategoryType();
        t.setLabel("");
        Set<SeteUser> students = new HashSet<SeteUser>();
        SeteUser stud = new SeteUser();
        stud.setFirstName("");
        stud.setLastName("");
        students.add(stud);
        proj.setStudents(students);
        proj.setScienceProjectCategoryType(t);
        EasyMock.expect(mockScienceProjectDao.findSponsoredBy(p)).andReturn(projects);
        EasyMock.replay(mockScienceProjectDao);
        EasyMock.expect(mockUserDao.findById(new Integer(toTestID))).andReturn(p);
        EasyMock.replay(mockUserDao);
        List<ScienceProjectVo> att = scienceProjectService.loadAllScienceProjectsSponsoredBy(toTestID);
View Full Code Here


            }

            students.add(userDao.findById(Integer.valueOf(vo.getPartner())));
        }

        ScienceProject sp = new ScienceProject();
        sp.setSponsor(userDao.findById(Integer.valueOf(vo.getSponsor())));
        sp.setStudents(students);
        sp.setName(vo.getName());
        sp.setDescription(vo.getDescription());
        sp.setScienceProjectCategoryType(TypeUtil.forKey(ScienceProjectCategoryType.class,
                                                         vo.getCategory()));

        sp.setScienceProjectStatusType(
                ScienceProjectStatusType.forKey(ScienceProjectStatusType.Key.REGISTERED_KEY));

        projectDao.saveScienceProject(sp);
    }
View Full Code Here

      projectDao.saveScienceProjectFileType(attachment);
 
  }

  public Boolean deleteScienceProject(String projectId){
    ScienceProject sp = projectDao.findById(projectId);
    if(sp != null){     
      projectDao.deleteScienceProject(sp);
    }
    return Boolean.TRUE;
  }
View Full Code Here

      return Boolean.FALSE;
    }
  }

    public void editScienceProject(CreateScienceProjectVo vo, Boolean isadmin) {
      ScienceProject sp = projectDao.findById(vo.getProjId());
      this.checkEditBusinessRules(vo);
     
      if(sp != null){     
       
          sp.setName(vo.getName());
          sp.setDescription(vo.getDescription());
          sp.setScienceProjectCategoryType(TypeUtil.forKey(ScienceProjectCategoryType.class,
                                                           vo.getCategory()));
        if(isadmin){
            Set<SeteUser> students = sp.getStudents();
          sp.getStudents().removeAll(students);     
 
            sp.setSponsor(userDao.findById(Integer.valueOf(vo.getSponsor())));
            if(StringUtils.isNotBlank(vo.getCreator())) {
              sp.getStudents().add(userDao.findById(Integer.valueOf(vo.getCreator())));
            }
            if(StringUtils.isNotBlank(vo.getPartner())) {
              sp.getStudents().add(userDao.findById(Integer.valueOf(vo.getPartner())));
            }         
        }
          projectDao.saveScienceProject(sp);
      }
    }
View Full Code Here

            }

            students.add(userDao.findById(Integer.valueOf(vo.getPartner())));
        }

        ScienceProject sp = new ScienceProject();
        sp.setSponsor(userDao.findById(Integer.valueOf(vo.getSponsor())));
        sp.setStudents(students);
        sp.setName(vo.getProjectName());
        sp.setDescription(vo.getDescription());
        sp.setScienceProjectCategoryType(TypeUtil.forKey(ScienceProjectCategoryType.class,
                                                         vo.getCategory()));
        sp.setScienceProjectStatusType(TypeUtil.forKey(ScienceProjectStatusType.class,
                                                       ScienceProjectStatusType.REGISTERED_KEY));

        projectDao.saveScienceProject(sp);
    }
View Full Code Here

            }

            students.add(userDao.findById(Integer.valueOf(vo.getPartner())));
        }

        ScienceProject sp = new ScienceProject();
        sp.setSponsor(userDao.findById(Integer.valueOf(vo.getSponsor())));
        sp.setStudents(students);
        sp.setName(vo.getProjectName());
        sp.setDescription(vo.getDescription());
        sp.setScienceProjectCategoryType(TypeUtil.forKey(ScienceProjectCategoryType.class,
                                                         vo.getCategory()));
        sp.setScienceProjectStatusType(TypeUtil.forKey(ScienceProjectStatusType.class,
                                                       ScienceProjectStatusType.REGISTERED_KEY));

        projectDao.saveScienceProject(sp);
    }
View Full Code Here

TOP

Related Classes of org.sete.domain.ScienceProject

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.