Package org.focusns.model.core

Examples of org.focusns.model.core.Project


            } else {
               projectPermissionService.createProjectPermission(projectPermission);
            }
        }
        //
        Project project = projectService.getProject(projectId);
        Navigator.get().withAttribute("project", project).navigateTo("permissions-modified");
    }
View Full Code Here


            //
            ProjectService projectService = applicationContext.getBean(ProjectService.class);
            ProjectCategoryService projectCategoryService = applicationContext.getBean(ProjectCategoryService.class);
            ProjectFeatureService projectFeatureService = applicationContext.getBean(ProjectFeatureService.class);
            //
            Project project = projectService.getProject(projectCode);
            ProjectCategory projectCategory = projectCategoryService.getCategory(project.getCategoryId());
            //
            request.setAttribute(Keys.REQUEST_PROJECT, project);
            request.setAttribute(Keys.REQUEST_PROJECT_CATEGORY, projectCategory);
            //
            List<ProjectFeature> projectFeatures = projectFeatureService.getProjectFeatures(project.getId());
            for (ProjectFeature projectFeature : projectFeatures) {
                if (lookupPath.contains(projectFeature.getCode())) {
                    request.setAttribute(Keys.REQUEST_PROJECT_FEATURE, projectFeature);
                    break;
                }
View Full Code Here

    public static ProjectFeature getProjectFeature(WebRequest webRequest) {
        return (ProjectFeature) webRequest.getAttribute("feature", WebRequest.SCOPE_SESSION);
    }

    public static String getRedirectPath(WebRequest webRequest) {
        Project project = getProject(webRequest);
        ProjectFeature feature = getProjectFeature(webRequest);
        return getRedirectPath(project, feature);
    }
View Full Code Here

        }
        //
        String projectCode = parameterMap.get(Keys.PARAMETER_PROJECT_CODE);
        if (StringUtils.hasText(projectCode)) {
            ProjectService projectService = beanFactory.getBean(ProjectService.class);
            Project project = projectService.getProject(projectCode);
            Assert.notNull(project);
            //
            parameterMap.put("category", project.getCategory().getCode());
        }
        //
        StringBuilder pageKeyBuilder = new StringBuilder(name);
        int count = 0;
        for (String paramName : PARAM_NAMES_INCLUDE) {
View Full Code Here

        ProjectUserService projectUserService = beanFactory.getBean(ProjectUserService.class);
        ProjectRoleService projectRoleService = beanFactory.getBean(ProjectRoleService.class);
        ProjectMemberService projectMemberService = beanFactory.getBean(ProjectMemberService.class);
        ProjectAuthorityService projectAuthorityService = beanFactory.getBean(ProjectAuthorityService.class);
        //
        Project project = getProjectFromWebSubject();
        ProjectUser projectUser = getProjectUserFromWebSubject();
        if(project==null) {
            authorizationInfo.addObjectPermission(new AllPermission());
        } else if(project.getCreatedById()==projectUser.getId()) {// owner
            //
            List<ProjectAuthority> projectAuthorities = projectAuthorityService.listProjectAuthorities();
            for(ProjectAuthority projectAuthority : projectAuthorities) {
                //
                String authorityCode = projectAuthority.getCode();
View Full Code Here

    }

    @Override
    protected Object getAuthorizationCacheKey(PrincipalCollection principals) {
        //
        Project project = getProjectFromWebSubject();
        if(project == null) {
            return super.getAuthorizationCacheKey(principals);
        }
        return principals.getPrimaryPrincipal().toString() + "#" + project.getId();
    }
View Full Code Here

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

        if(album.getPhoto()==null && album.getPhotoId()>0) {
            Photo photo = photoDao.select(album.getPhotoId());
            album.setPhoto(photo);
        }
        if(album.getProject()==null && album.getProjectId()>0) {
            Project project = projectDao.select(album.getProjectId());
            album.setProject(project);
        }
        if(album.getCreatedBy()==null && album.getCreatedById()>0) {
            ProjectUser createdBy = projectUserDao.select(album.getCreatedById());
            album.setCreatedBy(createdBy);
View Full Code Here

    public Page<ProjectHistory> fetchPage(Page<ProjectHistory> page, long projectId) {
        page = projectHistoryDao.fetchByProjectId(page, projectId);
        // TODO performance tuning
        for (ProjectHistory history : page.getResults()) {
            Project project = projectDao.select(history.getProjectId());
            ProjectUser projectUser = projectUserDao.selectWithProject(history.getCreatedById());
            history.setProject(project);
            history.setCreatedBy(projectUser);
            //
            List<ProjectHistory> children = projectHistoryDao.selectByParentId(history.getId());
            for (ProjectHistory child : children) {
                //
                Project childProject = projectDao.select(child.getProjectId());
                ProjectUser childProjectUser = projectUserDao.selectWithProject(child.getCreatedById());
                child.setProject(childProject);
                child.setCreatedBy(childProjectUser);
            }
            history.setChildren(children);
View Full Code Here

    private ProjectHistory fillProjectHistory(ProjectHistory projectHistory) {
        if (projectHistory == null) {
            return projectHistory;
        }
        if (projectHistory.getProject() == null && projectHistory.getProjectId() > 0) {
            Project project = projectDao.select(projectHistory.getProjectId());
            projectHistory.setProject(project);
        }
        if (projectHistory.getCreatedBy() == null && projectHistory.getCreatedById() > 0) {
            ProjectUser createBy = projectUserDao.select(projectHistory.getCreatedById());
            projectHistory.setCreatedBy(createBy);
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.