Class TimeSinceChartResource
java.lang.Object
com.atlassian.jira.gadgets.system.AbstractResource
com.atlassian.jira.gadgets.system.SearchQueryBackedResource
com.atlassian.jira.gadgets.system.TimeSinceChartResource
@Path("/timeSince")
@Produces("application/json")
public class TimeSinceChartResource
extends SearchQueryBackedResource
REST endpoint to validate and retrieve a Recent Created chart.
- Since:
- v4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA simple bean contain all information required to render the Recently Created Chartstatic class -
Field Summary
Fields inherited from class com.atlassian.jira.gadgets.system.SearchQueryBackedResource
authenticationContext, QUERY_STRING, searchService -
Constructor Summary
ConstructorsConstructorDescriptionTimeSinceChartResource(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, ChartFactory chartFactory, FieldManager fieldManager, ResourceDateValidator resourceDateValidator, VelocityRequestContextFactory velocityRequestContextFactory, TimeZoneManager timeZoneManager) TimeSinceChartResource(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, ChartFactory chartFactory, FieldManager fieldManager, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties, TimeZoneManager timeZoneManager) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsegenerateChart(jakarta.servlet.http.HttpServletRequest request, String queryString, String dateField, String days, String endDate, String periodName, boolean isCumulative, int width, int height, boolean inline, boolean returnData) Generate a Time Since Chart and returns a simple bean containing all relevant informationjakarta.ws.rs.core.ResponsevalidateChart(String queryString, String dateField, 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, validateSizeMethods inherited from class com.atlassian.jira.gadgets.system.AbstractResource
createErrorResponse, createIndexingUnavailableResponse, createServerErroreResponse, createValidationResponse
-
Constructor Details
-
TimeSinceChartResource
@Inject public TimeSinceChartResource(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, ChartFactory chartFactory, FieldManager fieldManager, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties, TimeZoneManager timeZoneManager) -
TimeSinceChartResource
public TimeSinceChartResource(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, ChartFactory chartFactory, FieldManager fieldManager, ResourceDateValidator resourceDateValidator, VelocityRequestContextFactory velocityRequestContextFactory, TimeZoneManager timeZoneManager)
-
-
Method Details
-
generateChart
@GET @Path("/generate") public jakarta.ws.rs.core.Response generateChart(@Context jakarta.servlet.http.HttpServletRequest request, @QueryParam("projectOrFilterId") String queryString, @QueryParam("dateField") @DefaultValue("created") String dateField, @QueryParam("daysprevious") @DefaultValue("30") String days, @QueryParam("endDate") String endDate, @QueryParam("periodName") @DefaultValue("daily") String periodName, @QueryParam("isCumulative") @DefaultValue("true") boolean isCumulative, @QueryParam("width") @DefaultValue("450") int width, @QueryParam("height") @DefaultValue("300") int height, @QueryParam("inline") @DefaultValue("false") boolean inline, @QueryParam("returnData") @DefaultValue("false") boolean returnData) Generate a Time Since Chart and returns a simple bean containing all relevant 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-")dateField- The date field to calculate chart againstdays- The number of days previous to go back for. Must be positive.periodName- The name of the period. See -ChartFactory.PeriodNameisCumulative- Whether the previous column is added the current column to give a total for the period.width- the width of the chart in pixels (defaults to 400px)height- the height of the chart in pixels (defaults to 250px)returnData- if true, the detailed data will be returned.- Returns:
- a
TimeSinceChartResource.TimeSinceChartif all params validated else a Collection ofValidationError
-
validateChart
@GET @Path("/validate") public jakarta.ws.rs.core.Response validateChart(@QueryParam("projectOrFilterId") String queryString, @QueryParam("dateField") @DefaultValue("created") String dateField, @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-").dateField- The date field to calculate chart againstdays- 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.
-