public class DefaultUserPickerSearchService extends Object implements UserPickerSearchService
Constructor and Description |
---|
DefaultUserPickerSearchService(UserManager userManager,
ApplicationProperties applicationProperties,
JiraAuthenticationContext authenticationContext,
PermissionManager permissionManager,
GroupManager groupManager,
ProjectManager projectManager,
ProjectRoleManager projectRoleManager)
Constructs a DefaultUserPickerSearchService
|
Modifier and Type | Method and Description |
---|---|
boolean |
canPerformAjaxSearch(ApplicationUser user)
Determines whether the given user could perform AJAX search.
|
boolean |
canPerformAjaxSearch(JiraServiceContext jiraServiceContext)
Returns true only if UserPicker Ajax search is enabled AND the user in the context has User Browse permission.
|
boolean |
canPerformAjaxSearch(com.atlassian.crowd.embedded.api.User user) |
boolean |
canShowEmailAddresses(JiraServiceContext jiraServiceContext)
Whether or not the UserPicker Ajax should search or show email addresses
|
List<com.atlassian.crowd.embedded.api.User> |
findUsers(JiraServiceContext jiraServiceContext,
String query)
Get Users based on a query string.
|
List<com.atlassian.crowd.embedded.api.User> |
findUsers(JiraServiceContext jiraServiceContext,
String query,
UserSearchParams userSearchParams)
Get Users based on a query string.
|
List<com.atlassian.crowd.embedded.api.User> |
findUsers(String nameQuery,
String emailQuery,
UserSearchParams userSearchParams)
Get Users based on query strings.
|
List<com.atlassian.crowd.embedded.api.User> |
findUsers(String query,
UserSearchParams userSearchParams)
Get Users based on a query string.
|
List<com.atlassian.crowd.embedded.api.User> |
findUsersAllowEmptyQuery(JiraServiceContext jiraServiceContext,
String query)
Get Users based on a query string.
|
com.atlassian.crowd.embedded.api.User |
getUserByName(JiraServiceContext jiraServiceContext,
String query)
Returns a user by exact username
|
boolean |
userMatches(ApplicationUser user,
UserSearchParams userSearchParams)
Determine whether a user matches the search criteria specified in the
userSearchParams parameter. |
public DefaultUserPickerSearchService(UserManager userManager, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, GroupManager groupManager, ProjectManager projectManager, ProjectRoleManager projectRoleManager)
userManager
- the UserUtil neededapplicationProperties
- the ApplicationPropertiesauthenticationContext
- permissionManager
- needed to resolve permissionsprojectManager
- projectRoleManager
- public List<com.atlassian.crowd.embedded.api.User> findUsers(JiraServiceContext jiraServiceContext, String query)
UserPickerSearchService
Matches on the start of username and each word in Full Name & email. Only returns active users.
Results are sorted according to the UserCachingComparator
.
findUsers
in interface UserPickerSearchService
jiraServiceContext
- Jira Service Contextquery
- String to search for.User
objects that match criteria.UserPickerSearchService.findUsers(com.atlassian.jira.bc.JiraServiceContext, String, UserSearchParams)
public com.atlassian.crowd.embedded.api.User getUserByName(JiraServiceContext jiraServiceContext, String query)
UserPickerSearchService
getUserByName
in interface UserPickerSearchService
jiraServiceContext
- Jira Service Contextquery
- String to search for.User
object with supplied username.public List<com.atlassian.crowd.embedded.api.User> findUsersAllowEmptyQuery(JiraServiceContext jiraServiceContext, String query)
UserPickerSearchService
Matches on the start of username and each word in Full Name & email. This will search even if the query passed is null or empty. Only returns active users.
Results are sorted according to the UserCachingComparator
.
findUsersAllowEmptyQuery
in interface UserPickerSearchService
jiraServiceContext
- Jira Service Contextquery
- String to search for.User
objects that match criteria.UserPickerSearchService.findUsers(com.atlassian.jira.bc.JiraServiceContext, String, UserSearchParams)
public List<com.atlassian.crowd.embedded.api.User> findUsers(JiraServiceContext jiraServiceContext, String query, UserSearchParams userSearchParams)
UserPickerSearchService
Matches on the start of username and each word in Full Name & email.
Results are sorted according to the UserCachingComparator
.
findUsers
in interface UserPickerSearchService
jiraServiceContext
- Jira Service Contextquery
- String to search for.userSearchParams
- Additional search parametersUser
objects that match criteria.public List<com.atlassian.crowd.embedded.api.User> findUsers(String query, UserSearchParams userSearchParams)
UserPickerSearchService
Matches on the start of username and each word in Full Name & email.
Matches email only when userSearchParams.canMatchEmail() is true. Results are sorted according to the userSearchParams.comparator. If userSearchParams.comparator is null, no sorting will be performed.
findUsers
in interface UserPickerSearchService
query
- the query to search username, display name and email addressuserSearchParams
- the search criteriapublic List<com.atlassian.crowd.embedded.api.User> findUsers(String nameQuery, String emailQuery, UserSearchParams userSearchParams)
UserPickerSearchService
Matches nameQuery on the start of username and each word in Full Name & email.
Matches emailQuery on start of email. Email matching is performed only when userSearchParams.canMatchEmail() is true. Results are sorted according to the userSearchParams.comparator. If userSearchParams.comparator is null, no sorting will be performed.
findUsers
in interface UserPickerSearchService
nameQuery
- the query to search username and display name.emailQuery
- the query to search email address, subject to userSearchParams.canMatchEmail.userSearchParams
- the search criteriapublic boolean userMatches(ApplicationUser user, UserSearchParams userSearchParams)
UserPickerSearchService
userSearchParams
parameter.
allowEmptyQuery in userSearchParams
is ignored.
userMatches
in interface UserPickerSearchService
user
- the user to be matcheduserSearchParams
- the search criteriapublic boolean canShowEmailAddresses(JiraServiceContext jiraServiceContext)
UserPickerSearchService
canShowEmailAddresses
in interface UserPickerSearchService
jiraServiceContext
- Jira Service ContextUserPickerSearchService.canShowEmailAddresses(com.atlassian.jira.bc.JiraServiceContext)
public boolean canPerformAjaxSearch(JiraServiceContext jiraServiceContext)
UserPickerSearchService
canPerformAjaxSearch
in interface UserPickerSearchService
jiraServiceContext
- Jira Service Contextpublic boolean canPerformAjaxSearch(com.atlassian.crowd.embedded.api.User user)
canPerformAjaxSearch
in interface UserPickerSearchService
UserPickerSearchService.canPerformAjaxSearch(com.atlassian.jira.bc.JiraServiceContext)
public boolean canPerformAjaxSearch(ApplicationUser user)
UserPickerSearchService
canPerformAjaxSearch
in interface UserPickerSearchService
Copyright © 2002-2015 Atlassian. All Rights Reserved.