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

java.lang.Object
  extended bycom.atlassian.jira.issue.search.searchers.impl.AbstractIssueSearcher
      extended bycom.atlassian.jira.issue.search.searchers.impl.QuerySearcher
All Implemented Interfaces:
Comparable, Field, IssueSearcher

public class QuerySearcher
extends AbstractIssueSearcher
implements IssueSearcher


Field Summary
static String COMMENT_FIELD
           
static String DESCRIPTION_FIELD
           
static String ENVIRONMENT_FIELDS
           
static String ID
           
static List INVALID_FIRST_CHAR_LIST
           
static String LUCENE_PARAM_NAME
           
static String NAME_KEY
           
static List QUERY_FIELDS_DEFAULT
           
static String QUERY_FIELDS_ID
           
static List QUERY_FIELDS_LIST
           
static String SUMMARY_FIELD
           
 
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
QuerySearcher(JiraAuthenticationContext authenticationContext, FieldVisibilityBean fieldVisibilityBean)
           
 
Method Summary
 String getId()
          The unique id of the field
 String getNameKey()
          The i18n key that is used to lookup the field's name when it is displayed
 Collection getQueryFieldNames(FieldValuesHolder fieldValuesHolder)
           
 String getQuerySnippet(SearchRequest searchRequest)
          Returns a JiraUrlCodec.encode(String) encoded string representing the relevent SearchParameter in the searchRequest.
 List getRelatedIndexers()
          Returns a list of FieldIndexer objects.
 boolean isFieldSelected(String fieldId, FieldValuesHolder fieldValuesHolder)
           
 boolean isFieldVisible(String fieldId, FieldValuesHolder fieldValuesHolder, SearchContext searchContext)
           
 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 updateSearchRequestParams(SearchRequest searchRequest, Collection fields, String query)
          A simple method to update a search request.
 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, getEditHtml, getI18n, getName, getVelocityParams, getViewHtml, 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
getEditHtml, getViewHtml, init, isShown, register
 
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

INVALID_FIRST_CHAR_LIST

public static final List INVALID_FIRST_CHAR_LIST

ID

public static final String ID
See Also:
Constant Field Values

NAME_KEY

public static final String NAME_KEY
See Also:
Constant Field Values

SUMMARY_FIELD

public static final String SUMMARY_FIELD
See Also:
Constant Field Values

DESCRIPTION_FIELD

public static final String DESCRIPTION_FIELD
See Also:
Constant Field Values

ENVIRONMENT_FIELDS

public static final String ENVIRONMENT_FIELDS
See Also:
Constant Field Values

COMMENT_FIELD

public static final String COMMENT_FIELD
See Also:
Constant Field Values

QUERY_FIELDS_ID

public static final String QUERY_FIELDS_ID
See Also:
Constant Field Values

QUERY_FIELDS_LIST

public static final List QUERY_FIELDS_LIST

QUERY_FIELDS_DEFAULT

public static final List QUERY_FIELDS_DEFAULT

LUCENE_PARAM_NAME

public static final String LUCENE_PARAM_NAME
See Also:
Constant Field Values
Constructor Detail

QuerySearcher

public QuerySearcher(JiraAuthenticationContext authenticationContext,
                     FieldVisibilityBean fieldVisibilityBean)
Method Detail

getId

public String getId()
Description copied from interface: Field
The unique id of the field

Specified by:
getId in interface Field

getNameKey

public String getNameKey()
Description copied from interface: Field
The i18n key that is used to lookup the field's name when it is displayed

Specified by:
getNameKey in interface Field

getRelatedIndexers

public List getRelatedIndexers()
Description copied from interface: IssueSearcher
Returns a list of FieldIndexer objects. The objects should be initialised and ready for action

Specified by:
getRelatedIndexers in interface IssueSearcher
Returns:
List of FieldIndexer objects. Must not be null. Return Collections.EMPTY_LIST if not available

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.

Specified by:
validateParams in interface IssueSearcher
Parameters:
searchContext - the context of the search (i.e. projects and issue types selected)
fieldValuesHolder - contains values populated by the searchers
i18nHelper -
errors -

updateSearchRequestParams

public void updateSearchRequestParams(SearchRequest searchRequest,
                                      Collection fields,
                                      String query)
                               throws IllegalArgumentException
A simple method to update a search request. This can be used if you are building your own search requests (for example to use in SOAP or RPC).

Throws:
IllegalArgumentException - If the query passed is not a valid query

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

Specified by:
populateFromParams in interface IssueSearcher
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)

Specified by:
populateFromSearchRequest in interface IssueSearcher
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

Specified by:
populateSearchRequest in interface IssueSearcher
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

Specified by:
isRevelentForSeachRequest in interface IssueSearcher
Parameters:
searchRequest - relevent search request
Returns:
true if the searchRequest has relevent parameters to the searchers

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.

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

isFieldSelected

public boolean isFieldSelected(String fieldId,
                               FieldValuesHolder fieldValuesHolder)

isFieldVisible

public boolean isFieldVisible(String fieldId,
                              FieldValuesHolder fieldValuesHolder,
                              SearchContext searchContext)

getQueryFieldNames

public Collection getQueryFieldNames(FieldValuesHolder fieldValuesHolder)


Copyright © 2002-2006 Atlassian. All Rights Reserved.