public abstract class

SearchQueryBackedResource

extends AbstractResource
java.lang.Object
   ↳ com.atlassian.jira.gadgets.system.AbstractResource
     ↳ com.atlassian.jira.gadgets.system.SearchQueryBackedResource
Known Direct Subclasses

Class Overview

An abstract class used for common search request handling for search request backed resources.

Summary

Constants
String QUERY_STRING
Fields
protected final JiraAuthenticationContext authenticationContext
protected final ChartUtils chartUtils
protected final PermissionManager permissionManager
protected final SearchService searchService
Public Constructors
SearchQueryBackedResource(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, VelocityRequestContextFactory velocityRequestContextFactory)
Protected Methods
String getFilterTitle(Map<StringObject> params)
Get the name to display for the given query.
String getFilterUrl(Map<StringObject> params)
Get the url to send people to for this search.
SearchRequest getSearchRequestAndValidate(String queryString, Collection<ValidationError> errors, Map<StringObject> params)
Method used for retrieving/building a SearchRequest and validating params.
[Expand]
Inherited Methods
From class com.atlassian.jira.gadgets.system.AbstractResource
From class java.lang.Object

Constants

protected static final String QUERY_STRING

Constant Value: "projectOrFilterId"

Fields

protected final JiraAuthenticationContext authenticationContext

protected final ChartUtils chartUtils

protected final PermissionManager permissionManager

protected final SearchService searchService

Public Constructors

public SearchQueryBackedResource (ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, VelocityRequestContextFactory velocityRequestContextFactory)

Protected Methods

protected String getFilterTitle (Map<StringObject> params)

Get the name to display for the given query.

Parameters
params The params created during chart generation process.
Returns
  • For a project, get the project name. For a saved filter, get the name. For a unsaved search, return the anonymous key.

protected String getFilterUrl (Map<StringObject> params)

Get the url to send people to for this search.

Parameters
params The params created during chart generation process.
Returns
  • For a project or filter, send them to the issue navigator. For an unsaved search, return empty string.

protected SearchRequest getSearchRequestAndValidate (String queryString, Collection<ValidationError> errors, Map<StringObject> params)

Method used for retrieving/building a SearchRequest and validating params.

Parameters
queryString a String containing a search criteria. Starts with "filter-" for a search request, "project-" for a project or "jql-" for a jql equest.
errors a collection of ValidationError object containing all validation message keys.
params a map to populate with with appropriate entities.
Returns
  • a SearchRequest that will restrict the search to the given criteria