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

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

public class SearchContextSearcher
extends AbstractIssueSearcher


Field Summary
protected  ConstantsManager constantsManager
           
static String ID
           
static String ISSUE_TYPES_KEY
           
protected  IssueTypeSchemeManager issueTypeSchemeManager
           
static String NAME_KEY
           
protected  OptionSetManager optionSetManager
           
protected  PermissionManager permissionManager
           
static String PROJECT_KEY
           
protected  ProjectManager projectManager
           
protected  SubTaskManager subTaskManager
           
 
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
SearchContextSearcher(JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, SubTaskManager subTaskManager, ConstantsManager constantsManager, ProjectManager projectManager, IssueTypeSchemeManager issueTypeSchemeManager, OptionSetManager optionSetManager)
           
 
Method Summary
 String getCssClassForOption(Option option)
           
 String getEditHtml(SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action)
           
 org.ofbiz.core.entity.GenericValue getFirstProject()
           
 String getId()
          The unique id of the field
 String getIssueTypeFieldId()
           
 String getNameKey()
          The i18n key that is used to lookup the field's name when it is displayed
 String getProjectFieldId()
           
 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.
static SearchContext getSearchContext(FieldValuesHolder fieldValuesHolder)
           
 String getViewHtml(SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action)
           
 Collection getVisibleProjects()
           
 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, Collection projectIds, Collection issueTypeIds)
          Populates the searchRequest given the list of project ids and issue type ids
 void populateSearchRequest(SearchRequest searchRequest, FieldValuesHolder fieldValuesHolder)
          Populate the SearchRequest with SearchParameter objects from the FieldValuesHolder
static SearchContextSearcher retrieveSearcher(SearcherRegistry searcherRegistry)
           
 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, getVelocityParams, hashCode, hasPermission, init, isShown, register, renderEditTemplate, renderViewTemplate, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
See Also:
Constant Field Values

NAME_KEY

public static final String NAME_KEY
See Also:
Constant Field Values

ISSUE_TYPES_KEY

public static final String ISSUE_TYPES_KEY
See Also:
Constant Field Values

PROJECT_KEY

public static final String PROJECT_KEY
See Also:
Constant Field Values

permissionManager

protected final PermissionManager permissionManager

subTaskManager

protected final SubTaskManager subTaskManager

constantsManager

protected final ConstantsManager constantsManager

projectManager

protected final ProjectManager projectManager

issueTypeSchemeManager

protected final IssueTypeSchemeManager issueTypeSchemeManager

optionSetManager

protected final OptionSetManager optionSetManager
Constructor Detail

SearchContextSearcher

public SearchContextSearcher(JiraAuthenticationContext authenticationContext,
                             PermissionManager permissionManager,
                             SubTaskManager subTaskManager,
                             ConstantsManager constantsManager,
                             ProjectManager projectManager,
                             IssueTypeSchemeManager issueTypeSchemeManager,
                             OptionSetManager optionSetManager)
Method Detail

getId

public String getId()
Description copied from interface: Field
The unique id of the 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


getRelatedIndexers

public List getRelatedIndexers()
Description copied from interface: IssueSearcher
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

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

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

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

getProjectFieldId

public String getProjectFieldId()

getIssueTypeFieldId

public String getIssueTypeFieldId()

getVisibleProjects

public Collection getVisibleProjects()

getFirstProject

public org.ofbiz.core.entity.GenericValue getFirstProject()

getCssClassForOption

public String getCssClassForOption(Option option)

populateSearchRequest

public void populateSearchRequest(SearchRequest searchRequest,
                                  Collection projectIds,
                                  Collection issueTypeIds)
Populates the searchRequest given the list of project ids and issue type ids

Parameters:
searchRequest - search request
projectIds - Collection of Long Null safe
issueTypeIds - Collection of String Null safe. Issue Type ids may contain special issue type ids.
See Also:
ConstantsManager.ALL_ISSUE_TYPES, ConstantsManager.ALL_STANDARD_ISSUE_TYPES, ConstantsManager.ALL_SUB_TASK_ISSUE_TYPES

getSearchContext

public static SearchContext getSearchContext(FieldValuesHolder fieldValuesHolder)

retrieveSearcher

public static SearchContextSearcher retrieveSearcher(SearcherRegistry searcherRegistry)


Copyright © 2002-2008 Atlassian. All Rights Reserved.