Class RecentlyCreatedChartResource
java.lang.Object
com.atlassian.jira.gadgets.system.AbstractResource
com.atlassian.jira.gadgets.system.SearchQueryBackedResource
com.atlassian.jira.gadgets.system.RecentlyCreatedChartResource
@Path("/recentlyCreated")
@Produces("application/json")
public class RecentlyCreatedChartResource
extends SearchQueryBackedResource
REST endpoint to validate and retreive a Recent Created chart.
- Since:
- v4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
A simple bean contain all information required to render the Recently Created Chart -
Field Summary
Fields inherited from class com.atlassian.jira.gadgets.system.SearchQueryBackedResource
authenticationContext, chartUtils, permissionManager, QUERY_STRING, searchService
-
Constructor Summary
ConstructorsConstructorDescriptionRecentlyCreatedChartResource
(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, ChartFactory chartFactory, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
generateChart
(javax.servlet.http.HttpServletRequest request, String queryString, String days, String periodName, boolean returnData, int width, int height, boolean inline) Generate a Recently Created Chart and returns a simple bean containing all relevent informationjavax.ws.rs.core.Response
validateChart
(String queryString, String days, String periodName) Ensures all parameters are valid for the Recently Created ChartMethods inherited from class com.atlassian.jira.gadgets.system.SearchQueryBackedResource
getFilterTitle, getFilterUrl, getSearchRequestAndValidate, validateSize
Methods inherited from class com.atlassian.jira.gadgets.system.AbstractResource
createErrorResponse, createIndexingUnavailableResponse, createValidationResponse
-
Constructor Details
-
RecentlyCreatedChartResource
@Inject public RecentlyCreatedChartResource(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, ChartFactory chartFactory, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties)
-
-
Method Details
-
generateChart
@GET @Path("/generate") public javax.ws.rs.core.Response generateChart(@Context javax.servlet.http.HttpServletRequest request, @QueryParam("projectOrFilterId") String queryString, @QueryParam("daysprevious") @DefaultValue("30") String days, @QueryParam("periodName") @DefaultValue("daily") String periodName, @QueryParam("returnData") @DefaultValue("false") boolean returnData, @QueryParam("width") @DefaultValue("400") int width, @QueryParam("height") @DefaultValue("250") int height, @QueryParam("inline") @DefaultValue("false") boolean inline) Generate a Recently Created Chart and returns a simple bean containing all relevent information- Parameters:
request
- The current HTTPRequest. Needed for url generationqueryString
- a filter id (starts with "filter-") or project id (starts with "project-")or jql (starts with "jql-")days
- The number of days previous to go back for. Must be positive.periodName
- The name of the period. See -ChartFactory.PeriodName
width
- the width of the chart in pixels (defaults to 400px)height
- the height of the chart in pixels (defaults to 250px)- Returns:
- a
RecentlyCreatedChartResource.RecentlyCreatedChart
if all params validated else a Collection ofValidationError
-
validateChart
@GET @Path("/validate") public javax.ws.rs.core.Response validateChart(@QueryParam("projectOrFilterId") String queryString, @QueryParam("daysprevious") @DefaultValue("30") String days, @QueryParam("periodName") @DefaultValue("daily") String periodName) Ensures all parameters are valid for the Recently Created Chart- Parameters:
queryString
- a filter id (starts with "filter-") or project id (starts with "project-").days
- The number of days previous to go back for. Must be positive.periodName
- The name of the period. See -ChartFactory.PeriodName
- Returns:
- a Collection of
ValidationError
. Or empty list if no errors.
-