public abstract class AbstractProjectManager extends Object implements ProjectManager
Constructor and Description |
---|
AbstractProjectManager(UserManager userManager,
ApplicationProperties applicationProperties) |
Modifier and Type | Method and Description |
---|---|
List<Project> |
convertToProjectObjects(Collection<Long> projectIds)
Converts a collection of projectIds to a list of projects.
|
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.
|
com.atlassian.crowd.embedded.api.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 |
com.atlassian.crowd.embedded.api.User |
getDefaultAssignee(Project project,
Collection<ProjectComponent> components)
Gets the default assignee for an issue given its project and list of Components.
|
com.atlassian.crowd.embedded.api.User |
getDefaultAssignee(Project project,
ProjectComponent component)
Gets the default assignee for a project and/or component depending on if a component was specified.
|
org.ofbiz.core.entity.GenericValue |
getProject(org.ofbiz.core.entity.GenericValue issue)
Returns a project
GenericValue that an issue is in. |
Project |
getProjectByCurrentKey(String projectKey)
Returns the
Project with the given project key. |
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.
|
ProjectCategory |
getProjectCategoryObjectByName(String projectCategoryName)
Find a project category by name.
|
ProjectCategory |
getProjectCategoryObjectByNameIgnoreCase(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.
|
Project |
updateProject(Project updatedProject,
String name,
String description,
String lead,
String url,
Long assigneeType,
Long avatarId)
Updates the project provided with the new attributes passed in.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createProject, createProjectCategory, getAllProjectCategories, getAllProjectKeys, getComponent, getComponent, getComponents, getCurrentCounterForProject, getNextId, getProject, getProjectByCurrentKeyIgnoreCase, getProjectByKey, getProjectByName, getProjectCategories, getProjectCategory, getProjectCategoryForProject, getProjectCategoryFromProject, getProjectCategoryObject, getProjectCount, getProjectObj, getProjectObjByKey, getProjectObjByKeyIgnoreCase, getProjectObjByName, getProjectObjects, getProjectObjectsFromProjectCategory, getProjectObjectsWithNoCategory, getProjects, getProjectsByLead, getProjectsFromProjectCategory, getProjectsFromProjectCategory, getProjectsLeadBy, getProjectsLeadBy, getProjectsWithNoCategory, refresh, removeProject, removeProjectCategory, removeProjectIssues, setCurrentCounterForProject, setProjectCategory, setProjectCategory, updateProject, updateProjectCategory, updateProjectCategory
public AbstractProjectManager(UserManager userManager, ApplicationProperties applicationProperties)
public org.ofbiz.core.entity.GenericValue getProject(org.ofbiz.core.entity.GenericValue issue)
ProjectManager
GenericValue
that an issue is in.getProject
in interface ProjectManager
issue
- the issue.public Project getProjectByCurrentKey(String projectKey)
ProjectManager
Project
with the given project key.
This method will strictly only return the project whose current project key is the one given.
This method is added to the API in anticipation of being able to edit the project key, but this feature has not actually been added in 6.0.
getProjectByCurrentKey
in interface ProjectManager
projectKey
- the Project key.Project
with the given project key.ProjectManager.getProjectObjByKey(String)
public org.ofbiz.core.entity.GenericValue getProjectCategoryByName(String projectCategoryName) throws DataAccessException
ProjectManager
getProjectCategoryByName
in interface ProjectManager
projectCategoryName
- Name of the Project CategoryGenericValue
DataAccessException
- If any errors occur accessing the DB.public ProjectCategory getProjectCategoryObjectByName(String projectCategoryName) throws DataAccessException
ProjectManager
getProjectCategoryObjectByName
in interface ProjectManager
projectCategoryName
- Name of the Project CategoryDataAccessException
public ProjectCategory getProjectCategoryObjectByNameIgnoreCase(String projectCategoryName) throws DataAccessException
ProjectManager
getProjectCategoryObjectByNameIgnoreCase
in interface ProjectManager
projectCategoryName
- Name of the Project CategoryDataAccessException
public org.ofbiz.core.entity.GenericValue getProjectCategoryByNameIgnoreCase(String projectCategoryName) throws DataAccessException
ProjectManager
getProjectCategoryByNameIgnoreCase
in interface ProjectManager
projectCategoryName
- Name of the Project CategoryGenericValue
DataAccessException
- If any errors occur accessing the DB.public boolean isDefaultAssignee(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue component)
getDefaultAssignee(GenericValue, GenericValue)
will throw an exceptionisDefaultAssignee
in interface ProjectManager
project
- component
- ProjectManager.isDefaultAssignee(org.ofbiz.core.entity.GenericValue)
is truepublic boolean isDefaultAssignee(org.ofbiz.core.entity.GenericValue project)
ProjectManager
isDefaultAssignee
in interface ProjectManager
project
- public List<org.ofbiz.core.entity.GenericValue> convertToProjects(Collection<Long> projectIds)
ProjectManager
convertToProjects
in interface ProjectManager
projectIds
- a Collection of LongsGenericValue
s. Null if input is emptypublic List<Project> convertToProjectObjects(Collection<Long> projectIds)
ProjectManager
Will return null if incoming collection is null.
The returned list of Project Objects will have the same sort order as the incoming collection of IDs.
convertToProjectObjects
in interface ProjectManager
projectIds
- a Collection of Project IDspublic com.atlassian.crowd.embedded.api.User getDefaultAssignee(Project project, ProjectComponent component)
ProjectManager
getDefaultAssignee
in interface ProjectManager
project
- projectcomponent
- componentpublic com.atlassian.crowd.embedded.api.User getDefaultAssignee(Project project, Collection<ProjectComponent> components) throws DefaultAssigneeException
ProjectManager
If the default assignee configuration is invalid, then a DefaultAssigneeException is thrown. This could be because the default is unassigned, and unassigned issues are not allowed, or because the default user does not have permission to be assigned to issues in this project.
getDefaultAssignee
in interface ProjectManager
project
- projectcomponents
- The componentsDefaultAssigneeException
- If the default assignee is invalid (eg user does not have assign permission) .public com.atlassian.crowd.embedded.api.User getDefaultAssignee(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue component)
isDefaultAssignee(GenericValue, GenericValue)
checks if there is a valid default assigneegetDefaultAssignee
in interface ProjectManager
project
- component
- User
public Project createProject(String name, String key, String description, String lead, String url, Long assigneeType)
ProjectManager
createProject
in interface ProjectManager
name
- The name of the new projectkey
- The project key of the new projectdescription
- An optional description for the projectlead
- The lead developer for the projecturl
- An optional URL for the new projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.public Project updateProject(Project updatedProject, String name, String description, String lead, String url, Long assigneeType)
ProjectManager
updateProject
in interface ProjectManager
updatedProject
- The project to be updated.name
- The name for the updated projectdescription
- An optional description for the projectlead
- The userkey of the lead developer for the projecturl
- An optional URL for the updated projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.public Project updateProject(Project updatedProject, String name, String description, String lead, String url, Long assigneeType, Long avatarId)
ProjectManager
updateProject
in interface ProjectManager
updatedProject
- The project to be updated.name
- The name for the updated projectdescription
- An optional description for the projectlead
- The userkey of the lead developer for the projecturl
- An optional URL for the updated projectassigneeType
- 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.Copyright © 2002-2015 Atlassian. All Rights Reserved.