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

java.lang.Object
  extended by com.atlassian.jira.issue.search.searchers.impl.AbstractIssueSearcher
      extended by com.atlassian.jira.issue.search.searchers.impl.GenericProjectConstantsSearcher
All Implemented Interfaces:
Field, IssueSearcher, Comparable
Direct Known Subclasses:
AffectedVersionsSearcher, ComponentsSearcher, FixForVersionsSearcher

public abstract class GenericProjectConstantsSearcher
extends AbstractIssueSearcher


Nested Class Summary
protected  class GenericProjectConstantsSearcher.ComponentLabelTransformer
           
static class GenericProjectConstantsSearcher.GenericProjectConstantsLabel
          A label with an optional url to the browse page
protected  class GenericProjectConstantsSearcher.VersionLabelTransformer
           
 
Field Summary
static long ALL_RELEASED_VERSIONS
           
static long ALL_UNRELEASED_VERSIONS
           
protected  FieldVisibilityBean fieldVisibilityBean
           
static long NO_COMPONENTS
           
static long NO_VERSIONS
           
protected  ProjectManager projectManager
           
protected  VelocityRequestContextFactory velocityRequestContextFactory
           
protected  VersionManager versionManager
           
 
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
GenericProjectConstantsSearcher(JiraAuthenticationContext authenticationContext, FieldVisibilityBean fieldVisibilityBean, VersionManager versionManager, ProjectManager projectManager, VelocityRequestContextFactory velocityRequestContextFactory)
           
 
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.
protected abstract  Collection getSelectedObjects(FieldValuesHolder fieldValuesHolder)
           
protected  Collection getSelectedObjects(FieldValuesHolder fieldValuesHolder, org.apache.commons.collections.Transformer transformer)
           
protected abstract  Collection getSelectListOptions(SearchContext searchContext)
           
protected  List getVersionOptions(SearchContext searchContext, boolean unreleasedFirst)
           
 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
 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 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, 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, populateSearchRequest
 
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getNameKey
 

Field Detail

NO_VERSIONS

public static final long NO_VERSIONS
See Also:
Constant Field Values

ALL_UNRELEASED_VERSIONS

public static final long ALL_UNRELEASED_VERSIONS
See Also:
Constant Field Values

ALL_RELEASED_VERSIONS

public static final long ALL_RELEASED_VERSIONS
See Also:
Constant Field Values

NO_COMPONENTS

public static final long NO_COMPONENTS
See Also:
Constant Field Values

fieldVisibilityBean

protected final FieldVisibilityBean fieldVisibilityBean

versionManager

protected final VersionManager versionManager

projectManager

protected final ProjectManager projectManager

velocityRequestContextFactory

protected final VelocityRequestContextFactory velocityRequestContextFactory
Constructor Detail

GenericProjectConstantsSearcher

public GenericProjectConstantsSearcher(JiraAuthenticationContext authenticationContext,
                                       FieldVisibilityBean fieldVisibilityBean,
                                       VersionManager versionManager,
                                       ProjectManager projectManager,
                                       VelocityRequestContextFactory velocityRequestContextFactory)
Method Detail

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)

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

isShown

public boolean isShown(SearchContext searchContext)
Description copied from interface: IssueSearcher
Checks if the searcher should be shown in this context

Specified by:
isShown in interface IssueSearcher
Overrides:
isShown in class AbstractIssueSearcher
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

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

getSelectListOptions

protected abstract Collection getSelectListOptions(SearchContext searchContext)

getSelectedObjects

protected abstract Collection getSelectedObjects(FieldValuesHolder fieldValuesHolder)

getSelectedObjects

protected Collection getSelectedObjects(FieldValuesHolder fieldValuesHolder,
                                        org.apache.commons.collections.Transformer transformer)

getVersionOptions

protected List getVersionOptions(SearchContext searchContext,
                                 boolean unreleasedFirst)


Copyright © 2002-2009 Atlassian. All Rights Reserved.