Class UIAssociatedProjectsService


  • @Component
    public class UIAssociatedProjectsService
    extends java.lang.Object
    Service for handling associated projects
    • Constructor Detail

      • UIAssociatedProjectsService

        @Autowired
        public UIAssociatedProjectsService​(ProjectService projectService,
                                           ProjectOwnerPermission projectOwnerPermission,
                                           org.springframework.context.MessageSource messageSource,
                                           UserService userService)
    • Method Detail

      • getAssociatedProjectsForProject

        public java.util.List<AssociatedProject> getAssociatedProjectsForProject​(java.lang.Long projectId)
        Get a list of all projects associated with the current project.
        Parameters:
        projectId - project identifier for the currently active project
        Returns:
        list of projects
      • getAssociatedProjects

        public java.util.List<AssociatedProject> getAssociatedProjects​(java.lang.Long projectId)
        Get a list of all projects associated with the current project. If the user is a manager or administrator, the list will also contain all projects they have access to.
        Parameters:
        projectId - project identifier for the currently active project
        Returns:
        list of projects
      • addAssociatedProject

        public void addAssociatedProject​(java.lang.Long projectId,
                                         java.lang.Long associatedProjectId,
                                         java.util.Locale locale)
                                  throws UIAddAssociatedProjectException
        Create a new associated project linkage
        Parameters:
        projectId - identifier for the current project
        associatedProjectId - identifier for the project to associate
        locale - currently logged in users locale
        Throws:
        UIAddAssociatedProjectException - if the project or associated project cannot be found
      • removeAssociatedProject

        public void removeAssociatedProject​(java.lang.Long projectId,
                                            java.lang.Long associatedProjectId,
                                            java.util.Locale locale)
                                     throws UIRemoveAssociatedProjectException
        Remove an associated project linkage
        Parameters:
        projectId - identifier for the current project
        associatedProjectId - identifier for the project to associate
        locale - current users locale
        Throws:
        UIRemoveAssociatedProjectException - if there is an issue removing the associated project