com.atlassian.jira.gadgets.system
Class RoadMapResource

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

public class RoadMapResource
extends AbstractResource

REST endpoint to retrieve a list of unreleased versions, according to the input criteria. It also provides a REST endpoint to validate the input criteria to make sure specified projects exist, etc.

Since:
v4.0

Nested Class Summary
static class RoadMapResource.ProjectData
          Contains the data of a project a version belongs to, including: The id of the project The project key The project name
static class RoadMapResource.ResolutionData
          The data structure of statistics on resolved/unresolved, with jql clause used to retrieve the set of the issues.
static class RoadMapResource.RoadMapData
          The data structure of the road map generated by the RoadMapResource.
static class RoadMapResource.VersionData
          The data structure of a project version contained in the road map data.
 
Field Summary
static int DEFAULT_DAYS_MAX_INCL
           
static int DEFAULT_NUM_MAX_INCL
           
 
Constructor Summary
RoadMapResource(JiraAuthenticationContext authCtx, PermissionManager permissionManager, ProjectManager projectManager, VersionManager versionManager, SearchProvider searchProvider, SearchService searchService, VelocityRequestContextFactory velocityRequestContextFactory, DateTimeFormatter dateTimeFormatter)
           
 
Method Summary
 javax.ws.rs.core.Response generate(String projectsOrCategories, int days, int num)
          Generates the road map data based on the given parameters.
 boolean isOverdue(Version version)
           
 javax.ws.rs.core.Response validate(String projectsOrCategories, String days, String num)
          Validates the given configuration.
 
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
 

Field Detail

DEFAULT_DAYS_MAX_INCL

public static final int DEFAULT_DAYS_MAX_INCL
See Also:
Constant Field Values

DEFAULT_NUM_MAX_INCL

public static final int DEFAULT_NUM_MAX_INCL
See Also:
Constant Field Values
Constructor Detail

RoadMapResource

public RoadMapResource(JiraAuthenticationContext authCtx,
                       PermissionManager permissionManager,
                       ProjectManager projectManager,
                       VersionManager versionManager,
                       SearchProvider searchProvider,
                       SearchService searchService,
                       VelocityRequestContextFactory velocityRequestContextFactory,
                       DateTimeFormatter dateTimeFormatter)
Method Detail

validate

public javax.ws.rs.core.Response validate(String projectsOrCategories,
                                          String days,
                                          String num)
Validates the given configuration.

Parameters:
projectsOrCategories - the ids of all selected projects and project categories, concatenated by pipe symbole (|). A special id value of "allprojects" indicates all projects are selected. Project ids must be numeric; otherwise, the id is ignored. Category ids must be numeric and prefixed by "cat"; otherwise, the id is ignored. If none is selected or one of the selecte projects/categories does not exist, a validate error is returned in the response.
days - the number of days to cover. If zero, only overdue versions will be returned. Must not be negative. If negative or non-numeric, a validation error is returned
num - the maximum number of results. Must be positive. if negative, zero or non-numeric, a validation error is returned
Returns:
a response with status code 200 if validation passes or with status code 400 if fail, in which case, validation errors are included in the response

generate

public javax.ws.rs.core.Response generate(String projectsOrCategories,
                                          int days,
                                          int num)
Generates the road map data based on the given parameters.

Parameters:
projectsOrCategories - the ids of all selected projects and project categories, concatenated by pipe symbole (|). A special id value of "allprojects" indicates all projects are selected. Project ids must be numeric; otherwise, the id is ignored. Category ids must be numeric and prefixed by "cat"; otherwise, the id is ignored.
days - the number of days to cover. If zero, only overdue versions will be returned. Must not be negative.
num - the maximum number of results. Must be positive.
Returns:
a response with status code 200 containing RoadMapResource.RoadMapData. If there is an error in the processing, a response with status code 500 is returned

isOverdue

public boolean isOverdue(Version version)


Copyright © 2002-2014 Atlassian. All Rights Reserved.