Class UserGroupsAjaxController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.ajax.users.UserGroupsAjaxController
-
@RestController @RequestMapping("/ajax/user-groups") public class UserGroupsAjaxController extends java.lang.Object
Controller for asynchronous request for User Groups
-
-
Constructor Summary
Constructors Constructor Description UserGroupsAjaxController(UIUserGroupsService userGroupService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<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 grouporg.springframework.http.ResponseEntity<java.util.Map<java.lang.String,java.lang.String>>
createNewUserGroup(UserGroup userGroup, java.util.Locale locale)
Create a newUserGroup
org.springframework.http.ResponseEntity<java.lang.String>
deleteUserGroup(java.lang.Long id, java.util.Locale locale)
Delete a specific user grouporg.springframework.http.ResponseEntity<java.util.List<User>>
getAvailableUsersForUserGroup(java.lang.Long groupId, java.lang.String query)
Get a listing of available users for the user group filtered by a text queryorg.springframework.http.ResponseEntity<java.util.List<UserGroupProjectTableModel>>
getProjectsForUserGroup(java.lang.Long groupId, java.util.Locale locale)
Get a full listing of all projects that this user group is onorg.springframework.http.ResponseEntity<UserGroupDetails>
getUserGroupDetails(java.lang.Long groupId)
Get the details about a user groupjava.util.List<UserGroupRole>
getUserGroupRoles(java.util.Locale locale)
Get a list of all user group rolesorg.springframework.http.ResponseEntity<TableResponse<UserGroupTableModel>>
getUserGroups(TableRequest request)
Gat a paged list of user groupsorg.springframework.http.ResponseEntity<java.lang.String>
removeMemberFromUserGroup(java.lang.Long groupId, java.lang.Long userId, java.util.Locale locale)
Remove a member from the user groupvoid
updateGroupDetails(java.lang.Long groupId, FieldUpdate update)
Update the details within a user grouporg.springframework.http.ResponseEntity<java.lang.String>
updateUserRoleOnUserGroup(java.lang.Long groupId, java.lang.Long userId, java.lang.String role, java.util.Locale locale)
Update a group members role on the user groups
-
-
-
Constructor Detail
-
UserGroupsAjaxController
public UserGroupsAjaxController(UIUserGroupsService userGroupService)
-
-
Method Detail
-
getUserGroups
@RequestMapping("/list") public org.springframework.http.ResponseEntity<TableResponse<UserGroupTableModel>> getUserGroups(@RequestBody 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
@RequestMapping(value="", method=DELETE) public org.springframework.http.ResponseEntity<java.lang.String> deleteUserGroup(@RequestParam 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
@RequestMapping(value="/{groupId}", method=GET) public org.springframework.http.ResponseEntity<UserGroupDetails> getUserGroupDetails(@PathVariable java.lang.Long groupId)
Get the details about a user group- Parameters:
groupId
- identifier for a user group- Returns:
- details about a user group
-
updateGroupDetails
@RequestMapping(value="/{groupId}/update", method=PUT) public void updateGroupDetails(@PathVariable java.lang.Long groupId, @RequestBody FieldUpdate update)
Update the details within a user group- Parameters:
groupId
- identifier for the user groupupdate
-FieldUpdate
containing name of field to update and the new value
-
getUserGroupRoles
@RequestMapping("/roles") public java.util.List<UserGroupRole> getUserGroupRoles(java.util.Locale locale)
Get a list of all user group roles- Parameters:
locale
- current usersLocale
- Returns:
- list of all internationalized user group roles
-
updateUserRoleOnUserGroup
@RequestMapping(value="/{groupId}/member/role", method=PUT) public org.springframework.http.ResponseEntity<java.lang.String> updateUserRoleOnUserGroup(@PathVariable java.lang.Long groupId, @RequestParam java.lang.Long userId, @RequestParam java.lang.String role, java.util.Locale locale)
Update a group members role on the user groups- Parameters:
groupId
- Identifier for an user groupuserId
- Identifier for a userrole
- role to update the user to in the user grouplocale
- current users locale- Returns:
- message to user about the result of the update
-
getAvailableUsersForUserGroup
@RequestMapping("/{groupId}/available") public org.springframework.http.ResponseEntity<java.util.List<User>> getAvailableUsersForUserGroup(@PathVariable java.lang.Long groupId, @RequestParam java.lang.String query)
Get a listing of available users for the user group filtered by a text query- Parameters:
groupId
- identifier for the user groupquery
- string term to filter the list of users by- Returns:
- listing of available users
-
addMemberToUserGroup
@RequestMapping(value="/{groupId}/add", method=POST) public org.springframework.http.ResponseEntity<java.lang.String> addMemberToUserGroup(@PathVariable java.lang.Long groupId, @RequestParam java.lang.Long userId, @RequestParam java.lang.String role, java.util.Locale locale)
Add a new member to the user group- Parameters:
groupId
- Identifier for the user groupuserId
- identifier for theUser
role
- role to assign to the userlocale
- current usersLocale
- Returns:
- message to the user about the result of adding the user
-
removeMemberFromUserGroup
@RequestMapping(value="/{groupId}/remove", method=DELETE) public org.springframework.http.ResponseEntity<java.lang.String> removeMemberFromUserGroup(@PathVariable java.lang.Long groupId, @RequestParam java.lang.Long userId, java.util.Locale locale)
Remove a member from the user group- Parameters:
groupId
- Identifier for the user groupuserId
- Identifier for the member to remove from the user grouplocale
- current usersLocale
- Returns:
- message to the user about the result of removing the member
-
getProjectsForUserGroup
@RequestMapping("/{groupId}/projects") public org.springframework.http.ResponseEntity<java.util.List<UserGroupProjectTableModel>> getProjectsForUserGroup(@PathVariable java.lang.Long groupId, java.util.Locale locale)
Get a full listing of all projects that this user group is on- Parameters:
groupId
- Identifier for a user grouplocale
- current usersLocale
- Returns:
- list of
UserGroupProjectTableModel
that this user group is on
-
createNewUserGroup
@RequestMapping(value="/create", method=POST) public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String,java.lang.String>> createNewUserGroup(@RequestBody UserGroup userGroup, java.util.Locale locale)
Create a newUserGroup
- Parameters:
userGroup
- NewUserGroup
to create from UI form fields (name and role)locale
- current usersLocale
- Returns:
- message to the user about the result of creating the group
-
-