com.atlassian.jira.project
Interface ProjectManager

All Known Implementing Classes:
AbstractProjectManager, CachingProjectManager, DefaultProjectManager

public interface ProjectManager

Implementations of this interface are responsible for all management of project entities within JIRA.


Method Summary
 List convertToProjects(Collection projectIds)
          Converts a collection of projectIds to a collection of projects.
 org.ofbiz.core.entity.GenericValue getComponent(org.ofbiz.core.entity.GenericValue project, String name)
          Get a component from within this project, based on the project and the component name.
 org.ofbiz.core.entity.GenericValue getComponent(Long id)
          Get a component from within this project, by it's id.
 Collection getComponents(org.ofbiz.core.entity.GenericValue project)
          Returns a collection of components in a project.
 Collection getComponents(List ids)
          Get a list of components from their IDs
 User getDefaultAssignee(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue component)
          Gets the default assignee for a project and/or component depending on if a component was specified.
 long getNextId(org.ofbiz.core.entity.GenericValue project)
          Get the next issue ID from this project (transactional).
 org.ofbiz.core.entity.GenericValue getProject(org.ofbiz.core.entity.GenericValue issue)
          Returns a project GenericValue that an issue is in.
 org.ofbiz.core.entity.GenericValue getProject(Long id)
          Deprecated. please use getProjectObj(java.lang.Long)
 org.ofbiz.core.entity.GenericValue getProjectByKey(String key)
          Deprecated. please use the getProjectObjByKey(java.lang.String) method to return a Project object
 org.ofbiz.core.entity.GenericValue getProjectByName(String name)
          Retrieve a single project by it's project name.
 Collection getProjectCategories()
          Get all ProjectCategories.
 org.ofbiz.core.entity.GenericValue getProjectCategory(Long id)
          Returns a single project category by id.
 org.ofbiz.core.entity.GenericValue getProjectCategoryByName(String projectCategoryName)
          Find a project category by name.
 org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
          Returns a project's category.
 Project getProjectObj(Long id)
          Retrieves a single Project by its id.
 Project getProjectObjByKey(String projectKey)
          Returns a Project object based on the passed in project key.
 Project getProjectObjByName(String projectName)
          Returns a Project object based on the passed in project name.
 Collection getProjects()
          Return all project GenericValues.
 Collection getProjectsByLead(User leadUser)
          Returns all the projects that leadUser is the project lead for.
 Collection getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
          Returns a list of projects in a particular category.
 Collection getProjectsWithNoCategory()
          Returns a list of projects without project category, sorted by project name
 boolean isDefaultAssignee(org.ofbiz.core.entity.GenericValue project)
          Checks if there is a valid default assignee for a given project.
 boolean isDefaultAssignee(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue component)
          This function checks if there is a valid default assignee set in the system
If this returns false then the getDefaultAssignee(GenericValue, GenericValue) will throw an exception
 void refresh()
          Causes a full refresh of the project cache.
 void refreshProjectDependencies(org.ofbiz.core.entity.GenericValue project)
          This will refresh the dependencies of a project.
 void setProjectCategory(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue category)
          Sets a projects category.
 void updateProject(org.ofbiz.core.entity.GenericValue updatedProject)
          Persists a project GenericValue to the database.
 void updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
          Persist an updated project category.
 

Method Detail

updateProject

void updateProject(org.ofbiz.core.entity.GenericValue updatedProject)
                   throws DataAccessException
Persists a project GenericValue to the database.

Parameters:
updatedProject -
Throws:
DataAccessException

getProject

org.ofbiz.core.entity.GenericValue getProject(org.ofbiz.core.entity.GenericValue issue)
                                              throws DataAccessException
Returns a project GenericValue that an issue is in.

Parameters:
issue -
Returns:
Throws:
DataAccessException

getProject

org.ofbiz.core.entity.GenericValue getProject(Long id)
                                              throws DataAccessException
Deprecated. please use getProjectObj(java.lang.Long)

Retrieve a single project by it's id.

Throws:
DataAccessException

getProjectObj

Project getProjectObj(Long id)
                      throws DataAccessException
Retrieves a single Project by its id.

Parameters:
id -
Returns:
project object or null if project with that id doesn't exist
Throws:
DataAccessException

getProjectByName

org.ofbiz.core.entity.GenericValue getProjectByName(String name)
                                                    throws DataAccessException
Retrieve a single project by it's project name.

Throws:
DataAccessException

getProjectByKey

org.ofbiz.core.entity.GenericValue getProjectByKey(String key)
                                                   throws DataAccessException
Deprecated. please use the getProjectObjByKey(java.lang.String) method to return a Project object

Retrieve a single project by it's project key.

Throws:
DataAccessException

getProjectObjByKey

Project getProjectObjByKey(String projectKey)
Returns a Project object based on the passed in project key.

Parameters:
projectKey -
Returns:
the Project object specified by the key or null

getProjectObjByName

Project getProjectObjByName(String projectName)
Returns a Project object based on the passed in project name.

Parameters:
projectName - the name of the project
Returns:
the Project object specified by the supplied name or null

getComponent

org.ofbiz.core.entity.GenericValue getComponent(Long id)
                                                throws DataAccessException
Get a component from within this project, by it's id.

Parameters:
id -
Returns:
A component GenericValue.
Throws:
DataAccessException

getComponent

org.ofbiz.core.entity.GenericValue getComponent(org.ofbiz.core.entity.GenericValue project,
                                                String name)
                                                throws DataAccessException
Get a component from within this project, based on the project and the component name. NOTE: This is not cached currently.

Parameters:
project -
name -
Returns:
A component GenericValue.
Throws:
DataAccessException

getComponents

Collection getComponents(org.ofbiz.core.entity.GenericValue project)
                         throws DataAccessException
Returns a collection of components in a project.

Parameters:
project -
Returns:
A collection of GenericValues.
Throws:
DataAccessException

getComponents

Collection getComponents(List ids)
                         throws DataAccessException
Get a list of components from their IDs

Parameters:
ids -
Returns:
A collection of component GenericValues
Throws:
DataAccessException

getProjects

Collection getProjects()
                       throws DataAccessException
Return all project GenericValues. TODO: Create a getProjectObjects() and deprecate this method.

Throws:
DataAccessException

getNextId

long getNextId(org.ofbiz.core.entity.GenericValue project)
               throws DataAccessException
Get the next issue ID from this project (transactional). Each project maintains an internal counter for the number of issues. This method may be used to construct a new issue key.

Parameters:
project -
Returns:
A long value representing a new issue id for the project.
Throws:
DataAccessException

refreshProjectDependencies

void refreshProjectDependencies(org.ofbiz.core.entity.GenericValue project)
                                throws DataAccessException
This will refresh the dependencies of a project. Please do not use this to refresh the passed in project in the project cache. use refresh()

Parameters:
project -
Throws:
DataAccessException

refresh

void refresh()
Causes a full refresh of the project cache.


getProjectCategories

Collection getProjectCategories()
                                throws DataAccessException
Get all ProjectCategories.

Returns:
A collection of category GenericValues
Throws:
DataAccessException

getProjectCategory

org.ofbiz.core.entity.GenericValue getProjectCategory(Long id)
                                                      throws DataAccessException
Returns a single project category by id.

Parameters:
id -
Returns:
A category GenericValue
Throws:
DataAccessException

getProjectCategoryByName

org.ofbiz.core.entity.GenericValue getProjectCategoryByName(String projectCategoryName)
                                                            throws DataAccessException
Find a project category by name. NOTE: The current implementation is not the most efficient.

Parameters:
projectCategoryName -
Returns:
A category GenericValue
Throws:
DataAccessException

updateProjectCategory

void updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
                           throws DataAccessException
Persist an updated project category.

Parameters:
projectCat -
Throws:
DataAccessException

getProjectsFromProjectCategory

Collection getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
                                          throws DataAccessException
Returns a list of projects in a particular category.

Parameters:
projectCategory -
Returns:
A collection of project GenericValues sorted by name. Returns null if the projectCategory param is null
Throws:
DataAccessException

getProjectsWithNoCategory

Collection getProjectsWithNoCategory()
                                     throws DataAccessException
Returns a list of projects without project category, sorted by project name

Returns:
A collection of project GenericValues sorted by name
Throws:
DataAccessException

getProjectCategoryFromProject

org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
                                                                 throws DataAccessException
Returns a project's category.

Parameters:
project -
Returns:
A category GenericValue or null if no category exists.
Throws:
DataAccessException

setProjectCategory

void setProjectCategory(org.ofbiz.core.entity.GenericValue project,
                        org.ofbiz.core.entity.GenericValue category)
                        throws DataAccessException
Sets a projects category.

Parameters:
project -
category -
Throws:
DataAccessException
IllegalArgumentException - if the project provided is null

isDefaultAssignee

boolean isDefaultAssignee(org.ofbiz.core.entity.GenericValue project,
                          org.ofbiz.core.entity.GenericValue component)
This function checks if there is a valid default assignee set in the system
If this returns false then the getDefaultAssignee(GenericValue, GenericValue) will throw an exception

Parameters:
project -
component -
Returns:
true if either the component is not null and has an assignee type != project default, or if isDefaultAssignee(org.ofbiz.core.entity.GenericValue) is true

getDefaultAssignee

User getDefaultAssignee(org.ofbiz.core.entity.GenericValue project,
                        org.ofbiz.core.entity.GenericValue component)
Gets the default assignee for a project and/or component depending on if a component was specified.

Parameters:
project -
component -
Returns:
A User
Throws:
DefaultAssigneeException - If the default assignee does NOT have ASSIGNABLE permission OR Unassigned issues are turned off.

isDefaultAssignee

boolean isDefaultAssignee(org.ofbiz.core.entity.GenericValue project)
Checks if there is a valid default assignee for a given project.

Parameters:
project -
Returns:
False if no assignee type is set for a project and unassigned issues are not allowed, and the projectlead is not assignable. Also false, if either the assigneetype is not unassigned or unassigned issues are not allowed and the projectlead is not assignable. Otherwise returns TRUE since there is a default assignee.

getProjectsByLead

Collection getProjectsByLead(User leadUser)
Returns all the projects that leadUser is the project lead for.

Parameters:
leadUser -
Returns:
A collection of project GenericValues

convertToProjects

List convertToProjects(Collection projectIds)
Converts a collection of projectIds to a collection of projects. Will return null if is null or blank

Parameters:
projectIds - a Collection of Longs
Returns:
List of Project GenericValues. Null if input is empty


Copyright © 2002-2009 Atlassian. All Rights Reserved.