com.atlassian.jira.issue.customfields.searchers.transformer
Class MultiSelectCustomFieldSearchInputTransformer

java.lang.Object
  extended by com.atlassian.jira.issue.customfields.searchers.transformer.AbstractCustomFieldSearchInputTransformer
      extended by com.atlassian.jira.issue.customfields.searchers.transformer.MultiSelectCustomFieldSearchInputTransformer
All Implemented Interfaces:
SearchInputTransformer

public class MultiSelectCustomFieldSearchInputTransformer
extends AbstractCustomFieldSearchInputTransformer
implements SearchInputTransformer

The SearchInputTransformer for custom fields with multi-select searchers (multi-select and check boxes)

Since:
v4.0

Constructor Summary
MultiSelectCustomFieldSearchInputTransformer(String urlParameterName, ClauseNames clauseNames, CustomField field, JqlOperandResolver jqlOperandResolver, JqlSelectOptionsUtil jqlSelectOptionsUtil, QueryContextConverter queryContextConverter, CustomFieldInputHelper customFieldInputHelper)
           
 
Method Summary
 boolean doRelevantClausesFitFilterForm(com.atlassian.crowd.embedded.api.User searcher, 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  Clause getClauseFromParams(com.atlassian.crowd.embedded.api.User searcher, CustomFieldParams params)
          Note: only provide a sensible implementation of this if you intend on using AbstractCustomFieldSearchInputTransformer.getSearchClause(User, com.atlassian.jira.issue.transport.FieldValuesHolder) as implemented here.
protected  CustomFieldParams getParamsFromSearchRequest(com.atlassian.crowd.embedded.api.User searcher, Query query, SearchContext searchContext)
          Gets CustomField search parameters from the given JQL Query.
protected  boolean isValidOperatorForFitness(Operator operator)
           
 void validateParams(com.atlassian.crowd.embedded.api.User searcher, 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.customfields.searchers.transformer.AbstractCustomFieldSearchInputTransformer
getClauseName, getCustomField, getSearchClause, populateFromParams, populateFromQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.issue.search.searchers.transformer.SearchInputTransformer
getSearchClause, populateFromParams, populateFromQuery
 

Constructor Detail

MultiSelectCustomFieldSearchInputTransformer

public MultiSelectCustomFieldSearchInputTransformer(String urlParameterName,
                                                    ClauseNames clauseNames,
                                                    CustomField field,
                                                    JqlOperandResolver jqlOperandResolver,
                                                    JqlSelectOptionsUtil jqlSelectOptionsUtil,
                                                    QueryContextConverter queryContextConverter,
                                                    CustomFieldInputHelper customFieldInputHelper)
Method Detail

getClauseFromParams

protected Clause getClauseFromParams(com.atlassian.crowd.embedded.api.User searcher,
                                     CustomFieldParams params)
Description copied from class: AbstractCustomFieldSearchInputTransformer
Note: only provide a sensible implementation of this if you intend on using AbstractCustomFieldSearchInputTransformer.getSearchClause(User, com.atlassian.jira.issue.transport.FieldValuesHolder) as implemented here. If you are overriding AbstractCustomFieldSearchInputTransformer.getSearchClause(User, com.atlassian.jira.issue.transport.FieldValuesHolder) then you do not have to implement this method sensibly.

Specified by:
getClauseFromParams in class AbstractCustomFieldSearchInputTransformer
Parameters:
searcher - the user performing the search
params - the custom field params
Returns:
the clause that represents the params

getParamsFromSearchRequest

protected CustomFieldParams getParamsFromSearchRequest(com.atlassian.crowd.embedded.api.User searcher,
                                                       Query query,
                                                       SearchContext searchContext)
Description copied from class: AbstractCustomFieldSearchInputTransformer
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".

Specified by:
getParamsFromSearchRequest in class AbstractCustomFieldSearchInputTransformer
Parameters:
searcher - User
query - JQL query
searchContext - contains the projects and issue types that the search is restricted to
Returns:
CustomField search parameters from the given JQL Query.

isValidOperatorForFitness

protected boolean isValidOperatorForFitness(Operator operator)

doRelevantClausesFitFilterForm

public boolean doRelevantClausesFitFilterForm(com.atlassian.crowd.embedded.api.User searcher,
                                              Query query,
                                              SearchContext searchContext)
Description copied from interface: SearchInputTransformer
Tells the caller whether or not the relevant clauses from the passed query can be represented on the issue navigator. Implementors 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:
doRelevantClausesFitFilterForm in interface SearchInputTransformer
Parameters:
searcher - 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.

validateParams

public void validateParams(com.atlassian.crowd.embedded.api.User searcher,
                           SearchContext searchContext,
                           FieldValuesHolder fieldValuesHolder,
                           I18nHelper i18nHelper,
                           ErrorCollection errors)
Description copied from interface: SearchInputTransformer
Adds error meessages to the errors object if values in the fieldValuesHolder fails validation. This should be called once the fieldValuesHolder has been populated.

Specified by:
validateParams in interface SearchInputTransformer
Overrides:
validateParams in class AbstractCustomFieldSearchInputTransformer
Parameters:
searcher - 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.


Copyright © 2002-2012 Atlassian. All Rights Reserved.