Class AbstractCustomFieldSearchInputTransformer
java.lang.Object
com.atlassian.jira.issue.customfields.searchers.transformer.AbstractCustomFieldSearchInputTransformer
- All Implemented Interfaces:
SearchInputTransformer
- Direct Known Subclasses:
AbstractSingleValueCustomFieldSearchInputTransformer,CascadingSelectCustomFieldSearchInputTransformer,CustomFieldLabelsSearchInputTransformer,MultiGroupCustomFieldSearchInputTransformer,MultiSelectCustomFieldSearchInputTransformer,NumberRangeCustomFieldSearchInputTransformer
@PublicSpi
public abstract class AbstractCustomFieldSearchInputTransformer
extends Object
implements SearchInputTransformer
An abstract implementation for a search input transformer for custom fields. Assumes the custom field params contain
a single mapping from field to value.
- Since:
- v4.0
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractCustomFieldSearchInputTransformer(CustomField field, String urlParameterName, CustomFieldInputHelper customFieldInputHelper) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ClausegetClauseFromParams(ApplicationUser user, CustomFieldParams customFieldParams) Note: only provide a sensible implementation of this if you intend on usinggetSearchClause(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.transport.FieldValuesHolder)as implemented here.protected StringgetClauseName(ApplicationUser user, ClauseNames clauseNames) protected CustomFieldprotected abstract CustomFieldParamsgetParamsFromSearchRequest(ApplicationUser user, Query query, SearchContext searchContext) Gets CustomField search parameters from the given JQL Query.getSearchClause(ApplicationUser user, FieldValuesHolder fieldValuesHolder) Gets the portion of the Search Query that this searcher is responsible for.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.issue.search.searchers.transformer.SearchInputTransformer
doRelevantClausesFitFilterForm
-
Constructor Details
-
AbstractCustomFieldSearchInputTransformer
public AbstractCustomFieldSearchInputTransformer(CustomField field, String urlParameterName, CustomFieldInputHelper customFieldInputHelper)
-
-
Method Details
-
getClauseFromParams
protected abstract Clause getClauseFromParams(ApplicationUser user, CustomFieldParams customFieldParams) Note: only provide a sensible implementation of this if you intend on usinggetSearchClause(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.transport.FieldValuesHolder)as implemented here. If you are overridinggetSearchClause(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.issue.transport.FieldValuesHolder)then you do not have to implement this method sensibly.- Parameters:
user- the user performing the searchcustomFieldParams- the custom field params- Returns:
- the clause that represents the params
-
getParamsFromSearchRequest
protected abstract CustomFieldParams getParamsFromSearchRequest(ApplicationUser user, Query query, SearchContext searchContext) Gets CustomField search parameters from the given JQL Query.It may return null, indicating no search parameters for this searcher were specified, or the query will not fit into the "simple navigator".
- Parameters:
user- com.atlassian.jira.user.ApplicationUserquery- JQL querysearchContext- contains the projects and issue types that the search is restricted to- Returns:
- CustomField search parameters from the given JQL Query.
-
getSearchClause
Description copied from interface:SearchInputTransformerGets the portion of the Search Query that this searcher is responsible for.- Specified by:
getSearchClausein interfaceSearchInputTransformer- Parameters:
user- performing this action.fieldValuesHolder- contains values populated by the searchers- Returns:
- a
Clausethat represents the users search based on the fieldValuesHolder; null if this searcher has no responsibility in the given input.
-
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
-
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
-
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.
-
getClauseName
-
getCustomField
-