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. TODO: change this interface to use the ProjectCategory object.


Method Summary
 java.util.List<org.ofbiz.core.entity.GenericValue> convertToProjects(java.util.Collection<java.lang.Long> projectIds)
          Converts a collection of projectIds to a collection of projects.
 Project createProject(java.lang.String name, java.lang.String key, java.lang.String description, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType)
          Creates the project in the database, and adds default project roles for this project.
 Project createProject(java.lang.String name, java.lang.String key, java.lang.String description, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType, java.lang.Long avatarId)
          Creates the project in the database, and adds default project roles for this project.
 org.ofbiz.core.entity.GenericValue getComponent(org.ofbiz.core.entity.GenericValue project, java.lang.String name)
          Deprecated. Use ProjectComponentManager instead. Deprecated in v4.0.
 org.ofbiz.core.entity.GenericValue getComponent(java.lang.Long id)
          Deprecated. Use ProjectComponentManager instead. Deprecated in v4.0.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getComponents(org.ofbiz.core.entity.GenericValue project)
          Deprecated. Use ProjectComponentManager instead. Deprecated in v4.0.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getComponents(java.util.List<java.lang.Long> ids)
          Deprecated. Use ProjectComponentManager.getComponents(java.util.List) instead. Deprecated since v4.0.
 com.opensymphony.user.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)
          Deprecated. Use getNextId(Project) instead. Deprecated since v4.0.
 long getNextId(Project project)
          Get the next issue ID from this project (transactional).
 org.ofbiz.core.entity.GenericValue getProject(org.ofbiz.core.entity.GenericValue issue)
          Deprecated. Use Issue.getProjectObject() instead. Deprecated since v4.0.
 org.ofbiz.core.entity.GenericValue getProject(java.lang.Long id)
          Deprecated. please use getProjectObj(java.lang.Long)
 org.ofbiz.core.entity.GenericValue getProjectByKey(java.lang.String key)
          Deprecated. please use the getProjectObjByKey(java.lang.String) method to return a Project object
 org.ofbiz.core.entity.GenericValue getProjectByName(java.lang.String name)
          Deprecated. Please use getProjectObjByName(java.lang.String) instead. Deprecated since v4.0.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjectCategories()
          Get all ProjectCategories.
 org.ofbiz.core.entity.GenericValue getProjectCategory(java.lang.Long id)
          Returns a single project category by id.
 org.ofbiz.core.entity.GenericValue getProjectCategoryByName(java.lang.String projectCategoryName)
          Find a project category by name.
 org.ofbiz.core.entity.GenericValue getProjectCategoryByNameIgnoreCase(java.lang.String projectCategoryName)
          Find a project category by name ignoring the case of the category name.
 org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
          Returns a project's category.
 Project getProjectObj(java.lang.Long id)
          Retrieves a single Project by its id.
 Project getProjectObjByKey(java.lang.String projectKey)
          Returns a Project object based on the passed in project key.
 Project getProjectObjByKeyIgnoreCase(java.lang.String projectKey)
          Returns a Project object based ont he passed in project key, not taking into account the case of the project key.
 Project getProjectObjByName(java.lang.String projectName)
          Returns a Project object based on the passed in project name.
 java.util.List<Project> getProjectObjects()
          Return all Projects ordered by name.
 java.util.Collection<Project> getProjectObjectsFromProjectCategory(java.lang.Long projectCategoryId)
          Returns a list of projects in a particular category.
 java.util.Collection<Project> getProjectObjectsWithNoCategory()
          Returns a list of projects without project category, sorted by project name
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjects()
          Deprecated. Use getProjectObjects() instead. Deprecated in v4.0.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjectsByLead(com.opensymphony.user.User leadUser)
          Returns all the projects that leadUser is the project lead for.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
          Returns a list of projects in a particular category.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> 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 removeProject(Project project)
          Deletes the provided project from the database.
 void removeProjectIssues(Project project)
          Removes all issues for a particular 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)
          Deprecated. Use updateProject(Project, String, String, String, String, Long) instead
 Project updateProject(Project originalProject, java.lang.String name, java.lang.String description, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType)
          Updates the project provided with the new attributes passed in.
 Project updateProject(Project originalProject, java.lang.String name, java.lang.String description, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType, java.lang.Long avatarId)
          Updates the project provided with the new attributes passed in.
 void updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
          Persist an updated project category.
 

Method Detail

createProject

Project createProject(java.lang.String name,
                      java.lang.String key,
                      java.lang.String description,
                      java.lang.String lead,
                      java.lang.String url,
                      java.lang.Long assigneeType)
Creates the project in the database, and adds default project roles for this project. If no name, key or lead are provided an exception will be thrown.

Parameters:
name - The name of the new project
key - The project key of the new project
description - An optional description for the project
lead - The lead developer for the project
url - An optional URL for the new project
assigneeType - The default assignee for issues created in this project. May be either project lead, or unassigned if unassigned issues are enabled.
Returns:
The newly created project.

createProject

Project createProject(java.lang.String name,
                      java.lang.String key,
                      java.lang.String description,
                      java.lang.String lead,
                      java.lang.String url,
                      java.lang.Long assigneeType,
                      java.lang.Long avatarId)
Creates the project in the database, and adds default project roles for this project. If no name, key or lead are provided an exception will be thrown.

Parameters:
name - The name of the new project
key - The project key of the new project
description - An optional description for the project
lead - The lead developer for the project
url - An optional URL for the new project
assigneeType - The default assignee for issues created in this project. May be either project lead, or unassigned if unassigned issues are enabled.
avatarId - the id of an existing system avatar.
Returns:
The newly created project.

updateProject

@Deprecated
void updateProject(org.ofbiz.core.entity.GenericValue updatedProject)
                   throws DataAccessException
Deprecated. Use updateProject(Project, String, String, String, String, Long) instead

Persists a project GenericValue to the database.

Parameters:
updatedProject - Project details to update.
Throws:
DataAccessException - If any errors occur accessing the DB.

updateProject

Project updateProject(Project originalProject,
                      java.lang.String name,
                      java.lang.String description,
                      java.lang.String lead,
                      java.lang.String url,
                      java.lang.Long assigneeType)
Updates the project provided with the new attributes passed in. This method is responsible for persisting any changes to the database.

Parameters:
originalProject - The project to be updated.
name - The name for the updated project
description - An optional description for the project
lead - The lead developer for the project
url - An optional URL for the updated project
assigneeType - The default assignee for issues created in this project. May be either project lead, or unassigned if unassigned issues are enabled.
Returns:
The updated project

updateProject

Project updateProject(Project originalProject,
                      java.lang.String name,
                      java.lang.String description,
                      java.lang.String lead,
                      java.lang.String url,
                      java.lang.Long assigneeType,
                      java.lang.Long avatarId)
Updates the project provided with the new attributes passed in. This method is responsible for persisting any changes to the database.

Parameters:
originalProject - The project to be updated.
name - The name for the updated project
description - An optional description for the project
lead - The lead developer for the project
url - An optional URL for the updated project
assigneeType - The default assignee for issues created in this project. May be either project lead, or unassigned if unassigned issues are enabled.
avatarId - the id of an existing avatar.
Returns:
The updated project

removeProjectIssues

void removeProjectIssues(Project project)
                         throws RemoveException
Removes all issues for a particular project. A RemoveException will be thrown on any errors removing issues.

Parameters:
project - The project for which issues will be deleted.
Throws:
RemoveException - if there's any errors removing issues

removeProject

void removeProject(Project project)
Deletes the provided project from the database. Please note that this method only deletes the project itself and not any related entities. Use ProjectService.deleteProject(com.opensymphony.user.User, com.atlassian.jira.bc.project.ProjectService.DeleteProjectValidationResult) to properly delete a project.

Parameters:
project - The project to be deleted.

getProject

@Deprecated
org.ofbiz.core.entity.GenericValue getProject(org.ofbiz.core.entity.GenericValue issue)
                                              throws DataAccessException
Deprecated. Use Issue.getProjectObject() instead. Deprecated since v4.0.

Returns a project GenericValue that an issue is in.

Parameters:
issue - the issue.
Returns:
GenericValue representation of a Project.
Throws:
DataAccessException - If any errors occur accessing the DB.

getProject

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

Retrieve a single project by it's id.

Parameters:
id - the Project ID.
Returns:
GenericValue representation of a Project.
Throws:
DataAccessException - If any errors occur accessing the DB.

getProjectObj

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

Parameters:
id - ID of the Project.
Returns:
Project object or null if project with that id doesn't exist.
Throws:
DataAccessException - If any errors occur accessing the DB.

getProjectByName

@Deprecated
org.ofbiz.core.entity.GenericValue getProjectByName(java.lang.String name)
                                                    throws DataAccessException
Deprecated. Please use getProjectObjByName(java.lang.String) instead. Deprecated since v4.0.

Retrieve a single project by it's project name.

Parameters:
name - project name
Returns:
GenericValue representation of a Project.
Throws:
DataAccessException - If any errors occur accessing the DB.

getProjectObjByName

Project getProjectObjByName(java.lang.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

getProjectByKey

@Deprecated
org.ofbiz.core.entity.GenericValue getProjectByKey(java.lang.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.

Parameters:
key - the project key
Returns:
GenericValue representation of a Project.
Throws:
DataAccessException - If any errors occur accessing the DB.

getProjectObjByKey

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

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

getProjectObjByKeyIgnoreCase

Project getProjectObjByKeyIgnoreCase(java.lang.String projectKey)
Returns a Project object based ont he passed in project key, not taking into account the case of the project key.

Parameters:
projectKey - the project key, case does not matter.
Returns:
the project object specified by the key or null if not such project exists.

getComponent

@Deprecated
org.ofbiz.core.entity.GenericValue getComponent(java.lang.Long id)
                                                throws DataAccessException
Deprecated. Use ProjectComponentManager instead. Deprecated in v4.0.

Get a component from within this project, by it's id.

Parameters:
id - id
Returns:
A component GenericValue.
Throws:
DataAccessException - If any errors occur accessing the DB.
See Also:
ProjectComponentManager.find(Long)

getComponent

@Deprecated
org.ofbiz.core.entity.GenericValue getComponent(org.ofbiz.core.entity.GenericValue project,
                                                           java.lang.String name)
                                                throws DataAccessException
Deprecated. Use ProjectComponentManager instead. Deprecated in v4.0.

Get a component from within this project, based on the project and the component name. NOTE: This is not cached currently.

Parameters:
project - project
name - name
Returns:
A component GenericValue.
Throws:
DataAccessException - If any errors occur accessing the DB.
See Also:
ProjectComponentManager.findByComponentName(java.lang.Long, java.lang.String)

getComponents

@Deprecated
java.util.Collection<org.ofbiz.core.entity.GenericValue> getComponents(org.ofbiz.core.entity.GenericValue project)
                                                                       throws DataAccessException
Deprecated. Use ProjectComponentManager instead. Deprecated in v4.0.

Returns a collection of components in a project.

Parameters:
project - project
Returns:
A collection of GenericValues.
Throws:
DataAccessException - If any errors occur accessing the DB.
See Also:
ProjectComponentManager.findAllForProject(java.lang.Long)

getComponents

@Deprecated
java.util.Collection<org.ofbiz.core.entity.GenericValue> getComponents(java.util.List<java.lang.Long> ids)
                                                                       throws DataAccessException
Deprecated. Use ProjectComponentManager.getComponents(java.util.List) instead. Deprecated since v4.0.

Get a list of components from their IDs

Parameters:
ids - Component IDs
Returns:
A collection of component GenericValues
Throws:
DataAccessException - If any errors occur accessing the DB.

getProjects

java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjects()
                                                                     throws DataAccessException
Deprecated. Use getProjectObjects() instead. Deprecated in v4.0.

Return all project GenericValues.

Returns:
all projects as Collection
Throws:
DataAccessException - If any errors occur accessing the DB.

getProjectObjects

java.util.List<Project> getProjectObjects()
                                          throws DataAccessException
Return all Projects ordered by name.

Returns:
all projects ordered by name.
Throws:
DataAccessException - If any errors occur accessing the DB.

getNextId

long getNextId(org.ofbiz.core.entity.GenericValue project)
               throws DataAccessException
Deprecated. Use getNextId(Project) instead. Deprecated since v4.0.

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 - project GenericValue
Returns:
A long value representing a new issue id for the project.
Throws:
DataAccessException - If any errors occur accessing the DB.

getNextId

long getNextId(Project 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 - The Project
Returns:
A long value representing a new issue id for the project.
Throws:
DataAccessException - If any errors occur accessing the DB.

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 - project GenericValue
Throws:
DataAccessException - If any errors occur accessing the DB. TODO: deprecate this method.

refresh

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


getProjectCategories

java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjectCategories()
                                                                              throws DataAccessException
Get all ProjectCategories.

Returns:
A collection of category GenericValues
Throws:
DataAccessException - If any errors occur accessing the DB. TODO: deprecate this method.

getProjectCategory

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

Parameters:
id - Project Category ID.
Returns:
A category GenericValue
Throws:
DataAccessException - If any errors occur accessing the DB. TODO: deprecate this method.

getProjectCategoryByName

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

Parameters:
projectCategoryName - Name of the Project Category
Returns:
A category GenericValue
Throws:
DataAccessException - If any errors occur accessing the DB. TODO: deprecate this method.

getProjectCategoryByNameIgnoreCase

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

Parameters:
projectCategoryName - Name of the Project Category
Returns:
A category GenericValue
Throws:
DataAccessException - If any errors occur accessing the DB. TODO: deprecate this method.

updateProjectCategory

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

Parameters:
projectCat - project category.
Throws:
DataAccessException - If any errors occur accessing the DB. TODO: deprecate this method.

getProjectsFromProjectCategory

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

Parameters:
projectCategory - project category.
Returns:
A collection of project GenericValues sorted by name.
Throws:
DataAccessException - If any errors occur accessing the DB. TODO: deprecate this method.

getProjectObjectsFromProjectCategory

java.util.Collection<Project> getProjectObjectsFromProjectCategory(java.lang.Long projectCategoryId)
                                                                   throws DataAccessException
Returns a list of projects in a particular category.

Parameters:
projectCategoryId - project category id.
Returns:
A collection of project Projects sorted by name.
Throws:
DataAccessException - If any errors occur accessing the DB.
Since:
v4.0

getProjectsWithNoCategory

java.util.Collection<org.ofbiz.core.entity.GenericValue> 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 - If any errors occur accessing the DB. TODO: deprecate this method.

getProjectObjectsWithNoCategory

java.util.Collection<Project> getProjectObjectsWithNoCategory()
                                                              throws DataAccessException
Returns a list of projects without project category, sorted by project name

Returns:
A collection of Projects sorted by name
Throws:
DataAccessException - If any errors occur accessing the DB.
Since:
v4.0

getProjectCategoryFromProject

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

Parameters:
project - project
Returns:
A category GenericValue or null if no category exists.
Throws:
DataAccessException - If any errors occur accessing the DB. TODO: deprecate this method.

setProjectCategory

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

Parameters:
project - project
category - category
Throws:
DataAccessException - If any errors occur accessing the DB.
java.lang.IllegalArgumentException - if the project provided is null TODO: deprecate this method.

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 - project
component - 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 TODO: deprecate this method.

getDefaultAssignee

com.opensymphony.user.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 - project
component - component
Returns:
A User
Throws:
DefaultAssigneeException - If the default assignee does NOT have ASSIGNABLE permission OR Unassigned issues are turned off. TODO: deprecate this method.

isDefaultAssignee

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

Parameters:
project - 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. TODO: deprecate this method.

getProjectsByLead

java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjectsByLead(com.opensymphony.user.User leadUser)
Returns all the projects that leadUser is the project lead for.

Parameters:
leadUser - Project Lead
Returns:
A collection of project GenericValues TODO: deprecate this method.

convertToProjects

java.util.List<org.ofbiz.core.entity.GenericValue> convertToProjects(java.util.Collection<java.lang.Long> 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 TODO: deprecate this method.


Copyright © 2002-2011 Atlassian. All Rights Reserved.