public class

ProjectTypeManagerImpl

extends Object
implements ProjectTypeManager
java.lang.Object
   ↳ com.atlassian.jira.project.type.ProjectTypeManagerImpl

Class Overview

Default implementation for ProjectTypeManager

Summary

Constants
int INACCESSIBLE_WEIGHT
Public Constructors
ProjectTypeManagerImpl(JiraApplicationAdapter adapter)
Public Methods
Option<ProjectType> getAccessibleProjectType(ApplicationUser user, ProjectTypeKey key)
Returns the project type with the given key, if it is accessible for the given user.
Option<ProjectType> getAccessibleProjectType(ProjectTypeKey key)
Returns the project type with the given key, if it is accessible.
List<ProjectType> getAllAccessibleProjectTypes()
Returns all the accessible project types defined on the JIRA instance sorted by weight.
List<ProjectType> getAllProjectTypes()
Returns all the project types defined on the JIRA instance sorted by weight not taking into account whether the license to use those project types is valid or not.
Option<Application> getApplicationWithType(ProjectTypeKey key)
Returns the application that provides the given project type.
Option<ProjectType> getByKey(ProjectTypeKey key)
Returns the project type with the given key, if it is present on the JIRA instance.
ProjectType getInaccessibleProjectType()
Returns a project type with information to be displayed to users when a specific project type is not accessible.
boolean isProjectTypeInstalledButInaccessible(ProjectTypeKey projectTypeKey)
Returns whether the project type with the given key is installed but inaccessible.
boolean isProjectTypeUninstalled(ProjectTypeKey projectTypeKey)
Returns whether the project type with the given key is uninstalled.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.project.type.ProjectTypeManager

Constants

public static final int INACCESSIBLE_WEIGHT

Constant Value: 1000000000 (0x3b9aca00)

Public Constructors

public ProjectTypeManagerImpl (JiraApplicationAdapter adapter)

Public Methods

public Option<ProjectType> getAccessibleProjectType (ApplicationUser user, ProjectTypeKey key)

Returns the project type with the given key, if it is accessible for the given user. A project type is considered accessible for an user if the application that defines it is present on the JIRA instance, that application has a license and the given user is licensed for that application.

Parameters
user The user
key The project type key
Returns
  • The project type of the given key

public Option<ProjectType> getAccessibleProjectType (ProjectTypeKey key)

Returns the project type with the given key, if it is accessible. A project type is considered accessible if the application that defines it is present on the JIRA instance and if there is a license for that application in the instance. Generally this method should be used when retrieving a project type for display in the application. The convention is to always display the project type if the application is licensed, even if the current user isn't licensed to access that application. Not showing the project type due to the user's individual license access should be the exception.

Parameters
key The project type key
Returns
  • The project type for the given key

public List<ProjectType> getAllAccessibleProjectTypes ()

Returns all the accessible project types defined on the JIRA instance sorted by weight. A project type is considered accessible if the application that defines it is present on the JIRA instance and if there is a license for that application on the instance. This method should be used when displaying available project types to admins (e.g. project create dialog, change project type dialog)

Returns
  • all the accessible project types defined on the JIRA instance sorted by weight.

public List<ProjectType> getAllProjectTypes ()

Returns all the project types defined on the JIRA instance sorted by weight not taking into account whether the license to use those project types is valid or not.

Returns
  • all the project types defined on the JIRA instance sorted by weight.

public Option<Application> getApplicationWithType (ProjectTypeKey key)

Returns the application that provides the given project type.

Parameters
key The project type key
Returns
  • The application associated to that project.

public Option<ProjectType> getByKey (ProjectTypeKey key)

Returns the project type with the given key, if it is present on the JIRA instance.

Parameters
key The project type key
Returns
  • The project type for the given key

public ProjectType getInaccessibleProjectType ()

Returns a project type with information to be displayed to users when a specific project type is not accessible.

A project type might be inaccessible if the user is not licensed under the application that defines the type or if the application that defines the type is not installed on the JIRA instance.

Returns
  • A project type encapsulating information for when a specific type is not accessible;

public boolean isProjectTypeInstalledButInaccessible (ProjectTypeKey projectTypeKey)

Returns whether the project type with the given key is installed but inaccessible.

Parameters
projectTypeKey The key of the project type for which we are performing the check.
Returns
  • Whether the project type is uninstalled but inaccessible.

public boolean isProjectTypeUninstalled (ProjectTypeKey projectTypeKey)

Returns whether the project type with the given key is uninstalled.

Parameters
projectTypeKey The key of the project type for which we are performing the check.
Returns
  • Whether the project type is uninstalled.