Package org.focusns.model.core

Examples of org.focusns.model.core.Project


        Assert.assertEquals("Aimy Wang", project.getTitle());
    }

    @Test
    public void testDelete() {
        Project project = projectDao.selectByCode("gavin");
        int count = projectDao.delete(project.getId());
        Assert.assertEquals(1, count);
    }
View Full Code Here


        projectService.createProject(project);
    }

    @Test
    public void testDeleteProject() {
        Project project = projectService.getProject("gavin");
        //
        projectService.removeProject(project);
        //
        projectUserDao.delete(project.getCreatedById());
        //
        ProjectCategory category = projectCategoryService.getCategory(project.getCategoryId());
        projectCategoryService.removeCategory(category);

    }
View Full Code Here

    @Autowired
    private ProjectHistoryService projectHistoryService;

    @Test
    public void testCreateProjectHistroy() {
        Project project = projectService.getProject("admin");
        Assert.assertNotNull(project);
        //
        ProjectUser user = projectUserService.getProjectUser("admin");
        Assert.assertNotNull(user);
        //
        ProjectHistory history = new ProjectHistory();
        history.setContent("This is project history!");
        history.setCreatedAt(new Date());
        history.setCreatedById(user.getId());
        history.setTargetType("project");
        history.setTargetId(1);
        history.setParentId(1);
        history.setProjectId(project.getId());
        //
        projectHistoryService.createProjectHistory(history);
    }
View Full Code Here

        if(permission==null) {
            return permission;
        }
        //
        if(permission.getProject()==null && permission.getProjectId()>0) {
            Project project = projectDao.select(permission.getProjectId());
            permission.setProject(project);
        }
        if(permission.getProjectRole()==null && permission.getProjectRoleId()>0) {
            ProjectRole projectRole = projectRoleDao.select(permission.getProjectRoleId());
            permission.setProjectRole(projectRole);
View Full Code Here

    }

    public ProjectUser getProjectUser(String username) {
        ProjectUser user = projectUserDao.selectByUsername(username);
        if (user!=null && user.getProjectId() > 0) {
            Project project = projectDao.select(user.getProjectId());
            user.setProject(project);
            //
            ProjectCategory projectCategory = projectCategoryDao.select(project.getCategoryId());
            project.setCategory(projectCategory);
        }
        //
        return user;
    }
View Full Code Here

        if(projectUser==null) {
            return projectUser;
        }
        //
        if(projectUser.getProject()==null && projectUser.getProjectId()>0) {
            Project project = projectDao.select(projectUser.getProjectId());
            projectUser.setProject(project);
        }
        //
        return projectUser;
    }
View Full Code Here

        if(teamMember==null) {
            return teamMember;
        }
        //
        if(teamMember.getProject()==null && teamMember.getProjectId()>0) {
            Project project = projectDao.select(teamMember.getProjectId());
            teamMember.setProject(project);
        }
        if(teamMember.getCreatedBy()==null && teamMember.getCreatedById()>0) {
            ProjectUser createBy = projectUserDao.selectWithProject(teamMember.getCreatedById());
            teamMember.setCreatedBy(createBy);
View Full Code Here

        if(teamRole==null) {
            return teamRole;
        }
        //
        if(teamRole.getProject()==null && teamRole.getProjectId()>0) {
            Project project = projectDao.select(teamRole.getProjectId());
            teamRole.setProject(project);
        }
        if(teamRole.getCreatedBy()==null && teamRole.getCreatedById()>0) {
            ProjectUser createdBy = projectUserDao.select(teamRole.getCreatedById());
            teamRole.setCreatedBy(createdBy);
View Full Code Here

        if(photo.getAlbum()==null && photo.getAlbumId()>0) {
            Album album = albumDao.select(photo.getAlbumId());
            photo.setAlbum(album);
        }
        if(photo.getProject()==null && photo.getProjectId()>0) {
            Project project = projectDao.select(photo.getProjectId());
            photo.setProject(project);
        }
        if(photo.getCreatedBy()==null && photo.getCreatedById()>0) {
            ProjectUser createdBy = projectUserDao.select(photo.getCreatedById());
            photo.setCreatedBy(createdBy);
View Full Code Here

    private BlogCategory fillBlogCategory(BlogCategory blogCategory) {
        if (blogCategory == null) {
            return blogCategory;
        }
        if (blogCategory.getProject() == null && blogCategory.getProjectId() > 0) {
            Project project = projectDao.select(blogCategory.getProjectId());
            blogCategory.setProject(project);
        }
        if (blogCategory.getCreatedBy() == null && blogCategory.getCreatedById() > 0) {
            ProjectUser createdBy = projectUserDao.select(blogCategory.getCreatedById());
            blogCategory.setCreatedBy(createdBy);
View Full Code Here

TOP

Related Classes of org.focusns.model.core.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.