Class ProjectsAndProjectCategoriesResource
- Since:
- v4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProjectsAndProjectCategoriesResource
(JiraAuthenticationContext authenticationContext, InternalProjectPermissionHelper projectPermissionHelper) -
Method Summary
Modifier and TypeMethodDescriptionfilterProjectCategoryIds
(Collection<String> projectOrCategoryIds) Filter project category ids from the given collection.filterProjectIds
(Collection<String> projectOrCategoryIds) Filter project ids from the given collection.javax.ws.rs.core.Response
generate()
Generates an option list of all projects and categories.
-
Field Details
-
ALL_PROJECTS
- See Also:
-
ALL_CATEGORIES
- See Also:
-
-
Constructor Details
-
ProjectsAndProjectCategoriesResource
@Inject public ProjectsAndProjectCategoriesResource(JiraAuthenticationContext authenticationContext, InternalProjectPermissionHelper projectPermissionHelper)
-
-
Method Details
-
generate
@GET public javax.ws.rs.core.Response generate()Generates an option list of all projects and categories.This is the only REST endpoint, accessed via a GET method to the path annotating the class.
Currently, there is no parameter required.
The returned option list will always contain an option group for "Projects", which will always contain an option "All Projects" as the first element, even if there is no project at all.
The result may also contain a "Project Categories" option group, if any project is assigned a category. It should be noted that in this implementation, any existing project category is not included if there is no project is listed under that category. This is consistent with the implementation of the road map portlet.
There are some noticeable differences between this implementation of that of road map gadget:
- The option group name is now always shown even if there is only one group.
- There is no enterprise edition check when handling project categories, as this will be available in all versions soon.
- Returns:
- an OK response with an
ProjectsAndProjectCategoriesResource.ProjectAndCategories
object.
-
filterProjectIds
Filter project ids from the given collection. Returns a set of project ids as Long objects. Value is a valid project id if it is a long number.- Parameters:
projectOrCategoryIds
- collection of project or category ids- Returns:
- set of project ids, never null
-
filterProjectCategoryIds
Filter project category ids from the given collection. Returns a set of project category ids as Long objects. Value is a valid category if it takes form "catXYZ" where "cat" is the prefix (CATEGORY
) and XYZ is a long number.- Parameters:
projectOrCategoryIds
- collection of project or category ids- Returns:
- set of project category ids, never null
-