com.atlassian.jira.gadgets.system
Class PieChartResource

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.PieChartResource

public class PieChartResource
extends SearchQueryBackedResource

REST endpoint to validate and retreive Pie chart.

Since:
v4.0

Nested Class Summary
static class PieChartResource.DataRow
           
static class PieChartResource.PieChart
          A simple bean contain all information required to render the Pie Chart
 
Field Summary
 
Fields inherited from class com.atlassian.jira.gadgets.system.SearchQueryBackedResource
chartUtils, permissionManager, QUERY_STRING, searchService
 
Constructor Summary
PieChartResource(ChartFactory chartFactory, ChartUtils chartUtils, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, StatisticTypesResource statisticTypesResource, SearchService searchService, VelocityRequestContextFactory velocityRequestContextFactory)
           
 
Method Summary
 javax.ws.rs.core.Response getPieChart(String queryString, String statType, boolean returnData, int width, int height)
          Generate a pie chart and returns a simple bean containing all relievent information
 javax.ws.rs.core.Response validatePieChart(String queryString, String statType)
          Ensures all parameters are valid for the Pie 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

PieChartResource

public PieChartResource(ChartFactory chartFactory,
                        ChartUtils chartUtils,
                        JiraAuthenticationContext authenticationContext,
                        PermissionManager permissionManager,
                        StatisticTypesResource statisticTypesResource,
                        SearchService searchService,
                        VelocityRequestContextFactory velocityRequestContextFactory)
Method Detail

getPieChart

public javax.ws.rs.core.Response getPieChart(String queryString,
                                             String statType,
                                             boolean returnData,
                                             int width,
                                             int height)
Generate a pie chart and returns a simple bean containing all relievent information

Parameters:
queryString - a filter id (starts with "filter-") or project id (starts with "project-") or jql (starts with "jql-")
statType - a valid statistic type. See StatisticTypesResource
returnData - whther or not to return the data
width - the width of the chart in pixels (defaults to 400px)
height - the height of the chart in pixels (defaults to 250px)
Returns:
a PieChartResource.PieChart if all params validated else a Collection of ValidationError

validatePieChart

public javax.ws.rs.core.Response validatePieChart(String queryString,
                                                  String statType)
Ensures all parameters are valid for the Pie Chart

Parameters:
queryString - a filter id (starts with "filter-") or project id (starts with "project-") or jql (starts with "jql-")
statType - a valid statistic type. See StatisticTypesResource
Returns:
a Collection of ValidationError. Or empty list if no errors.


Copyright © 2002-2012 Atlassian. All Rights Reserved.