Class IdIndexedSearchInputTransformer<T>
java.lang.Object
com.atlassian.jira.issue.search.searchers.transformer.IdIndexedSearchInputTransformer<T>
- All Implemented Interfaces:
SearchInputTransformer
- Direct Known Subclasses:
IssueConstantSearchInputTransformer
@NonInjectableComponent
public abstract class IdIndexedSearchInputTransformer<T>
extends Object
implements SearchInputTransformer
A SearchInputTransformer that handles any field that is represented by its id in the Lucene document, and hence
is represented by a select list in the Issue Navigator. May or may not also have flag functions.
- Since:
- v4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FieldFlagOperandRegistryprotected final IndexInfoResolver<T>protected final JqlOperandResolver -
Constructor Summary
ConstructorsConstructorDescriptionIdIndexedSearchInputTransformer(ClauseNames id, IndexInfoResolver<T> indexInfoResolver, JqlOperandResolver operandResolver, FieldFlagOperandRegistry fieldFlagOperandRegistry) IdIndexedSearchInputTransformer(ClauseNames clauseNames, String urlParameterName, IndexInfoResolver<T> indexInfoResolver, JqlOperandResolver operandResolver, FieldFlagOperandRegistry fieldFlagOperandRegistry) -
Method Summary
Modifier and TypeMethodDescriptionbooleandoRelevantClausesFitFilterForm(ApplicationUser user, Query query, SearchContext searchContext) Tells the caller whether or not the relevant clauses from the passed query can be represented on the issue navigator.protected DefaultIndexedInputHelperprotected IndexedInputHelpergetSearchClause(ApplicationUser user, FieldValuesHolder fieldValuesHolder) For this implementation we expect that the fieldValuesHolder will contain a list of strings or nothing at all, if not then this will throw an exception.voidpopulateFromParams(ApplicationUser user, FieldValuesHolder fieldValuesHolder, ActionParams actionParams) PopulateFieldValuesHolderobject with whatever values the searcher is interested in from theActionParams.voidpopulateFromQuery(ApplicationUser user, FieldValuesHolder fieldValuesHolder, Query query, SearchContext searchContext) This method transforms any query information contained in the query that is relevant to this SearchInputTransformer into the values that the HTML rendering expects.voidvalidateParams(ApplicationUser user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, I18nHelper i18nHelper, ErrorCollection errors) Adds error messages to the errors object if values in the fieldValuesHolder fails validation.
-
Field Details
-
fieldFlagOperandRegistry
-
operandResolver
-
indexInfoResolver
-
-
Constructor Details
-
IdIndexedSearchInputTransformer
public IdIndexedSearchInputTransformer(ClauseNames id, IndexInfoResolver<T> indexInfoResolver, JqlOperandResolver operandResolver, FieldFlagOperandRegistry fieldFlagOperandRegistry) -
IdIndexedSearchInputTransformer
public IdIndexedSearchInputTransformer(ClauseNames clauseNames, String urlParameterName, IndexInfoResolver<T> indexInfoResolver, JqlOperandResolver operandResolver, FieldFlagOperandRegistry fieldFlagOperandRegistry)
-
-
Method Details
-
populateFromParams
public void populateFromParams(ApplicationUser user, FieldValuesHolder fieldValuesHolder, ActionParams actionParams) Description copied from interface:SearchInputTransformerPopulateFieldValuesHolderobject with whatever values the searcher is interested in from theActionParams. This transforms the "raw" request parameters into a form that the other processing methods can handle (usually a mapping of the fields name as the key and a list of the values as the value).- Specified by:
populateFromParamsin interfaceSearchInputTransformer- Parameters:
user- performing this action.fieldValuesHolder- is the object that should have its values set by this method and that will contain any other values that have been set by other SearchInputTransformers.actionParams- params from the webwork front end that contains a String[] of values as submitted via the
-
validateParams
public void validateParams(ApplicationUser user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, I18nHelper i18nHelper, ErrorCollection errors) Description copied from interface:SearchInputTransformerAdds error messages to the errors object if values in the fieldValuesHolder fails validation. This should be called once the fieldValuesHolder has been populated.- Specified by:
validateParamsin interfaceSearchInputTransformer- Parameters:
user- performing this action.searchContext- the context of the search (i.e. projects and issue types selected).fieldValuesHolder- contains values populated by the populate methods of this input transformer.i18nHelper- used to internationalize error messages that we want to display to the users.errors- the ErrorCollection that contains the messages we want to display to the users.
-
populateFromQuery
public void populateFromQuery(ApplicationUser user, FieldValuesHolder fieldValuesHolder, Query query, SearchContext searchContext) Description copied from interface:SearchInputTransformerThis method transforms any query information contained in the query that is relevant to this SearchInputTransformer into the values that the HTML rendering expects. This should populate theFieldValuesHolderfrom the a query information in the query.
The query elements that are considered "relevant" to this method would be those that are produced by theSearchInputTransformer.getSearchClause(ApplicationUser, com.atlassian.jira.issue.transport.FieldValuesHolder)method.- Specified by:
populateFromQueryin interfaceSearchInputTransformer- Parameters:
user- performing this action.fieldValuesHolder- is the object that should have its values set by this method and that will contain any other values that have been set by other SearchInputTransformers.query- the search criteria used to populate the field values holder.searchContext- contains the projects and issue types that the search and filter form is restricted to
-
doRelevantClausesFitFilterForm
public boolean doRelevantClausesFitFilterForm(ApplicationUser user, Query query, SearchContext searchContext) Description copied from interface:SearchInputTransformerTells the caller whether or not the relevant clauses from the passed query can be represented on the issue navigator. Implementers of this method needs to ensure that it can represent *ALL* related clauses on the navigator, and that the clauses' structure conforms to the simple navigator structure.The method should only be concerned with the clauses related to this transformer. Other irrelevant clauses should be ignored.
- Specified by:
doRelevantClausesFitFilterFormin interfaceSearchInputTransformer- Parameters:
user- performing this action.query- to check if it can fit in the simple (GUI form based) issue navigator.searchContext- contains the projects and issue types that the search and filter form is restricted to- Returns:
- true if the query can be represented on navigator.
-
getSearchClause
For this implementation we expect that the fieldValuesHolder will contain a list of strings or nothing at all, if not then this will throw an exception.- Specified by:
getSearchClausein interfaceSearchInputTransformer- Parameters:
user- the user performing the searchfieldValuesHolder- contains values populated by the searchers- Returns:
- Clause that represents the raw values.
- Throws:
IllegalArgumentException- if the value in the field values holder keyed by the searcher id is not a list that contains strings.
-
getDefaultIndexedInputHelper
- Returns:
- the
DefaultIndexedInputHelperalways
-
getIndexedInputHelper
- Returns:
- the
IndexedInputHelperwhich might be specialised for this particular searcher
-