com.atlassian.jira.issue.search.searchers.renderer
Class IssueTypeSearchRenderer

java.lang.Object
  extended by com.atlassian.jira.issue.search.searchers.renderer.AbstractSearchRenderer
      extended by com.atlassian.jira.issue.search.searchers.renderer.IssueTypeSearchRenderer
All Implemented Interfaces:
SearchRenderer

public class IssueTypeSearchRenderer
extends AbstractSearchRenderer
implements SearchRenderer

A search renderer for the issue type field in the new issue navigator.

Since:
v5.2

Field Summary
 
Fields inherited from class com.atlassian.jira.issue.search.searchers.renderer.AbstractSearchRenderer
EDIT_TEMPLATE_SUFFIX, VIEW_TEMPLATE_SUFFIX
 
Constructor Summary
IssueTypeSearchRenderer(ApplicationProperties applicationProperties, ConstantsManager constantsManager, IssueTypeSchemeManager issueTypeSchemeManager, OptionSetManager optionSetManager, PermissionManager permissionManager, SimpleFieldSearchConstants searchConstants, String searcherNameKey, SubTaskManager subTaskManager, VelocityTemplatingEngine templatingEngine, VelocityRequestContextFactory velocityRequestContextFactory)
           
 
Method Summary
 void addEditParameters(FieldValuesHolder fieldValuesHolder, SearchContext searchContext, com.atlassian.crowd.embedded.api.User user, Map<String,Object> velocityParameters)
          Construct edit HTML parameters and add them to a template parameters map.
 void addViewParameters(FieldValuesHolder fieldValuesHolder, SearchContext searchContext, com.atlassian.crowd.embedded.api.User user, Map<String,Object> velocityParameters)
          Construct view HTML parameters and add them to a template parameters map.
 String getEditHtml(com.atlassian.crowd.embedded.api.User user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map<?,?> displayParameters, webwork.action.Action action)
          Used to produce an HTML input that is rendered on the JIRA issue navigator.
protected  Collection<Option> getOptionsInSearchContext(SearchContext searchContext, com.atlassian.crowd.embedded.api.User user)
           
protected  Map<String,Object> getVelocityParams(com.atlassian.crowd.embedded.api.User searcher, SearchContext searchContext, FieldLayoutItem fieldLayoutItem, FieldValuesHolder fieldValuesHolder, Map<?,?> displayParameters, webwork.action.Action action)
           
 String getViewHtml(com.atlassian.crowd.embedded.api.User user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map<?,?> displayParameters, webwork.action.Action action)
          Used to produce the HTML that displays a searchers summary information (e.g.
 boolean isRelevantForQuery(com.atlassian.crowd.embedded.api.User user, Query query)
          Checks if the searchRequest object has a search representation that was created by the searcher and is used to determine if the SearchRenderer.getViewHtml(User, com.atlassian.jira.issue.search.SearchContext, com.atlassian.jira.issue.transport.FieldValuesHolder, java.util.Map, webwork.action.Action) method should be called when rendering the search summary.
 boolean isShown(com.atlassian.crowd.embedded.api.User user, SearchContext searchContext)
          Checks if the searcher should be shown in this context on the Issue Navigator.
 
Methods inherited from class com.atlassian.jira.issue.search.searchers.renderer.AbstractSearchRenderer
getI18n, isRelevantForQuery, renderEditTemplate, renderViewTemplate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IssueTypeSearchRenderer

public IssueTypeSearchRenderer(ApplicationProperties applicationProperties,
                               ConstantsManager constantsManager,
                               IssueTypeSchemeManager issueTypeSchemeManager,
                               OptionSetManager optionSetManager,
                               PermissionManager permissionManager,
                               SimpleFieldSearchConstants searchConstants,
                               String searcherNameKey,
                               SubTaskManager subTaskManager,
                               VelocityTemplatingEngine templatingEngine,
                               VelocityRequestContextFactory velocityRequestContextFactory)
Method Detail

addEditParameters

public void addEditParameters(FieldValuesHolder fieldValuesHolder,
                              SearchContext searchContext,
                              com.atlassian.crowd.embedded.api.User user,
                              Map<String,Object> velocityParameters)
Construct edit HTML parameters and add them to a template parameters map.

Parameters:
fieldValuesHolder - Contains the values the user has selected.
searchContext - The search context.
user - The user performing the search.
velocityParameters - The template parameters.

addViewParameters

public void addViewParameters(FieldValuesHolder fieldValuesHolder,
                              SearchContext searchContext,
                              com.atlassian.crowd.embedded.api.User user,
                              Map<String,Object> velocityParameters)
Construct view HTML parameters and add them to a template parameters map.

Parameters:
fieldValuesHolder - Contains the values the user has selected.
searchContext - The search context.
user - The user performing the search.
velocityParameters - The template parameters.

getEditHtml

public String getEditHtml(com.atlassian.crowd.embedded.api.User user,
                          SearchContext searchContext,
                          FieldValuesHolder fieldValuesHolder,
                          Map<?,?> displayParameters,
                          webwork.action.Action action)
Description copied from interface: SearchRenderer
Used to produce an HTML input that is rendered on the JIRA issue navigator. This HTML provides the UI for searching a fields content. There will be a corresponding SearchInputTransformer that will know how to transform these input parameters into JIRA search objects.

Specified by:
getEditHtml in interface SearchRenderer
Parameters:
user - performing this action.
searchContext - the search context of the current search request that may be participating in rendering the issue navigator.
fieldValuesHolder - contains any request parameters that the HTML input may need to use to pre-populate the input (e.g. if this is the priority renderer and the search request being rendered has two priorities already selected these params will contain these request parameters). These parameters will have been populated via a call to SearchInputTransformer.populateFromQuery(User,com.atlassian.jira.issue.transport.FieldValuesHolder,com.atlassian.query.Query,com.atlassian.jira.issue.search.SearchContext) if there is a SearchRequest involved in the rendering this IssueNavigator call.
displayParameters - are a map of "hints" that can be passed from the caller to this code which can use these hints to alter the way it renders the HTML.
action - is the WebWork 1 action object that is rendering the Issue Navigator view. This can be used to invoke methods on the view.
Returns:
a String that contains HTML that can be rendered on the left-hand side of the JIRA issue navigator.

isShown

public boolean isShown(com.atlassian.crowd.embedded.api.User user,
                       SearchContext searchContext)
Description copied from interface: SearchRenderer
Checks if the searcher should be shown in this context on the Issue Navigator.

Specified by:
isShown in interface SearchRenderer
Parameters:
user - performing this action.
searchContext - the context of the search (i.e. projects and issue types selected).
Returns:
true if the searcher will appear in the issue navigator, false otherwise.

getViewHtml

public String getViewHtml(com.atlassian.crowd.embedded.api.User user,
                          SearchContext searchContext,
                          FieldValuesHolder fieldValuesHolder,
                          Map<?,?> displayParameters,
                          webwork.action.Action action)
Description copied from interface: SearchRenderer
Used to produce the HTML that displays a searchers summary information (e.g. if this is the priority searcher and a user has selected two priorities then this method will render HTML that shows something like 'priority: Major, Minor').

Specified by:
getViewHtml in interface SearchRenderer
Parameters:
user - performing this action.
searchContext - the search context of the current search request that may be participating in rendering the issue navigator.
fieldValuesHolder - contains any request parameters that the HTML input may need to use to pre-populate the input (e.g. if this is the priority renderer and the search request being rendered has two priorities already selected these params will contain these request parameters). These parameters will have been populated via a call to SearchInputTransformer.populateFromQuery(User,com.atlassian.jira.issue.transport.FieldValuesHolder,com.atlassian.query.Query,com.atlassian.jira.issue.search.SearchContext) if there is a SearchRequest involved in the rendering this IssueNavigator call.
displayParameters - are a map of "hints" that can be passed from the caller to this code which can use these hints to alter the way it renders the HTML.
action - is the WebWork 1 action object that is rendering the Issue Navigator view. This can be used to invoke methods on the view.
Returns:
a String that contains HTML that can be rendered on the left-hand side of the issue navigator to show a SearchRequest summary.

isRelevantForQuery

public boolean isRelevantForQuery(com.atlassian.crowd.embedded.api.User user,
                                  Query query)
Description copied from interface: SearchRenderer
Checks if the searchRequest object has a search representation that was created by the searcher and is used to determine if the SearchRenderer.getViewHtml(User, com.atlassian.jira.issue.search.SearchContext, com.atlassian.jira.issue.transport.FieldValuesHolder, java.util.Map, webwork.action.Action) method should be called when rendering the search summary.

Specified by:
isRelevantForQuery in interface SearchRenderer
Parameters:
user - performing this action.
query - contains the search criteria used to determine if this query is relevevant to the searcher.
Returns:
true if the query has relevant clauses to the searchers, false otherwise.

getOptionsInSearchContext

protected Collection<Option> getOptionsInSearchContext(SearchContext searchContext,
                                                       com.atlassian.crowd.embedded.api.User user)
Parameters:
searchContext - The search context.
user - The user performing the search.
Returns:
All issue type options visible in the given search context.

getVelocityParams

protected Map<String,Object> getVelocityParams(com.atlassian.crowd.embedded.api.User searcher,
                                               SearchContext searchContext,
                                               FieldLayoutItem fieldLayoutItem,
                                               FieldValuesHolder fieldValuesHolder,
                                               Map<?,?> displayParameters,
                                               webwork.action.Action action)
Overrides:
getVelocityParams in class AbstractSearchRenderer


Copyright © 2002-2013 Atlassian. All Rights Reserved.