Class SearchQueryBackedResource
java.lang.Object
com.atlassian.jira.gadgets.system.AbstractResource
com.atlassian.jira.gadgets.system.SearchQueryBackedResource
- Direct Known Subclasses:
AverageAgeChartResource,BubbleChartResource,CreatedVsResolvedResource,HeatMapResource,PieChartResource,RecentlyCreatedChartResource,ResolutionTimeResource,StatsResource,TimeSinceChartResource,TwoDimensionalStatsResource
An abstract class used for common search request handling for search request backed resources.
- Since:
- v4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JiraAuthenticationContextprotected static final Stringprotected final SearchService -
Constructor Summary
ConstructorsConstructorDescriptionSearchQueryBackedResource(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, VelocityRequestContextFactory velocityRequestContextFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetFilterTitle(Map<String, Object> params) Get the name to display for the given query.protected StringgetFilterUrl(Map<String, Object> params) Get the url to send people to for this search.protected SearchRequestgetSearchRequestAndValidate(String queryString, Collection<ValidationError> errors, Map<String, Object> params) Method used for retrieving/building a SearchRequest and validating params.protected voidvalidateSize(Collection<ValidationError> errors, int width, int height) Methods inherited from class com.atlassian.jira.gadgets.system.AbstractResource
createErrorResponse, createIndexingUnavailableResponse, createServerErroreResponse, createValidationResponse
-
Field Details
-
QUERY_STRING
- See Also:
-
authenticationContext
-
searchService
-
-
Constructor Details
-
SearchQueryBackedResource
@Inject public SearchQueryBackedResource(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, VelocityRequestContextFactory velocityRequestContextFactory)
-
-
Method Details
-
getSearchRequestAndValidate
protected SearchRequest getSearchRequestAndValidate(String queryString, Collection<ValidationError> errors, Map<String, Object> 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 ofValidationErrorobject containing all validation message keys.params- a map to populate with with appropriate entities.- Returns:
- a
SearchRequestthat will restrict the search to the given criteria
-
validateSize
-
getFilterTitle
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.
-
getFilterUrl
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.
-