com.atlassian.jira.gadgets.system
Class TimeSinceChartResource

java.lang.Object
  extended by com.atlassian.jira.gadgets.system.AbstractResource
      extended by com.atlassian.jira.gadgets.system.SearchQueryBackedResource
          extended by com.atlassian.jira.gadgets.system.TimeSinceChartResource

public class TimeSinceChartResource
extends SearchQueryBackedResource

REST endpoint to validate and retreive a Recent Created chart.

Since:
v4.0

Nested Class Summary
static class TimeSinceChartResource.TimeSinceChart
          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
TimeSinceChartResource(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, ChartFactory chartFactory, FieldManager fieldManager, ResourceDateValidator resourceDateValidator, VelocityRequestContextFactory velocityRequestContextFactory)
           
TimeSinceChartResource(ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, SearchService searchService, PermissionManager permissionManager, ChartFactory chartFactory, FieldManager fieldManager, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties)
           
 
Method Summary
 javax.ws.rs.core.Response generateChart(javax.servlet.http.HttpServletRequest request, String queryString, String dateField, String days, String periodName, boolean isCumulative, int width, int height)
          Generate a Time Since Chart Chart and returns a simple bean containing all relevent information
 javax.ws.rs.core.Response validateChart(String queryString, String dateField, String days, String periodName)
          Ensures all parameters are valid for the Recently Created Chart
 
Methods inherited from class com.atlassian.jira.gadgets.system.SearchQueryBackedResource
getFilterTitle, getFilterUrl, getSearchRequestAndValidate
 
Methods inherited from class com.atlassian.jira.gadgets.system.AbstractResource
createErrorResponse, createIndexingUnavailableResponse, createValidationResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeSinceChartResource

public TimeSinceChartResource(ChartUtils chartUtils,
                              JiraAuthenticationContext authenticationContext,
                              SearchService searchService,
                              PermissionManager permissionManager,
                              ChartFactory chartFactory,
                              FieldManager fieldManager,
                              VelocityRequestContextFactory velocityRequestContextFactory,
                              ApplicationProperties applicationProperties)

TimeSinceChartResource

public TimeSinceChartResource(ChartUtils chartUtils,
                              JiraAuthenticationContext authenticationContext,
                              SearchService searchService,
                              PermissionManager permissionManager,
                              ChartFactory chartFactory,
                              FieldManager fieldManager,
                              ResourceDateValidator resourceDateValidator,
                              VelocityRequestContextFactory velocityRequestContextFactory)
Method Detail

generateChart

public javax.ws.rs.core.Response generateChart(@Context
                                               javax.servlet.http.HttpServletRequest request,
                                               String queryString,
                                               String dateField,
                                               String days,
                                               String periodName,
                                               boolean isCumulative,
                                               int width,
                                               int height)
Generate a Time Since Chart Chart and returns a simple bean containing all relevent information

Parameters:
request - The current HTTPRequest. Needed for url generation
queryString - a filter id (starts with "filter-") or project id (starts with "project-")or jql (starts with "jql-")
dateField - The date field to calculate chart against
days - The number of days previous to go back for. Must be positive.
periodName - The name of the period. See - ChartFactory.PeriodName
isCumulative - Whether or not 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)
Returns:
a TimeSinceChartResource.TimeSinceChart if all params validated else a Collection of ValidationError

validateChart

public javax.ws.rs.core.Response validateChart(String queryString,
                                               String dateField,
                                               String days,
                                               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 against
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.


Copyright © 2002-2014 Atlassian. All Rights Reserved.