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();
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());
}
}