Class UIAssociatedProjectsService
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.services.UIAssociatedProjectsService
-
@Component public class UIAssociatedProjectsService extends java.lang.Object
Service for handling associated projects
-
-
Constructor Summary
Constructors Constructor Description UIAssociatedProjectsService(ProjectService projectService, ProjectOwnerPermission projectOwnerPermission, org.springframework.context.MessageSource messageSource, UserService userService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAssociatedProject(java.lang.Long projectId, java.lang.Long associatedProjectId, java.util.Locale locale)
Create a new associated project linkagejava.util.List<AssociatedProject>
getAssociatedProjects(java.lang.Long projectId)
Get a list of all projects associated with the current project.java.util.List<AssociatedProject>
getAssociatedProjectsForProject(java.lang.Long projectId)
Get a list of all projects associated with the current project.void
removeAssociatedProject(java.lang.Long projectId, java.lang.Long associatedProjectId, java.util.Locale locale)
Remove an associated project linkage
-
-
-
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 projectassociatedProjectId
- identifier for the project to associatelocale
- 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 projectassociatedProjectId
- identifier for the project to associatelocale
- current users locale- Throws:
UIRemoveAssociatedProjectException
- if there is an issue removing the associated project
-
-