Class UIUserGroupsService
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.services.UIUserGroupsService
-
@Component public class UIUserGroupsService extends java.lang.Object
Service class for the UI for handlingUserGroup
s
-
-
Constructor Summary
Constructors Constructor Description UIUserGroupsService(UserGroupService userGroupService, UserService userService, org.springframework.context.MessageSource messageSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
addMemberToUserGroup(java.lang.Long groupId, java.lang.Long userId, java.lang.String role, java.util.Locale locale)
Add a new member to the user groupjava.lang.Long
createNewUserGroup(UserGroup userGroup, java.util.Locale locale)
Crate a newUserGroup
java.lang.String
deleteUserGroup(java.lang.Long id, java.util.Locale locale)
Delete a specific user groupjava.util.List<User>
getAvailableUsersForUserGroup(java.lang.Long groupId, java.lang.String query)
Get a list of system users who are not on the project yet.java.util.List<UserGroupProjectTableModel>
getProjectsForUserGroup(java.lang.Long groupId, java.util.Locale locale)
Gets a list of projects that are on a user groupUserGroupDetails
getUserGroupDetails(java.lang.Long groupId)
Get details about a specific user groupjava.util.List<UserGroupRole>
getUserGroupRoles(java.util.Locale locale)
Get a list of all user group roles with their translationsTableResponse<UserGroupTableModel>
getUserGroups(TableRequest request)
Gat a paged list of user groupsjava.lang.String
removeMemberFromUserGroup(java.lang.Long groupId, java.lang.Long userId, java.util.Locale locale)
Remove a user from an user groupvoid
updateUserGroupDetails(java.lang.Long groupId, FieldUpdate update)
Update user group detailsjava.lang.String
updateUserRoleOnUserGroup(java.lang.Long groupId, java.lang.Long userId, java.lang.String role, java.util.Locale locale)
Update a users role on a project
-
-
-
Constructor Detail
-
UIUserGroupsService
@Autowired public UIUserGroupsService(UserGroupService userGroupService, UserService userService, org.springframework.context.MessageSource messageSource)
-
-
Method Detail
-
getUserGroups
public TableResponse<UserGroupTableModel> getUserGroups(TableRequest request)
Gat a paged list of user groups- Parameters:
request
- details about the current table page- Returns:
TableResponse
for the current page of user groups
-
deleteUserGroup
public java.lang.String deleteUserGroup(java.lang.Long id, java.util.Locale locale)
Delete a specific user group- Parameters:
id
- Identifier for the user group to deletelocale
- Current users locale- Returns:
- Message to user about what happened
-
getUserGroupDetails
public UserGroupDetails getUserGroupDetails(java.lang.Long groupId)
Get details about a specific user group- Parameters:
groupId
- identifier for aUserGroup
- Returns:
UserGroupDetails
-
updateUserGroupDetails
public void updateUserGroupDetails(java.lang.Long groupId, FieldUpdate update)
Update user group details- Parameters:
groupId
- identifier for anUserGroup
to updateupdate
- details about which field and value to update
-
getUserGroupRoles
public java.util.List<UserGroupRole> getUserGroupRoles(java.util.Locale locale)
Get a list of all user group roles with their translations- Parameters:
locale
- current usersLocale
- Returns:
- list of
UserGroupRole
-
getAvailableUsersForUserGroup
public java.util.List<User> getAvailableUsersForUserGroup(java.lang.Long groupId, java.lang.String query)
Get a list of system users who are not on the project yet.
-
addMemberToUserGroup
public java.lang.String addMemberToUserGroup(java.lang.Long groupId, java.lang.Long userId, java.lang.String role, java.util.Locale locale)
Add a new member to the user group
-
updateUserRoleOnUserGroup
public java.lang.String updateUserRoleOnUserGroup(java.lang.Long groupId, java.lang.Long userId, java.lang.String role, java.util.Locale locale) throws UserGroupWithoutOwnerException
Update a users role on a project- Parameters:
groupId
- identifier for aUserGroup
userId
- identifier for aUser
role
- role to update the user tolocale
- Current usersLocale
- Returns:
- Message to user about the result of the update
- Throws:
UserGroupWithoutOwnerException
- thrown if changing the users role would result in the user group not having an owner
-
removeMemberFromUserGroup
public java.lang.String removeMemberFromUserGroup(java.lang.Long groupId, java.lang.Long userId, java.util.Locale locale) throws UserGroupWithoutOwnerException
Remove a user from an user group- Parameters:
groupId
- identifier for aUserGroup
userId
- identifier for aUser
locale
- current usersLocale
- Returns:
- Message to user about the result of removing the user
- Throws:
UserGroupWithoutOwnerException
- thrown if removing the user would result in the user group not having an owner
-
getProjectsForUserGroup
public java.util.List<UserGroupProjectTableModel> getProjectsForUserGroup(java.lang.Long groupId, java.util.Locale locale)
Gets a list of projects that are on a user group- Parameters:
groupId
- identifier for anUserGroup
locale
- current usersLocale
- Returns:
- list of
UserGroupProjectTableModel
-
createNewUserGroup
public java.lang.Long createNewUserGroup(UserGroup userGroup, java.util.Locale locale) throws UIConstraintViolationException
Crate a newUserGroup
- Parameters:
userGroup
-UserGroup
name and descriptionlocale
- current usersLocale
- Returns:
- the identifier for the new user groups
- Throws:
UIConstraintViolationException
- if one of the constraint violations for aUserGroup
is broken
-
-