public class

ProjectSearchRenderer

extends AbstractSearchRenderer
implements SearchRenderer
java.lang.Object
   ↳ com.atlassian.jira.issue.search.searchers.renderer.AbstractSearchRenderer
     ↳ com.atlassian.jira.issue.search.searchers.renderer.ProjectSearchRenderer

Class Overview

A search renderer for the project system field searcher.

Summary

Constants
int MAX_PROJECTS_BEFORE_RECENT
int MAX_RECENT_PROJECTS_TO_SHOW
[Expand]
Inherited Constants
From class com.atlassian.jira.issue.search.searchers.renderer.AbstractSearchRenderer
Public Constructors
ProjectSearchRenderer(ProjectManager projectManager, PermissionManager permissionManager, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties, VelocityTemplatingEngine templatingEngine, String searcherNameKey, UserProjectHistoryManager projectHistoryManager)
Public Methods
void addParameters(User searcher, FieldValuesHolder fieldValuesHolder, boolean noCurrentSearchRequest, Map<StringObject> velocityParams)
String getEditHtml(User user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map<?, ?> displayParameters, Action action)
Used to produce an HTML input that is rendered on the JIRA issue navigator.
Collection<Project> getRecentProjects(User searcher)
String getViewHtml(User user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, Action action)
Collection<GenericValue> getVisibleProjects(User searcher)
boolean isRelevantForQuery(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 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(User user, SearchContext searchContext)
Checks if the searcher should be shown in this context on the Issue Navigator.
[Expand]
Inherited Methods
From class com.atlassian.jira.issue.search.searchers.renderer.AbstractSearchRenderer
From class java.lang.Object
From interface com.atlassian.jira.issue.search.searchers.renderer.SearchRenderer

Constants

public static final int MAX_PROJECTS_BEFORE_RECENT

Constant Value: 10 (0x0000000a)

public static final int MAX_RECENT_PROJECTS_TO_SHOW

Constant Value: 5 (0x00000005)

Public Constructors

public ProjectSearchRenderer (ProjectManager projectManager, PermissionManager permissionManager, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties, VelocityTemplatingEngine templatingEngine, String searcherNameKey, UserProjectHistoryManager projectHistoryManager)

Public Methods

public void addParameters (User searcher, FieldValuesHolder fieldValuesHolder, boolean noCurrentSearchRequest, Map<StringObject> velocityParams)

public String getEditHtml (User user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map<?, ?> displayParameters, Action action)

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.

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 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.

public Collection<Project> getRecentProjects (User searcher)

public String getViewHtml (User user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, Action action)

public Collection<GenericValue> getVisibleProjects (User searcher)

public boolean isRelevantForQuery (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 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.

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.

public boolean isShown (User user, SearchContext searchContext)

Checks if the searcher should be shown in this context on the Issue Navigator.

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.