@PublicSpi public abstract class AbstractCustomFieldSearchInputTransformer extends Object implements SearchInputTransformer
Constructor and Description |
---|
AbstractCustomFieldSearchInputTransformer(CustomField field,
String urlParameterName,
CustomFieldInputHelper customFieldInputHelper) |
Modifier and Type | Method and Description |
---|---|
protected abstract Clause |
getClauseFromParams(com.atlassian.crowd.embedded.api.User user,
CustomFieldParams customFieldParams)
Note: only provide a sensible implementation of this if you intend on using
getSearchClause(User, com.atlassian.jira.issue.transport.FieldValuesHolder)
as implemented here. |
protected String |
getClauseName(com.atlassian.crowd.embedded.api.User user,
ClauseNames clauseNames) |
protected CustomField |
getCustomField() |
protected abstract CustomFieldParams |
getParamsFromSearchRequest(com.atlassian.crowd.embedded.api.User user,
Query query,
SearchContext searchContext)
Gets CustomField search parameters from the given JQL Query.
|
Clause |
getSearchClause(com.atlassian.crowd.embedded.api.User user,
FieldValuesHolder fieldValuesHolder)
Gets the portion of the Search Query that this searcher is responsible for.
|
void |
populateFromParams(com.atlassian.crowd.embedded.api.User user,
FieldValuesHolder fieldValuesHolder,
ActionParams actionParams)
Populate
FieldValuesHolder object with whatever values the searcher is interested in from the
ActionParams . |
void |
populateFromQuery(com.atlassian.crowd.embedded.api.User 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.
|
void |
validateParams(com.atlassian.crowd.embedded.api.User user,
SearchContext searchContext,
FieldValuesHolder fieldValuesHolder,
I18nHelper i18nHelper,
ErrorCollection errors)
Adds error messages to the errors object if values in the fieldValuesHolder fails validation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doRelevantClausesFitFilterForm
public AbstractCustomFieldSearchInputTransformer(CustomField field, String urlParameterName, CustomFieldInputHelper customFieldInputHelper)
protected abstract Clause getClauseFromParams(com.atlassian.crowd.embedded.api.User user, CustomFieldParams customFieldParams)
getSearchClause(User, com.atlassian.jira.issue.transport.FieldValuesHolder)
as implemented here. If you are overriding getSearchClause(User, com.atlassian.jira.issue.transport.FieldValuesHolder)
then you do not have to implement this method sensibly.user
- the user performing the searchcustomFieldParams
- the custom field paramsprotected abstract CustomFieldParams getParamsFromSearchRequest(com.atlassian.crowd.embedded.api.User user, Query query, SearchContext searchContext)
it may return null, indicating no search parameters for this searcher were specified, or the query will not fit into the "simple navigator".
user
- Userquery
- JQL querysearchContext
- contains the projects and issue types that the search is restricted topublic Clause getSearchClause(com.atlassian.crowd.embedded.api.User user, FieldValuesHolder fieldValuesHolder)
SearchInputTransformer
getSearchClause
in interface SearchInputTransformer
user
- performing this action.fieldValuesHolder
- contains values populated by the searchersClause
that represents the users search based on the fieldValuesHolder;
null if this searcher has no responsibility in the given input.public void populateFromParams(com.atlassian.crowd.embedded.api.User user, FieldValuesHolder fieldValuesHolder, ActionParams actionParams)
SearchInputTransformer
FieldValuesHolder
object with whatever values the searcher is interested in from the
ActionParams
. 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).populateFromParams
in interface SearchInputTransformer
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 thepublic void populateFromQuery(com.atlassian.crowd.embedded.api.User user, FieldValuesHolder fieldValuesHolder, Query query, SearchContext searchContext)
SearchInputTransformer
FieldValuesHolder
from the a query information in the
query.
SearchInputTransformer.getSearchClause(User, com.atlassian.jira.issue.transport.FieldValuesHolder)
method.populateFromQuery
in interface SearchInputTransformer
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 topublic void validateParams(com.atlassian.crowd.embedded.api.User user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, I18nHelper i18nHelper, ErrorCollection errors)
SearchInputTransformer
validateParams
in interface SearchInputTransformer
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.protected String getClauseName(com.atlassian.crowd.embedded.api.User user, ClauseNames clauseNames)
protected CustomField getCustomField()
Copyright © 2002-2015 Atlassian. All Rights Reserved.