com.atlassian.jira.project
Class AbstractProjectManager

java.lang.Object
  extended by com.atlassian.jira.project.AbstractProjectManager
All Implemented Interfaces:
ProjectManager
Direct Known Subclasses:
CachingProjectManager, DefaultProjectManager

public abstract class AbstractProjectManager
extends Object
implements ProjectManager


Constructor Summary
AbstractProjectManager()
           
 
Method Summary
 List<org.ofbiz.core.entity.GenericValue> convertToProjects(Collection<Long> projectIds)
          Converts a collection of projectIds to a collection of projects.
 Project createProject(String name, String key, String description, String lead, String url, Long assigneeType)
          Creates the project in the database, and adds default project roles for this project.
 Collection<org.ofbiz.core.entity.GenericValue> getComponents(List<Long> ids)
          Get a list of components from their IDs
 User getDefaultAssignee(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue component)
          This function returns the default assignee if the system has been setup incorrectly then it will throw an error The isDefaultAssignee(GenericValue, GenericValue) checks if there is a valid default assignee
 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)
          Returns a project GenericValue that an issue is in.
 org.ofbiz.core.entity.GenericValue getProjectCategoryByName(String projectCategoryName)
          Find a project category by name.
 org.ofbiz.core.entity.GenericValue getProjectCategoryByNameIgnoreCase(String projectCategoryName)
          Find a project category by name ignoring the case of the category 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
 Project updateProject(Project updatedProject, String name, String description, String lead, String url, Long assigneeType)
          Updates the project provided with the new attributes passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.project.ProjectManager
createProject, getComponent, getComponent, getComponents, getNextId, getProject, getProjectByKey, getProjectByName, getProjectCategories, getProjectCategory, getProjectCategoryFromProject, getProjectObj, getProjectObjByKey, getProjectObjByKeyIgnoreCase, getProjectObjByName, getProjectObjects, getProjectObjectsFromProjectCategory, getProjectObjectsWithNoCategory, getProjects, getProjectsByLead, getProjectsFromProjectCategory, getProjectsWithNoCategory, refresh, refreshProjectDependencies, removeProject, removeProjectIssues, setProjectCategory, updateProject, updateProject, updateProjectCategory
 

Constructor Detail

AbstractProjectManager

public AbstractProjectManager()
Method Detail

getProject

public org.ofbiz.core.entity.GenericValue getProject(org.ofbiz.core.entity.GenericValue issue)
Description copied from interface: ProjectManager
Returns a project GenericValue that an issue is in.

Specified by:
getProject in interface ProjectManager
Parameters:
issue - the issue.
Returns:
GenericValue representation of a Project.

getNextId

public long getNextId(Project project)
Description copied from interface: ProjectManager
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.

Specified by:
getNextId in interface ProjectManager
Parameters:
project - The Project
Returns:
A long value representing a new issue id for the project.

getComponents

public Collection<org.ofbiz.core.entity.GenericValue> getComponents(List<Long> ids)
Description copied from interface: ProjectManager
Get a list of components from their IDs

Specified by:
getComponents in interface ProjectManager
Parameters:
ids - Component IDs
Returns:
A collection of component GenericValues

getProjectCategoryByName

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

Specified by:
getProjectCategoryByName in interface ProjectManager
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

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

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

isDefaultAssignee

public 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

Specified by:
isDefaultAssignee in interface ProjectManager
Parameters:
project -
component -
Returns:
true if either the component is not null and has an assignee type != project default, or if ProjectManager.isDefaultAssignee(org.ofbiz.core.entity.GenericValue) is true TODO: deprecate this method.

isDefaultAssignee

public boolean isDefaultAssignee(org.ofbiz.core.entity.GenericValue project)
Description copied from interface: ProjectManager
Checks if there is a valid default assignee for a given project.

Specified by:
isDefaultAssignee in interface ProjectManager
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 projectleas is not assignable. Otherwise there is a default assigneed.

convertToProjects

public List<org.ofbiz.core.entity.GenericValue> convertToProjects(Collection<Long> projectIds)
Description copied from interface: ProjectManager
Converts a collection of projectIds to a collection of projects. Will return null if is null or blank

Specified by:
convertToProjects in interface ProjectManager
Parameters:
projectIds - a Collection of Longs
Returns:
List of Project GenericValues. Null if input is empty TODO: deprecate this method.

getDefaultAssignee

public User getDefaultAssignee(org.ofbiz.core.entity.GenericValue project,
                               org.ofbiz.core.entity.GenericValue component)
This function returns the default assignee if the system has been setup incorrectly then it will throw an error The isDefaultAssignee(GenericValue, GenericValue) checks if there is a valid default assignee

Specified by:
getDefaultAssignee in interface ProjectManager
Parameters:
project -
component -
Returns:
A User

createProject

public Project createProject(String name,
                             String key,
                             String description,
                             String lead,
                             String url,
                             Long assigneeType)
Description copied from interface: ProjectManager
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.

Specified by:
createProject in interface ProjectManager
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.

updateProject

public Project updateProject(Project updatedProject,
                             String name,
                             String description,
                             String lead,
                             String url,
                             Long assigneeType)
Description copied from interface: ProjectManager
Updates the project provided with the new attributes passed in. This method is responsible for persisting any changes to the database.

Specified by:
updateProject in interface ProjectManager
Parameters:
updatedProject - 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


Copyright © 2002-2010 Atlassian. All Rights Reserved.