com.atlassian.jira.bc.user.search
Class DefaultUserPickerSearchService

java.lang.Object
  extended by com.atlassian.jira.bc.user.search.DefaultUserPickerSearchService
All Implemented Interfaces:
UserPickerSearchService

public class DefaultUserPickerSearchService
extends java.lang.Object
implements UserPickerSearchService


Constructor Summary
DefaultUserPickerSearchService(UserManager userManager, ApplicationProperties applicationProperties, PermissionManager permissionManager)
          Constructs a DefaultUserPickerSearchService
 
Method Summary
 boolean canPerformAjaxSearch(JiraServiceContext jiraServiceContext)
          Returns true only if UserPicker Ajax search is enabled AND the user in the context has User Browse permission.
 boolean canShowEmailAddresses(JiraServiceContext jiraServiceContext)
          Whether or not the UserPicker Ajax should search or show email addresses
 java.util.Collection<com.opensymphony.user.User> getResults(JiraServiceContext jiraServiceContext, java.lang.String query)
          Get Users based on a query string.
 java.util.Collection<com.opensymphony.user.User> getResultsSearchForEmptyQuery(JiraServiceContext jiraServiceContext, java.lang.String query)
          Get Users based on a query string.
 boolean isAjaxSearchEnabled()
          Returns true only if UserPicker Ajax search is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUserPickerSearchService

public DefaultUserPickerSearchService(UserManager userManager,
                                      ApplicationProperties applicationProperties,
                                      PermissionManager permissionManager)
Constructs a DefaultUserPickerSearchService

Parameters:
userManager - the UserUtil needed
applicationProperties - the ApplicationProperties
permissionManager - needed to resolve permissions
Method Detail

getResults

public java.util.Collection<com.opensymphony.user.User> getResults(JiraServiceContext jiraServiceContext,
                                                                   java.lang.String query)
Description copied from interface: UserPickerSearchService
Get Users based on a query string. Matches on the start of username, Each word in Full Name & email

Specified by:
getResults in interface UserPickerSearchService
Parameters:
jiraServiceContext - Jira Service Context
query - String to search for.
Returns:
Collection of User objects that match criteria.
See Also:
UserPickerSearchService.getResults(com.atlassian.jira.bc.JiraServiceContext,String)

getResultsSearchForEmptyQuery

public java.util.Collection<com.opensymphony.user.User> getResultsSearchForEmptyQuery(JiraServiceContext jiraServiceContext,
                                                                                      java.lang.String query)
Description copied from interface: UserPickerSearchService
Get Users based on a query string. Matches on the start of username, Each word in Full Name & email. This will search even if the query passed is null or empty.

Specified by:
getResultsSearchForEmptyQuery in interface UserPickerSearchService
Parameters:
jiraServiceContext - Jira Service Context
query - String to search for.
Returns:
Collection of User objects that match criteria.
See Also:
UserPickerSearchService.getResults(com.atlassian.jira.bc.JiraServiceContext,String)

canShowEmailAddresses

public boolean canShowEmailAddresses(JiraServiceContext jiraServiceContext)
Description copied from interface: UserPickerSearchService
Whether or not the UserPicker Ajax should search or show email addresses

Specified by:
canShowEmailAddresses in interface UserPickerSearchService
Parameters:
jiraServiceContext - Jira Service Context
Returns:
True if email addresses can be shown, otherwise false
See Also:
UserPickerSearchService.canShowEmailAddresses(com.atlassian.jira.bc.JiraServiceContext)

canPerformAjaxSearch

public boolean canPerformAjaxSearch(JiraServiceContext jiraServiceContext)
Description copied from interface: UserPickerSearchService
Returns true only if UserPicker Ajax search is enabled AND the user in the context has User Browse permission.

Specified by:
canPerformAjaxSearch in interface UserPickerSearchService
Parameters:
jiraServiceContext - Jira Service Context
Returns:
True if enabled, otherwise false
See Also:
UserPickerSearchService.canPerformAjaxSearch(com.atlassian.jira.bc.JiraServiceContext)

isAjaxSearchEnabled

public boolean isAjaxSearchEnabled()
Description copied from interface: UserPickerSearchService
Returns true only if UserPicker Ajax search is enabled.

Specified by:
isAjaxSearchEnabled in interface UserPickerSearchService
Returns:
true if enabled.


Copyright © 2002-2010 Atlassian. All Rights Reserved.