com.atlassian.jira.rest.v2.issue
Class UserResource

java.lang.Object
  extended by com.atlassian.jira.rest.v2.issue.UserResource

public class UserResource
extends Object

Since:
4.2

Field Summary
static int DEFAULT_USERS_RETURNED
           
static int MAX_USERS_RETURNED
           
 
Constructor Summary
UserResource(UserUtil userUtil, ContextI18n i18n, EmailFormatter emailFormatter, JiraAuthenticationContext authContext, TimeZoneManager timeZoneManager, AvatarPickerHelper avatarPickerHelper, AvatarManager avatarManager, AvatarService avatarService, AttachmentHelper attachmentHelper, UserPropertyManager userPropertyManager, UserPickerSearchService userPickerSearchService, PermissionManager permissionManager, ProjectService projectService, IssueService issueService, ProjectManager projectManager)
           
 
Method Summary
 javax.ws.rs.core.Response createAvatarFromTemporary(String username, AvatarCroppingBean croppingInstructions)
          Converts temporary avatar into a real avatar
 javax.ws.rs.core.Response deleteAvatar(String username, Long id)
          Deletes avatar
 javax.ws.rs.core.Response findAssignableUsers(String name, String projectKey, String issueKey, Integer startAt, Integer maxResults, javax.ws.rs.core.UriInfo uriInfo)
          Returns a list of users that match the search string.
 javax.ws.rs.core.Response findBulkAssignableUsers(String name, String projectKeysStr, Integer startAt, Integer maxResults, javax.ws.rs.core.UriInfo uriInfo)
          Returns a list of users that match the search string and can be assigned issues for all the given projects.
 javax.ws.rs.core.Response findUsers(String username, Integer startAt, Integer maxResults, javax.ws.rs.core.UriInfo uriInfo)
          Returns a list of users that match the search string.
 javax.ws.rs.core.Response findUsersWithBrowsePermission(String name, String issueKey, String projectKey, Integer startAt, Integer maxResults, javax.ws.rs.core.UriInfo uriInfo)
          Returns a list of users that match the search string.
 javax.ws.rs.core.Response getAllAvatars(String name)
          Returns all avatars which are visible for the currently logged in user.
 javax.ws.rs.core.Response getUser(String name, javax.ws.rs.core.UriInfo uriInfo)
          Returns a user.
 javax.ws.rs.core.Response storeTemporaryAvatar(String username, String filename, Long size, javax.servlet.http.HttpServletRequest request)
          Creates temporary avatar
 javax.ws.rs.core.Response storeTemporaryAvatarUsingMultiPart(String username, com.atlassian.plugins.rest.common.multipart.FilePart filePart, javax.servlet.http.HttpServletRequest request)
          Creates temporary avatar using multipart.
 javax.ws.rs.core.Response updateProjectAvatar(String username, AvatarBean avatarBean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_USERS_RETURNED

public static final int DEFAULT_USERS_RETURNED
See Also:
Constant Field Values

MAX_USERS_RETURNED

public static final int MAX_USERS_RETURNED
See Also:
Constant Field Values
Constructor Detail

UserResource

public UserResource(UserUtil userUtil,
                    ContextI18n i18n,
                    EmailFormatter emailFormatter,
                    JiraAuthenticationContext authContext,
                    TimeZoneManager timeZoneManager,
                    AvatarPickerHelper avatarPickerHelper,
                    AvatarManager avatarManager,
                    AvatarService avatarService,
                    AttachmentHelper attachmentHelper,
                    UserPropertyManager userPropertyManager,
                    UserPickerSearchService userPickerSearchService,
                    PermissionManager permissionManager,
                    ProjectService projectService,
                    IssueService issueService,
                    ProjectManager projectManager)
Method Detail

getUser

public javax.ws.rs.core.Response getUser(String name,
                                         @Context
                                         javax.ws.rs.core.UriInfo uriInfo)
Returns a user. This resource cannot be accessed anonymously.

Parameters:
name - the username

findUsers

public javax.ws.rs.core.Response findUsers(String username,
                                           Integer startAt,
                                           Integer maxResults,
                                           @Context
                                           javax.ws.rs.core.UriInfo uriInfo)
Returns a list of users that match the search string. This resource cannot be accessed anonymously.

Parameters:
username - A string used to search username, Name or e-mail address
startAt - the index of the first user to return (0-based)
maxResults - the maximum number of users to return (defaults to 50). The maximum allowed value is 1000. If you specify a value that is higher than this number, your search results will be truncated.
uriInfo - context used for creating urls in user objects
Returns:
A list of user objects that match the username provided

findAssignableUsers

public javax.ws.rs.core.Response findAssignableUsers(String name,
                                                     String projectKey,
                                                     String issueKey,
                                                     Integer startAt,
                                                     Integer maxResults,
                                                     @Context
                                                     javax.ws.rs.core.UriInfo uriInfo)
Returns a list of users that match the search string. This resource cannot be accessed anonymously. Please note that this resource should be called with an issue key when a list of assignable users is retrieved for editing. For create only a project key should be supplied. The list of assignable users may be incorrect if it's called with the project key for editing.

Parameters:
name - the username
projectKey - the key of the project we are finding assignable users for
issueKey - the issue key for the issue being edited we need to find assignable users for.
startAt - the index of the first user to return (0-based)
maxResults - the maximum number of users to return (defaults to 50). The maximum allowed value is 1000. If you specify a value that is higher than this number, your search results will be truncated.
uriInfo - Context used for constructing user objects
Returns:
a Response with the users matching the query

findUsersWithBrowsePermission

public javax.ws.rs.core.Response findUsersWithBrowsePermission(String name,
                                                               String issueKey,
                                                               String projectKey,
                                                               Integer startAt,
                                                               Integer maxResults,
                                                               @Context
                                                               javax.ws.rs.core.UriInfo uriInfo)
Returns a list of users that match the search string. This resource cannot be accessed anonymously. Given an issue key this resource will provide a list of users that match the search string and have the browse issue permission for the issue provided.

Parameters:
name - the username
issueKey - the issue key for the issue being edited we need to find viewable users for.
projectKey - the optional project key to search for users with if no issueKey is supplied.
startAt - the index of the first user to return (0-based)
maxResults - the maximum number of users to return (defaults to 50). The maximum allowed value is 1000. If you specify a value that is higher than this number, your search results will be truncated.
uriInfo - Context used for constructing user objects
Returns:
a Response with the users matching the query

findBulkAssignableUsers

public javax.ws.rs.core.Response findBulkAssignableUsers(String name,
                                                         String projectKeysStr,
                                                         Integer startAt,
                                                         Integer maxResults,
                                                         @Context
                                                         javax.ws.rs.core.UriInfo uriInfo)
Returns a list of users that match the search string and can be assigned issues for all the given projects. This resource cannot be accessed anonymously.

Parameters:
name - the username
startAt - the index of the first user to return (0-based)
maxResults - the maximum number of users to return (defaults to 50). The maximum allowed value is 1000. If you specify a value that is higher than this number, your search results will be truncated.
projectKeysStr - the keys of the projects we are finding assignable users for, comma-separated
uriInfo - Context used for constructing user objects

getAllAvatars

public javax.ws.rs.core.Response getAllAvatars(String name)
Returns all avatars which are visible for the currently logged in user.

Parameters:
name - username
Returns:
all avatars for given user, which the logged in user has permission to see
Since:
v5.0

createAvatarFromTemporary

public javax.ws.rs.core.Response createAvatarFromTemporary(String username,
                                                           AvatarCroppingBean croppingInstructions)
Converts temporary avatar into a real avatar

Parameters:
username - username
croppingInstructions - cropping instructions
Returns:
created avatar
Since:
v5.0

updateProjectAvatar

public javax.ws.rs.core.Response updateProjectAvatar(String username,
                                                     AvatarBean avatarBean)

storeTemporaryAvatar

public javax.ws.rs.core.Response storeTemporaryAvatar(String username,
                                                      String filename,
                                                      Long size,
                                                      @Context
                                                      javax.servlet.http.HttpServletRequest request)
Creates temporary avatar

Parameters:
username - username
filename - name of file being uploaded
size - size of file
request - servlet request
Returns:
temporary avatar cropping instructions
Since:
v5.0

storeTemporaryAvatarUsingMultiPart

public javax.ws.rs.core.Response storeTemporaryAvatarUsingMultiPart(String username,
                                                                    com.atlassian.plugins.rest.common.multipart.FilePart filePart,
                                                                    @Context
                                                                    javax.servlet.http.HttpServletRequest request)
Creates temporary avatar using multipart. The response is sent back as JSON stored in a textarea. This is because the client uses remote iframing to submit avatars using multipart. So we must send them a valid HTML page back from which the client parses the JSON from.

Parameters:
username - Username
filePart - name of file being uploaded
request - servlet request
Returns:
temporary avatar cropping instructions
Since:
v5.0

deleteAvatar

public javax.ws.rs.core.Response deleteAvatar(String username,
                                              Long id)
Deletes avatar

Parameters:
username - username
id - database id for avatar
Returns:
temporary avatar cropping instructions
Since:
v5.0


Copyright © 2002-2012 Atlassian. All Rights Reserved.