public UnitProjectBean createProject(final UnitProjectBean projectBean, final String username) throws EnMeExpcetion {
log.debug("new Project createProject "+projectBean);
log.debug("new Project username "+username);
if (projectBean != null) {
try {
final Project projectDomain = new Project();
final UserAccount secondary = getAccountDao().getUserAccountById(projectBean.getLeader());
final Account user = getUserAccount(username).getAccount();
projectDomain.setProjectDateFinish(projectBean.getDateFinish());
projectDomain.setProjectDateStart(projectBean.getDateInit());
log.debug("new Project Leader "+projectBean.getName());
projectDomain.setProjectDescription(projectBean.getDescription());
projectDomain.setProjectName(projectBean.getName());
projectDomain.setProjectInfo(projectBean.getProjectInfo());
projectDomain.setHideProject(projectBean.getHide());
projectDomain.setNotifyMembers(projectBean.getNotify());
log.debug("Project Leader "+projectBean.getLeader());
if(projectBean.getLeader() != null){
projectDomain.setLead(secondary);
}
projectDomain.setUsers(user);
getProjectDaoImp().saveOrUpdate(projectDomain);
projectBean.setId(projectDomain.getProyectId());
log.debug("created domain project");
createNotification(NotificationEnum.PROJECT_CREATED, secondary.getUsername() +" is the leader of this project.", user);
}
catch (Exception e) {
log.error(e.getMessage());