Package org.encuestame.persistence.domain

Examples of org.encuestame.persistence.domain.Project


     * @return {@link UnitProjectBean}
     * @throws EnMeExpcetion excepcion
     */
    public UnitProjectBean loadProjectInfo(final UnitProjectBean projectBean) throws EnMeExpcetion {
        if (projectBean.getId()!= null) {
            final Project projectDomain = getProjectDaoImp().getProjectbyId(projectBean.getId());
            if (projectDomain != null) {
                final UnitProjectBean projectBeanRetrieved = ConvertDomainBean.convertProjectDomainToBean(projectDomain);
                //projectBeanRetrieved.setGroupList(ConvertListDomainSelectBean.convertListGroupDomainToSelect(projectDomain.getGroups()));
                return projectBeanRetrieved;
            } else {
View Full Code Here


     */
    public final UnitProjectBean createProject(final UnitProjectBean projectBean) throws EnMeExpcetion {
        log.info("create project");
        if (projectBean != null) {
            try {
                final Project projectDomain = new Project();
                //projectDomain.setStateProject(getState(projectBean.getState()));
                projectDomain.setProjectDateFinish(projectBean.getDateFinish());
                projectDomain.setProjectDateStart(projectBean.getDateInit());
                projectDomain.setProjectDescription(projectBean.getName());
                projectDomain.setProjectInfo(projectBean.getDescription());
                projectDomain.setHideProject(projectBean.getHide());
                projectDomain.setNotifyMembers(projectBean.getNotify());
                if(projectBean.getLeader()!=null){
                    projectDomain.setLead(getAccountDao().getUserAccountById(projectBean.getLeader()));
                }
                projectDomain.setUsers(getAccountDao().getUserById(projectBean.getUserId()));
                getProjectDaoImp().saveOrUpdate(projectDomain);
                projectBean.setId(projectDomain.getProyectId());
                log.debug("created domain project");
            } catch (HibernateException e) {
                throw new EnMeExpcetion(e);
            } catch (Exception e) {
                throw new EnMeExpcetion(e);
View Full Code Here

     * @return {@link UnitProjectBean}
     * @throws EnMeExpcetion excepcion
     */
    public UnitProjectBean loadProjectInfo(final UnitProjectBean projectBean) throws EnMeExpcetion {
        if (projectBean.getId()!= null) {
            final Project projectDomain = getProjectDaoImp().getProjectbyId(projectBean.getId());
            if (projectDomain != null) {
                final UnitProjectBean projectBeanRetrieved = ConvertDomainBean.convertProjectDomainToBean(projectDomain);
                //projectBeanRetrieved.setGroupList(ConvertListDomainSelectBean.convertListGroupDomainToSelect(projectDomain.getGroups()));
                final List<GeoPoint> list = new ArrayList<GeoPoint>(projectDomain.getLocations());
                log.debug("Locations on Project "+list.size());
                //projectBeanRetrieved.setUnitLocationBeans(ConvertDomainBean.convertListToUnitLocationBean(list));
                return projectBeanRetrieved;
            } else {
                log.info("id project is not found");
View Full Code Here

    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());
View Full Code Here

     * @return
     * @throws EnMeExpcetion
     */
    public void updateProject(final UnitProjectBean projectBean, final String username) throws EnMeExpcetion {
        log.debug("project bean "+projectBean.toString());
        final Project project = getProjectDaoImp().getProjectbyId(projectBean.getId());
        if(project == null){
            throw new EnMeExpcetion("project not found");
        }
        else{
            final UserAccount secondary = getAccountDao().getUserAccountById(projectBean.getLeader());
            final Account user = getUserAccount(username).getAccount();
            project.setProjectName(projectBean.getName());
            project.setHideProject(projectBean.getHide());
            project.setLead(secondary);
            project.setNotifyMembers(projectBean.getNotify());
            project.setProjectDateFinish(projectBean.getDateFinish());
            project.setProjectDateStart(projectBean.getDateInit());
            project.setProjectDescription(projectBean.getDescription());
            project.setProjectInfo(projectBean.getProjectInfo());
            //project.setProjectStatus(projectBean.get)
            project.setPriority(Priority.valueOf(projectBean.getPriority()));
            project.setPublished(projectBean.getPublished());
            getProjectDaoImp().saveOrUpdate(project);
            createNotification(NotificationEnum.PROJECT_UPDATED, secondary.getUsername() +" is the leader of "+projectBean.getName(), user);
        }
    }
View Full Code Here

    public Project createProject(
            final String name,
            final String descProject,
            final String infoProject,
            final Account user) {
          final Project project = new Project();
          final Calendar start = Calendar.getInstance();
          final Calendar end = Calendar.getInstance();
          end.add(Calendar.MONTH, 4);
          project.setProjectDateFinish(end.getTime());
          project.setProjectDateStart(start.getTime());
          project.setProjectInfo(infoProject);
          project.setProjectName(RandomStringUtils.randomAscii(4)+"_name");
          project.setLead(createUserAccount("tes-"+RandomStringUtils.randomAscii(4), createAccount()));
          project.setProjectDescription(descProject);
          project.setProjectStatus(Status.ACTIVE);
          project.setPriority(Priority.MEDIUM);
          project.setHideProject(Boolean.FALSE);
          project.setPublished(Boolean.TRUE);
          project.setUsers(user);
          getProjectDaoImp().saveOrUpdate(project);
          return project;
    }
View Full Code Here

    /**
     * Test Project.
     **/
    @Test
    public void testProject(){
        final Project project = new Project();
        project.setProjectDescription("Tic Municipal");
        project.setProjectInfo("Tic Project in Nicaraguan Municipalities");
        project.setProjectDateStart(new Date());
        project.setProjectDateFinish(new Date());
        project.setProjectName("Name");
         project.getSurveyGroups().add(createSurveyGroup("Education"));
        project.getSecUserSecondaries().add(createUserAccount("Diana",createAccount()));
        project.getGroups().add(createGroups("editor"));
        project.getLocations().add(createGeoPoint("Matagalpa","Matalgalpa Department",2, createAccount()));
        getProjectDaoImp().saveOrUpdate(project);
        assertNotNull(project.getProyectId());
    }
View Full Code Here

    /**
     * Test Get Project by Id.
     */
    @Test
    public void testGetProjectById(){
        final Project prj = getProjectDaoImp().getProjectbyId(this.project.getProyectId());
        assertNotNull(prj);
    }
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.Project

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.