Class UserGroupsAjaxController


  • @RestController
    @RequestMapping("/ajax/user-groups")
    public class UserGroupsAjaxController
    extends java.lang.Object
    Controller for asynchronous request for User Groups
    • 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 group
      org.springframework.http.ResponseEntity<java.util.Map<java.lang.String,​java.lang.String>> createNewUserGroup​(UserGroup userGroup, java.util.Locale locale)
      Create a new UserGroup
      org.springframework.http.ResponseEntity<java.lang.String> deleteUserGroup​(java.lang.Long id, java.util.Locale locale)
      Delete a specific user group
      org.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 query
      org.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 on
      org.springframework.http.ResponseEntity<UserGroupDetails> getUserGroupDetails​(java.lang.Long groupId)
      Get the details about a user group
      java.util.List<UserGroupRole> getUserGroupRoles​(java.util.Locale locale)
      Get a list of all user group roles
      org.springframework.http.ResponseEntity<TableResponse<UserGroupTableModel>> getUserGroups​(TableRequest request)
      Gat a paged list of user groups
      org.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 group
      void updateGroupDetails​(java.lang.Long groupId, FieldUpdate update)
      Update the details within a user group
      org.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 delete
        locale - 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 group
        update - 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 users Locale
        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 group
        userId - Identifier for a user
        role - role to update the user to in the user group
        locale - 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 group
        query - 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 group
        userId - identifier for the User
        role - role to assign to the user
        locale - current users Locale
        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 group
        userId - Identifier for the member to remove from the user group
        locale - current users Locale
        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 group
        locale - current users Locale
        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 new UserGroup
        Parameters:
        userGroup - New UserGroup to create from UI form fields (name and role)
        locale - current users Locale
        Returns:
        message to the user about the result of creating the group