com.atlassian.jira.portal
Class ProjectAndProjectCategoryValuesGenerator

java.lang.Object
  extended by com.atlassian.jira.portal.ProjectAndProjectCategoryValuesGenerator
All Implemented Interfaces:
com.atlassian.configurable.ValuesGenerator

public class ProjectAndProjectCategoryValuesGenerator
extends Object
implements com.atlassian.configurable.ValuesGenerator

Generator for project and category values.

This generator produces a map of value ->label for HTML select box options. The option may look like

 All Projects
 homosapian
 monkey
 
for projects only, or:
 Projects
 - All Projects
 - homosapian
 - monkey
 Project Categories
 - Category 1
 
for projects and categories.

Since:
v3.11

Nested Class Summary
static class ProjectAndProjectCategoryValuesGenerator.Values
           
 
Field Summary
 
Fields inherited from interface com.atlassian.configurable.ValuesGenerator
NONE
 
Constructor Summary
ProjectAndProjectCategoryValuesGenerator()
           
 
Method Summary
static Set<Long> filterProjectCategoryIds(Collection<String> projectOrCategoryIds)
          Filter project category ids from the given collection.
static Set<Long> filterProjectIds(Collection<String> projectOrCategoryIds)
          Filter project ids from the given collection.
 Map<String,String> getValues(Map params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectAndProjectCategoryValuesGenerator

public ProjectAndProjectCategoryValuesGenerator()
Method Detail

getValues

public Map<String,String> getValues(Map params)
Specified by:
getValues in interface com.atlassian.configurable.ValuesGenerator

filterProjectIds

public static Set<Long> filterProjectIds(Collection<String> projectOrCategoryIds)
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

public static Set<Long> filterProjectCategoryIds(Collection<String> projectOrCategoryIds)
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 (Prefix#CATEGORY) and XYZ is a long number.

Parameters:
projectOrCategoryIds - collection of project or category ids
Returns:
set of project category ids, never null


Copyright © 2002-2011 Atlassian. All Rights Reserved.