com.atlassian.jira.issue.search.searchers.impl
Class AbstractUserSearcher

java.lang.Object
  extended by com.atlassian.jira.issue.search.searchers.impl.AbstractIssueSearcher
      extended by com.atlassian.jira.issue.search.searchers.impl.AbstractUserSearcher
All Implemented Interfaces:
Field, IssueSearcher, Comparable
Direct Known Subclasses:
AssigneeSearcher, ReporterSearcher, UserPickerGroupSearcher

public abstract class AbstractUserSearcher
extends AbstractIssueSearcher


Field Summary
protected  ApplicationProperties applicationProperties
           
protected  UserPickerSearchService searchService
           
static String SELECT_LIST_GROUP
           
static String SELECT_LIST_NONE
           
static String SELECT_LIST_USER
           
 
Fields inherited from class com.atlassian.jira.issue.search.searchers.impl.AbstractIssueSearcher
authenticationContext, EDIT_TEMPLATE_SUFFIX, field, VIEW_TEMPLATE_SUFFIX
 
Fields inherited from interface com.atlassian.jira.issue.search.searchers.IssueSearcher
I18N_BUNDLE, log
 
Constructor Summary
AbstractUserSearcher(JiraAuthenticationContext authenticationContext, ApplicationProperties applicationProperties, UserPickerSearchService searchService)
           
 
Method Summary
 String getEditHtml(SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action)
           
protected  I18nBean getI18nBean()
           
 String getLinkedGroup(FieldValuesHolder fieldValuesHolder)
           
 String getLinkedUser(FieldValuesHolder fieldValuesHolder)
           
protected abstract  String getNoneValue()
           
 String getQuerySnippet(SearchRequest searchRequest)
          Returns a JiraUrlCodec.encode(String) encoded string representing the relevent SearchParameter in the searchRequest.
abstract  List getSelectListOptions()
           
 String getTextForuser(FieldValuesHolder fieldValuesHolder)
           
abstract  String getUserField()
           
protected abstract  String getUserGroupSearchParamName()
           
protected abstract  String getUserSearchParamName()
           
abstract  String getUserSelect()
           
protected  Map getVelocityParams(SearchContext searchContext, FieldLayoutItem fieldLayoutItem, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action)
           
 String getViewHtml(SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action)
           
 boolean isRevelentForSeachRequest(SearchRequest searchRequest)
          Checks if the searchRequest object has SearchParameter objects that was created by the searcher
 void populateFromParams(FieldValuesHolder fieldValuesHolder, ActionParams actionParams)
          Populate FieldValuesHolder object with whatever values the searcher is interested in from the ActionParams
 void populateFromSearchRequest(FieldValuesHolder fieldValuesHolder, SearchRequest searchRequest)
          Populate FieldValuesHolder from the SearchRequest object.
 void populateSearchRequest(SearchRequest searchRequest, FieldValuesHolder fieldValuesHolder)
          Populate the SearchRequest with SearchParameter objects from the FieldValuesHolder
 void validateParams(SearchContext searchContext, FieldValuesHolder fieldValuesHolder, I18nHelper i18nHelper, ErrorCollection errors)
          Adds error meessages to the errors object if values in the fieldValuesHolder fails validation.
 
Methods inherited from class com.atlassian.jira.issue.search.searchers.impl.AbstractIssueSearcher
compareTo, equals, getI18n, getName, hashCode, hasPermission, init, isShown, register, renderEditTemplate, renderViewTemplate, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.issue.search.searchers.IssueSearcher
getRelatedIndexers
 
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getNameKey
 

Field Detail

SELECT_LIST_NONE

public static final String SELECT_LIST_NONE
See Also:
Constant Field Values

SELECT_LIST_USER

public static final String SELECT_LIST_USER
See Also:
Constant Field Values

SELECT_LIST_GROUP

public static final String SELECT_LIST_GROUP
See Also:
Constant Field Values

applicationProperties

protected final ApplicationProperties applicationProperties

searchService

protected final UserPickerSearchService searchService
Constructor Detail

AbstractUserSearcher

public AbstractUserSearcher(JiraAuthenticationContext authenticationContext,
                            ApplicationProperties applicationProperties,
                            UserPickerSearchService searchService)
Method Detail

getEditHtml

public String getEditHtml(SearchContext searchContext,
                          FieldValuesHolder fieldValuesHolder,
                          Map displayParameters,
                          webwork.action.Action action)
Specified by:
getEditHtml in interface IssueSearcher
Overrides:
getEditHtml in class AbstractIssueSearcher

getViewHtml

public String getViewHtml(SearchContext searchContext,
                          FieldValuesHolder fieldValuesHolder,
                          Map displayParameters,
                          webwork.action.Action action)
Specified by:
getViewHtml in interface IssueSearcher
Overrides:
getViewHtml in class AbstractIssueSearcher

getQuerySnippet

public String getQuerySnippet(SearchRequest searchRequest)
Description copied from interface: IssueSearcher
Returns a JiraUrlCodec.encode(String) encoded string representing the relevent SearchParameter in the searchRequest. The queryString should be able to be converted back to the original SearchRequest. i.e. getQuerySnippet -> String -> populateFromParams -> FieldValuesHolder -> populateSearchRequest -> SearchRequest -> getQuerySnippet should return the same original string.

Parameters:
searchRequest - relevent search request
Returns:
JiraUrlCodec.encode(String) encoded string representing the relevent SearchParameter in the searchRequest

validateParams

public void validateParams(SearchContext searchContext,
                           FieldValuesHolder fieldValuesHolder,
                           I18nHelper i18nHelper,
                           ErrorCollection errors)
Description copied from interface: IssueSearcher
Adds error meessages to the errors object if values in the fieldValuesHolder fails validation.

Parameters:
searchContext - the context of the search (i.e. projects and issue types selected)
fieldValuesHolder - contains values populated by the searchers

populateFromParams

public void populateFromParams(FieldValuesHolder fieldValuesHolder,
                               ActionParams actionParams)
Description copied from interface: IssueSearcher
Populate FieldValuesHolder object with whatever values the searcher is interested in from the ActionParams

Parameters:
fieldValuesHolder - contains values populated by the searchers
actionParams - params from the webwork front end

populateFromSearchRequest

public void populateFromSearchRequest(FieldValuesHolder fieldValuesHolder,
                                      SearchRequest searchRequest)
Description copied from interface: IssueSearcher
Populate FieldValuesHolder from the SearchRequest object. Which SearchParameter really to take from the SR should match with the method IssueSearcher.populateSearchRequest(SearchRequest, FieldValuesHolder)

Parameters:
fieldValuesHolder - contains values populated by the searchers
searchRequest - relevent search request
See Also:
IssueSearcher.populateSearchRequest(SearchRequest, FieldValuesHolder)

populateSearchRequest

public void populateSearchRequest(SearchRequest searchRequest,
                                  FieldValuesHolder fieldValuesHolder)
Description copied from interface: IssueSearcher
Populate the SearchRequest with SearchParameter objects from the FieldValuesHolder

Parameters:
searchRequest - relevent search request
fieldValuesHolder - contains values populated by the searchers

isRevelentForSeachRequest

public boolean isRevelentForSeachRequest(SearchRequest searchRequest)
Description copied from interface: IssueSearcher
Checks if the searchRequest object has SearchParameter objects that was created by the searcher

Parameters:
searchRequest - relevent search request
Returns:
true if the searchRequest has relevent parameters to the searchers

getSelectListOptions

public abstract List getSelectListOptions()

getUserField

public abstract String getUserField()

getUserSelect

public abstract String getUserSelect()

getNoneValue

protected abstract String getNoneValue()

getUserGroupSearchParamName

protected abstract String getUserGroupSearchParamName()

getUserSearchParamName

protected abstract String getUserSearchParamName()

getTextForuser

public String getTextForuser(FieldValuesHolder fieldValuesHolder)

getLinkedUser

public String getLinkedUser(FieldValuesHolder fieldValuesHolder)

getLinkedGroup

public String getLinkedGroup(FieldValuesHolder fieldValuesHolder)

getI18nBean

protected I18nBean getI18nBean()

getVelocityParams

protected Map getVelocityParams(SearchContext searchContext,
                                FieldLayoutItem fieldLayoutItem,
                                FieldValuesHolder fieldValuesHolder,
                                Map displayParameters,
                                webwork.action.Action action)
Overrides:
getVelocityParams in class AbstractIssueSearcher


Copyright © 2002-2008 Atlassian. All Rights Reserved.