Class UIProjectMembersService
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.services.UIProjectMembersService
-
@Component public class UIProjectMembersService extends java.lang.Object
Service class for the UI for handling project members actions.
-
-
Constructor Summary
Constructors Constructor Description UIProjectMembersService(ProjectService projectService, UserService userService, org.springframework.context.MessageSource messageSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
addMemberToProject(java.lang.Long projectId, NewMemberRequest request, java.util.Locale locale)
Add a user to a projectjava.util.List<User>
getAvailableUsersForProject(java.lang.Long projectId, java.lang.String query)
Get a filtered list of available IRIDA instance users for this projectTableResponse<ProjectMemberTableModel>
getProjectMembers(java.lang.Long projectId, TableRequest tableRequest)
Get a paged listing of project members passed on parameters set in the table request.java.lang.String
removeUserFromProject(java.lang.Long projectId, java.lang.Long userId, java.util.Locale locale)
Remove a user from the projectjava.lang.String
updateUserMetadataRoleOnProject(java.lang.Long projectId, java.lang.Long userId, java.lang.String metadataRole, java.util.Locale locale)
Update a users metadata role on a projectjava.lang.String
updateUserRoleOnProject(java.lang.Long projectId, java.lang.Long userId, java.lang.String role, java.util.Locale locale)
Update a users role on a project
-
-
-
Constructor Detail
-
UIProjectMembersService
@Autowired public UIProjectMembersService(ProjectService projectService, UserService userService, org.springframework.context.MessageSource messageSource)
-
-
Method Detail
-
getProjectMembers
public TableResponse<ProjectMemberTableModel> getProjectMembers(java.lang.Long projectId, TableRequest tableRequest)
Get a paged listing of project members passed on parameters set in the table request.- Parameters:
projectId
- - identifier for the current projecttableRequest
- - details about the current page of the table- Returns:
- sorted and filtered list of project members
-
removeUserFromProject
public java.lang.String removeUserFromProject(java.lang.Long projectId, java.lang.Long userId, java.util.Locale locale) throws UIProjectWithoutOwnerException
Remove a user from the project- Parameters:
projectId
- - identifier for the current projectuserId
- - identifier for the user to remove from the projectlocale
- - of the currently logged in user- Returns:
- Message to display to the user about the outcome of removing a user from the project.
- Throws:
UIProjectWithoutOwnerException
- if removing the user will leave the project without a manager
-
updateUserRoleOnProject
public java.lang.String updateUserRoleOnProject(java.lang.Long projectId, java.lang.Long userId, java.lang.String role, java.util.Locale locale) throws UIProjectWithoutOwnerException, UIConstraintViolationException
Update a users role on a project- Parameters:
projectId
- - identifier for the current projectuserId
- - identifier for the user to remove from the projectrole
- -ProjectRole
to update the user tolocale
- - of the currently logged in user- Returns:
- message to display to the user about the outcome of the change in role.
- Throws:
UIProjectWithoutOwnerException
- if removing the user will leave the project without a managerUIConstraintViolationException
- thrown when updating the project role to owner and the metadata role is not set to the highest level
-
updateUserMetadataRoleOnProject
public java.lang.String updateUserMetadataRoleOnProject(java.lang.Long projectId, java.lang.Long userId, java.lang.String metadataRole, java.util.Locale locale) throws UIConstraintViolationException
Update a users metadata role on a project- Parameters:
projectId
- - identifier for the current projectuserId
- - identifier for the user to remove from the projectmetadataRole
- -ProjectMetadataRole
to update the user tolocale
- - of the currently logged in user- Returns:
- message to display to the user about the outcome of the change in role.
- Throws:
UIConstraintViolationException
- thrown when updating the project role to owner and the metadata role is
-
getAvailableUsersForProject
public java.util.List<User> getAvailableUsersForProject(java.lang.Long projectId, java.lang.String query)
Get a filtered list of available IRIDA instance users for this project- Parameters:
projectId
- - identifier for the current projectquery
- - search query to filter the users by- Returns:
- List of filtered users.
-
addMemberToProject
public java.lang.String addMemberToProject(java.lang.Long projectId, NewMemberRequest request, java.util.Locale locale)
Add a user to a project- Parameters:
projectId
- - identifier for the current projectrequest
- - details about the user to add to the project (id and role)locale
- - of the currently logged in user- Returns:
- message to display to the user about the outcome of adding the user to the project
-
-