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 convertToProjects(Collection projectIds)
          Converts a collection of projectIds to a collection of projects.
abstract  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.
abstract  org.ofbiz.core.entity.GenericValue getComponent(Long id)
          Get a component from within this project, by it's id.
abstract  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)
          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
 org.ofbiz.core.entity.GenericValue getProject(org.ofbiz.core.entity.GenericValue issue)
          Returns a project GenericValue that an issue is in.
abstract  org.ofbiz.core.entity.GenericValue getProject(Long id)
          Retrieve a single project by it's id.
abstract  org.ofbiz.core.entity.GenericValue getProjectByKey(String key)
          Retrieve a single project by it's project key.
abstract  org.ofbiz.core.entity.GenericValue getProjectByName(String name)
          Retrieve a single project by it's project name.
abstract  Collection getProjectCategories()
          Get all ProjectCategories.
abstract  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.
abstract  org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
          Returns a project's category.
abstract  Project getProjectObj(Long id)
          Retrieves a single Project by its id.
abstract  Project getProjectObjByKey(String key)
          Returns a Project object based on the passed in project key.
abstract  Collection getProjects()
          Return all project GenericValues.
abstract  Collection getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
          Returns a list of projects in a particular category.
abstract  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
abstract  void setProjectCategory(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue category)
          Sets a projects category.
abstract  void updateProject(org.ofbiz.core.entity.GenericValue updatedProject)
          Persists a project GenericValue to the database.
abstract  void updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
          Persist an updated project category.
 
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
getNextId, getProjectObjByName, getProjectsByLead, refresh, refreshProjectDependencies
 

Constructor Detail

AbstractProjectManager

public AbstractProjectManager()
Method Detail

updateProject

public abstract void updateProject(org.ofbiz.core.entity.GenericValue updatedProject)
Description copied from interface: ProjectManager
Persists a project GenericValue to the database.

Specified by:
updateProject in interface ProjectManager

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
Returns:

getProject

public abstract org.ofbiz.core.entity.GenericValue getProject(Long id)
Description copied from interface: ProjectManager
Retrieve a single project by it's id.

Specified by:
getProject in interface ProjectManager

getProjectObj

public abstract Project getProjectObj(Long id)
Description copied from interface: ProjectManager
Retrieves a single Project by its id.

Specified by:
getProjectObj in interface ProjectManager
Returns:
project object or null if project with that id doesn't exist

getProjectByName

public abstract org.ofbiz.core.entity.GenericValue getProjectByName(String name)
Description copied from interface: ProjectManager
Retrieve a single project by it's project name.

Specified by:
getProjectByName in interface ProjectManager

getProjectByKey

public abstract org.ofbiz.core.entity.GenericValue getProjectByKey(String key)
Description copied from interface: ProjectManager
Retrieve a single project by it's project key.

Specified by:
getProjectByKey in interface ProjectManager

getProjectObjByKey

public abstract Project getProjectObjByKey(String key)
Description copied from interface: ProjectManager
Returns a Project object based on the passed in project key.

Specified by:
getProjectObjByKey in interface ProjectManager
Returns:
the Project object specified by the key or null

getComponent

public abstract org.ofbiz.core.entity.GenericValue getComponent(Long id)
Description copied from interface: ProjectManager
Get a component from within this project, by it's id.

Specified by:
getComponent in interface ProjectManager
Returns:
A component GenericValue.

getComponent

public abstract org.ofbiz.core.entity.GenericValue getComponent(org.ofbiz.core.entity.GenericValue project,
                                                                String name)
Description copied from interface: ProjectManager
Get a component from within this project, based on the project and the component name. NOTE: This is not cached currently.

Specified by:
getComponent in interface ProjectManager
Returns:
A component GenericValue.

getComponents

public abstract Collection getComponents(org.ofbiz.core.entity.GenericValue project)
Description copied from interface: ProjectManager
Returns a collection of components in a project.

Specified by:
getComponents in interface ProjectManager
Returns:
A collection of GenericValues.

getComponents

public Collection getComponents(List ids)
Description copied from interface: ProjectManager
Get a list of components from their IDs

Specified by:
getComponents in interface ProjectManager
Returns:
A collection of component GenericValues

getProjects

public abstract Collection getProjects()
Description copied from interface: ProjectManager
Return all project GenericValues. TODO: Create a getProjectObjects() and deprecate this method.

Specified by:
getProjects in interface ProjectManager

getProjectCategories

public abstract Collection getProjectCategories()
Description copied from interface: ProjectManager
Get all ProjectCategories.

Specified by:
getProjectCategories in interface ProjectManager
Returns:
A collection of category GenericValues

getProjectCategory

public abstract org.ofbiz.core.entity.GenericValue getProjectCategory(Long id)
Description copied from interface: ProjectManager
Returns a single project category by id.

Specified by:
getProjectCategory in interface ProjectManager
Returns:
A category GenericValue

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
Returns:
A category GenericValue
Throws:
DataAccessException

updateProjectCategory

public abstract void updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
Description copied from interface: ProjectManager
Persist an updated project category.

Specified by:
updateProjectCategory in interface ProjectManager

getProjectsFromProjectCategory

public abstract Collection getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
Description copied from interface: ProjectManager
Returns a list of projects in a particular category.

Specified by:
getProjectsFromProjectCategory in interface ProjectManager
Returns:
A collection of project GenericValues sorted by name. Returns null if the projectCategory param is null

getProjectsWithNoCategory

public abstract Collection getProjectsWithNoCategory()
Description copied from interface: ProjectManager
Returns a list of projects without project category, sorted by project name

Specified by:
getProjectsWithNoCategory in interface ProjectManager
Returns:
A collection of project GenericValues sorted by name

getProjectCategoryFromProject

public abstract org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
Description copied from interface: ProjectManager
Returns a project's category.

Specified by:
getProjectCategoryFromProject in interface ProjectManager
Returns:
A category GenericValue or null if no category exists.

setProjectCategory

public abstract void setProjectCategory(org.ofbiz.core.entity.GenericValue project,
                                        org.ofbiz.core.entity.GenericValue category)
Description copied from interface: ProjectManager
Sets a projects category.

Specified by:
setProjectCategory in interface ProjectManager

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

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 convertToProjects(Collection 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

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


Copyright © 2002-2009 Atlassian. All Rights Reserved.