Package org.focusns.model.core

Examples of org.focusns.model.core.ProjectLink


    @Autowired
    private ProjectLinkDao projectLinkDao;

    @Test
    public void testInsert() {
        ProjectLink link = new ProjectLink();
        link.setFromProjectId(1);
        link.setToProjectId(1);
        //
        projectLinkDao.insert(link);
    }
View Full Code Here


    private ProjectDao projectDao;
    @Autowired
    private ProjectLinkDao linkDao;

    public ProjectLink getProjectLink(long id) {
        ProjectLink projectLink = linkDao.select(id);
        return fillProjectLink(projectLink);
    }
View Full Code Here

        ProjectLink projectLink = linkDao.select(id);
        return fillProjectLink(projectLink);
    }

    public void createProjectLink(ProjectLink link) {
        ProjectLink dbLink = linkDao.selectByFromAndToProjectId(link.getFromProjectId(), link.getToProjectId());
        if (dbLink == null) {
            linkDao.insert(link);
            fillProjectLink(link);
        } else {
            throw new ServiceException(ServiceExceptionCode.PROJECT_LINK_ALREADY_EXIST, "The project link already exist!");
View Full Code Here

        //
        fillProjectLink(link);
    }

    public ProjectLink getProjectLink(long fromProjectId, long toProjectId) {
        ProjectLink projectLink = linkDao.selectByFromAndToProjectId(fromProjectId, toProjectId);
        return fillProjectLink(projectLink);
    }
View Full Code Here

        ProjectUser dbUser = projectUserService.getProjectUser(project.getCreatedById());
        model.addAttribute("projectUser", dbUser);
        model.addAttribute("project", project);
        //
        if (projectUser != null) {
            ProjectLink projectLink = projectLinkService.getProjectLink(projectUser.getProjectId(), project.getId());
            model.addAttribute("projectLink", projectLink);
            model.addAttribute("fromProject", projectUser.getProject());
            model.addAttribute("toProject", project);
        }
        //
View Full Code Here

        return "modules/profile/project-status";
    }

    public String action(Map<String, Object> model, ProjectUser projectUser, Project project) {
        //
        ProjectLink projectLink = projectLinkService.getProjectLink(projectUser.getProjectId(), project.getId());
        model.put("projectLink", projectLink);
        model.put("fromProject", projectUser.getProject());
        model.put("toProject", project);
        //
        return "modules/profile/project-action";
View Full Code Here

    @RequiresProject
    @RequiresProjectUser
    @RequestMapping("/link-edit")
    public String doEdit(@WidgetAttribute ProjectUser projectUser, @WidgetAttribute Project project, Model model) {
        //
        ProjectLink projectLink = projectLinkService.getProjectLink(projectUser.getProjectId(), project.getId());
        model.addAttribute("projectLink", projectLink);
        model.addAttribute("fromProject", projectUser.getProject());
        model.addAttribute("toProject", project);
        //
        return "modules/profile/link-edit";
View Full Code Here

        return "modules/profile/link-list-detail";
    }

    @RequestMapping("/link-create")
    public void doCreate(ProjectLink link) {
        ProjectLink reverseProjectLink = projectLinkService.getProjectLink(link.getToProjectId(), link.getFromProjectId());
        if (reverseProjectLink != null) {
            reverseProjectLink.setMutual(true);
            projectLinkService.modifyProjectLink(reverseProjectLink);
            //
            link.setMutual(true);
        }
        //
View Full Code Here

    }

    @RequestMapping("/link-remove")
    public void doRemove(ProjectLink link) {
        //
        ProjectLink reverseProjectLink = projectLinkService.getProjectLink(link.getToProjectId(), link.getFromProjectId());
        if (reverseProjectLink != null) {
            reverseProjectLink.setMutual(false);
            projectLinkService.modifyProjectLink(reverseProjectLink);
        }
        //
        projectLinkService.removeProjectLink(link);
        //
View Full Code Here

TOP

Related Classes of org.focusns.model.core.ProjectLink

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.