com.atlassian.jira.issue.search.searchers
Interface IssueSearcher

All Superinterfaces:
Comparable, Field
All Known Subinterfaces:
CustomFieldSearcher
All Known Implementing Classes:
AbstractCustomFieldSearcher, AbstractIssueSearcher, AbstractMultiCustomFieldSearcher, AbstractSingleValueSearcher, AbstractTextSearcher, AbstractUserSearcher, AffectedVersionsSearcher, AssigneeSearcher, BaseCustomFieldSearcher, CascadingSelectSearcher, ComponentsSearcher, CreatedDateSearcher, DateRangeSearcher, DateTimeRangeSearcher, DueDateSearcher, ExactNumberSearcher, ExactTextSearcher, FixForVersionsSearcher, GenericConstantsSearcher, GenericDateSearcher, GenericProjectConstantsSearcher, GroupPickerSearcher, MultiSelectSearcher, NumberRangeSearcher, PrioritySearcher, ProjectSearcher, QuerySearcher, ReporterSearcher, ResolutionSearcher, SearchContextSearcher, SelectSearcher, StattableTextSearcher, StatusSearcher, TextSearcher, UpdatedDateSearcher, UserPickerGroupSearcher, UserPickerSearcher, VersionSearcher, WorkRatioSearcher

public interface IssueSearcher
extends Field

The interface defines an object responsible for all search related activities in the IssueNavigator. The interface operates similar to the Field objects (e.g. OrderableField. It is responsible for populating itself from ActionParams and SearchRequest as well as all rendering related activities.

CustomField searchers should still extend the sub-interface CustomFieldSearcher.

Since:
JIRA 3.3

Field Summary
static String I18N_BUNDLE
           
static org.apache.log4j.Logger log
           
 
Method Summary
 String getEditHtml(SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action)
           
 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.
 String getViewHtml(SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action)
           
 void init(SearchableField field)
          Initialises the searcher with a given field.
 boolean isRevelentForSeachRequest(SearchRequest searchRequest)
          Checks if the searchRequest object has SearchParameter objects that was created by the searcher
 boolean isShown(SearchContext searchContext)
          Checks if the searcher should be shown in this context
 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 register(SearcherRegistry registry)
          Registers the searcher in the registry.
 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 interface com.atlassian.jira.issue.fields.Field
getId, getName, getNameKey
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

log

static final org.apache.log4j.Logger log

I18N_BUNDLE

static final String I18N_BUNDLE
Method Detail

register

void register(SearcherRegistry registry)
Registers the searcher in the registry. This enables the searcher to have customised behaviours for duplicate duplicate searchers. e.g. the Query searchers could register multiple fields to just one searcher instance, whereas other searchers would simply have multiple instances of the same field.

Parameters:
registry - The Searcher registry

init

void init(SearchableField field)
Initialises the searcher with a given field.

Parameters:
field - the field object. This may be null. (So you can have searchers on non-fields)

getRelatedIndexers

List getRelatedIndexers()
Returns a list of FieldIndexer objects. The objects should be initialised and ready for action

Returns:
List of FieldIndexer objects. Must not be null. Return Collections.EMPTY_LIST if not available

validateParams

void validateParams(SearchContext searchContext,
                    FieldValuesHolder fieldValuesHolder,
                    I18nHelper i18nHelper,
                    ErrorCollection errors)
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
i18nHelper -
errors -

populateFromParams

void populateFromParams(FieldValuesHolder fieldValuesHolder,
                        ActionParams actionParams)
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

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

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

populateSearchRequest

void populateSearchRequest(SearchRequest searchRequest,
                           FieldValuesHolder fieldValuesHolder)
Populate the SearchRequest with SearchParameter objects from the FieldValuesHolder

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

isRevelentForSeachRequest

boolean isRevelentForSeachRequest(SearchRequest searchRequest)
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

isShown

boolean isShown(SearchContext searchContext)
Checks if the searcher should be shown in this context

Parameters:
searchContext - the context of the search (i.e. projects and issue types selected)
Returns:
true if the searcher will appear in the issue navigator

getEditHtml

String getEditHtml(SearchContext searchContext,
                   FieldValuesHolder fieldValuesHolder,
                   Map displayParameters,
                   webwork.action.Action action)

getViewHtml

String getViewHtml(SearchContext searchContext,
                   FieldValuesHolder fieldValuesHolder,
                   Map displayParameters,
                   webwork.action.Action action)

getQuerySnippet

String getQuerySnippet(SearchRequest searchRequest)
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


Copyright © 2002-2008 Atlassian. All Rights Reserved.