public class DefaultProjectManager extends AbstractProjectManager
Modifier and Type | Field and Description |
---|---|
static String |
APPLINKS_LOCAL_PROPERTY_PREFIX |
Constructor and Description |
---|
DefaultProjectManager(OfBizDelegator delegator,
NodeAssociationStore nodeAssociationStore,
ProjectFactory projectFactory,
ProjectRoleManager projectRoleManager,
IssueManager issueManager,
AvatarManager avatarManager,
UserManager userManager,
ProjectCategoryStore projectCategoryStore,
ApplicationProperties applicationProperties,
ProjectKeyStore projectKeyStore,
TransactionSupport transactionSupport,
PropertiesManager propertiesManager,
JsonEntityPropertyManager jsonEntityPropertyManager,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
Project |
createProject(String name,
String key,
String description,
String leadKey,
String url,
Long assigneeType,
Long avatarId)
Creates the project in the database, and adds default project roles for this project.
|
ProjectCategory |
createProjectCategory(String name,
String description)
Creates a new ProjectCategory with the given name and description.
|
List<ProjectCategory> |
getAllProjectCategories()
Returns all ProjectCategories, ordered by name.
|
Set<String> |
getAllProjectKeys(Long projectId)
Returns all project keys that are associated with
Project . |
org.ofbiz.core.entity.GenericValue |
getComponent(org.ofbiz.core.entity.GenericValue project,
String name)
Deprecated.
use ProjectComponentManager instead
|
org.ofbiz.core.entity.GenericValue |
getComponent(Long id)
Deprecated.
use ProjectComponentManager instead
|
Collection<org.ofbiz.core.entity.GenericValue> |
getComponents(org.ofbiz.core.entity.GenericValue project)
Deprecated.
use ProjectComponentManager instead
|
long |
getCurrentCounterForProject(Long id)
Returns the curremt issue counter for the given project.
|
protected OfBizDelegator |
getDelegator() |
long |
getNextId(Project project)
Get the next issue ID from this project (transactional).
|
org.ofbiz.core.entity.GenericValue |
getProject(Long id)
Retrieve a single project by it's id.
|
Project |
getProjectByCurrentKey(String projectKey)
Returns the
Project with the given project key. |
Project |
getProjectByCurrentKeyIgnoreCase(String projectKey)
Returns a
Project object based on the passed in project key, not taking into account the case
of the project key. |
org.ofbiz.core.entity.GenericValue |
getProjectByKey(String key)
Retrieve a single project by it's project key.
|
org.ofbiz.core.entity.GenericValue |
getProjectByName(String name)
Retrieve a single project by it's project name.
|
Collection<org.ofbiz.core.entity.GenericValue> |
getProjectCategories()
Get all ProjectCategories.
|
org.ofbiz.core.entity.GenericValue |
getProjectCategory(Long id)
Returns a single project category by id.
|
ProjectCategory |
getProjectCategoryForProject(Project project)
Returns a project's category.
|
org.ofbiz.core.entity.GenericValue |
getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
Get the Project Category given a Project.
|
ProjectCategory |
getProjectCategoryObject(Long id)
Returns a single project category by id.
|
long |
getProjectCount()
Return the total number of
Project s. |
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 |
getProjectObjByKeyIgnoreCase(String projectKey)
Returns a
Project object based on the passed in project key, not taking into account the case
of the project key. |
Project |
getProjectObjByName(String projectName)
Returns a
Project object based on the passed in project name. |
List<Project> |
getProjectObjects()
Return all
Project s ordered by name. |
Collection<Project> |
getProjectObjectsFromProjectCategory(Long projectCategoryId)
Returns a list of projects in a particular category.
|
Collection<Project> |
getProjectObjectsWithNoCategory()
Returns a list of projects without project category, sorted by project name
|
Collection<org.ofbiz.core.entity.GenericValue> |
getProjects()
Return all project
GenericValue s. |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjectsByLead(com.atlassian.crowd.embedded.api.User leadUser)
Returns all the projects that leadUser is the project lead for.
|
Collection<org.ofbiz.core.entity.GenericValue> |
getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
Gather a list of projects that are in a project category.
|
Collection<Project> |
getProjectsFromProjectCategory(ProjectCategory projectCategory)
Returns a list of projects in a particular category.
|
List<Project> |
getProjectsLeadBy(ApplicationUser leadUser)
Returns all the projects that leadUser is the project lead for ordered by the name of the Project.
|
List<Project> |
getProjectsLeadBy(com.atlassian.crowd.embedded.api.User leadUser)
Returns all the projects that leadUser is the project lead for ordered by the name of the Project.
|
Collection<org.ofbiz.core.entity.GenericValue> |
getProjectsWithNoCategory()
Gets a list of projects that are not associated with any project category
|
void |
refresh()
Causes a full refresh of the project cache.
|
void |
removeProject(Project project)
Deletes the provided project from the database.
|
void |
removeProjectCategory(Long id)
Removes the given ProjectCategory.
|
void |
removeProjectIssues(Project project)
Removes all issues for a particular project.
|
void |
setCurrentCounterForProject(Project project,
long counter)
Set the project counter.
|
void |
setProjectCategory(org.ofbiz.core.entity.GenericValue projectGV,
org.ofbiz.core.entity.GenericValue projectCategoryGV)
If
category is non-null, set project 's Project Category to category . |
void |
setProjectCategory(Project project,
ProjectCategory projectCategory)
Sets a project's category.
|
void |
shutdown(ComponentManagerShutdownEvent shutdownEvent) |
Project |
updateProject(Project updatedProject,
String name,
String description,
String leadKey,
String url,
Long assigneeType,
Long avatarId,
String projectKey)
Updates the project provided with the new attributes passed in.
|
void |
updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
Persist an updated project category.
|
void |
updateProjectCategory(ProjectCategory projectCategory)
Persist an updated project category.
|
convertToProjectObjects, convertToProjects, createProject, getDefaultAssignee, getDefaultAssignee, getDefaultAssignee, getProject, getProjectCategoryByName, getProjectCategoryByNameIgnoreCase, getProjectCategoryObjectByName, getProjectCategoryObjectByNameIgnoreCase, isDefaultAssignee, isDefaultAssignee, updateProject, updateProject
public static final String APPLINKS_LOCAL_PROPERTY_PREFIX
public DefaultProjectManager(OfBizDelegator delegator, NodeAssociationStore nodeAssociationStore, ProjectFactory projectFactory, ProjectRoleManager projectRoleManager, IssueManager issueManager, AvatarManager avatarManager, UserManager userManager, ProjectCategoryStore projectCategoryStore, ApplicationProperties applicationProperties, ProjectKeyStore projectKeyStore, TransactionSupport transactionSupport, PropertiesManager propertiesManager, JsonEntityPropertyManager jsonEntityPropertyManager, com.atlassian.event.api.EventPublisher eventPublisher)
public Project createProject(String name, String key, String description, String leadKey, String url, Long assigneeType, Long avatarId)
ProjectManager
WARNING: In 6.0, the documentation for this method incorrectly stated that this method would
interpret the lead
as a username, when it was in fact interpreted as a userkey. The method signatures
and documentation have been updated to describe the actual behaviour.
name
- The name of the new projectkey
- The project key of the new projectdescription
- An optional description for the projectleadKey
- The userkey of 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.avatarId
- the id of an existing system avatar.public long getNextId(Project project)
ProjectManager
project
- The Projectpublic Project updateProject(Project updatedProject, String name, String description, String leadKey, String url, Long assigneeType, Long avatarId, String projectKey)
ProjectManager
updatedProject
- The project to be updated.name
- The name for the updated projectdescription
- An optional description for the projectleadKey
- 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.projectKey
- The new project key (not updated if null)public void removeProjectIssues(Project project) throws RemoveException
ProjectManager
project
- The project for which issues will be deleted.RemoveException
- if there's any errors removing issuespublic void removeProject(Project project)
ProjectManager
ProjectService.deleteProject(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.bc.project.ProjectService.DeleteProjectValidationResult)
to
properly delete a project.project
- The project to be deleted.public org.ofbiz.core.entity.GenericValue getProject(Long id)
ProjectManager
id
- the Project ID.public Project getProjectObj(Long id)
ProjectManager
Project
by its id.id
- ID of the Project.public org.ofbiz.core.entity.GenericValue getProjectByName(String name)
ProjectManager
name
- project namepublic org.ofbiz.core.entity.GenericValue getProjectByKey(String key)
ProjectManager
key
- the project keypublic 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
getProjectByCurrentKey
in class AbstractProjectManager
projectKey
- the Project key.Project
with the given project key.ProjectManager.getProjectObjByKey(String)
public Project getProjectObjByKey(String projectKey)
ProjectManager
Project
object based on the passed in project key.projectKey
- the Project key.Project
object specified by the key or nullpublic Project getProjectByCurrentKeyIgnoreCase(String projectKey)
ProjectManager
Project
object based on the passed in project key, not taking into account the case
of the project key.projectKey
- the project key, case does not matter.public Project getProjectObjByKeyIgnoreCase(String projectKey)
ProjectManager
Project
object based on the passed in project key, not taking into account the case
of the project key. Matches also by previous keys that were associated with a project.projectKey
- the project key, case does not matter.public Set<String> getAllProjectKeys(Long projectId)
ProjectManager
Project
.public Project getProjectObjByName(String projectName)
ProjectManager
Project
object based on the passed in project name.projectName
- the name of the projectProject
object specified by the supplied name or null@Deprecated public org.ofbiz.core.entity.GenericValue getComponent(Long id)
ProjectManager
id
- idGenericValue
.ProjectComponentManager.find(Long)
@Deprecated public org.ofbiz.core.entity.GenericValue getComponent(org.ofbiz.core.entity.GenericValue project, String name)
ProjectManager
project
- projectname
- nameGenericValue
.ProjectComponentManager.findByComponentName(java.lang.Long, java.lang.String)
@Deprecated public Collection<org.ofbiz.core.entity.GenericValue> getComponents(org.ofbiz.core.entity.GenericValue project)
ProjectManager
project
- projectGenericValue
s.ProjectComponentManager.findAllForProject(java.lang.Long)
public Collection<org.ofbiz.core.entity.GenericValue> getProjects()
GenericValue
s.public List<Project> getProjectObjects() throws DataAccessException
ProjectManager
Project
s ordered by name.DataAccessException
- If any errors occur accessing the DB.public long getProjectCount() throws DataAccessException
ProjectManager
Project
s.DataAccessException
- if any errors occur accessing the DB.protected OfBizDelegator getDelegator()
public Collection<org.ofbiz.core.entity.GenericValue> getProjectCategories()
ProjectManager
GenericValue
spublic List<ProjectCategory> getAllProjectCategories()
ProjectManager
public org.ofbiz.core.entity.GenericValue getProjectCategory(Long id)
ProjectManager
id
- Project Category ID.GenericValue
public ProjectCategory getProjectCategoryObject(Long id)
ProjectManager
id
- Project Category ID.public void updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
ProjectManager
projectCat
- project category.public void updateProjectCategory(@Nonnull ProjectCategory projectCategory) throws DataAccessException
ProjectManager
projectCategory
- project category.DataAccessException
- If any errors occur accessing the DB.public Collection<org.ofbiz.core.entity.GenericValue> getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
projectCategory
- Project to look up againstpublic Collection<Project> getProjectsFromProjectCategory(ProjectCategory projectCategory) throws DataAccessException
ProjectManager
projectCategory
- project category.DataAccessException
- If any errors occur accessing the DB.public Collection<Project> getProjectObjectsFromProjectCategory(Long projectCategoryId)
ProjectManager
projectCategoryId
- project category id.Project
s sorted by name.public Collection<org.ofbiz.core.entity.GenericValue> getProjectsWithNoCategory()
GenericValue
s sorted by namepublic Collection<Project> getProjectObjectsWithNoCategory() throws DataAccessException
ProjectManager
Project
s sorted by nameDataAccessException
- If any errors occur accessing the DB.public org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
project
- Projectpublic ProjectCategory getProjectCategoryForProject(Project project) throws DataAccessException
ProjectManager
project
- projectDataAccessException
- If any errors occur accessing the DB.public ProjectCategory createProjectCategory(String name, String description)
ProjectManager
name
- the Namedescription
- the Description.public void removeProjectCategory(Long id)
ProjectManager
id
- the ProjectCategory to remove.public void setProjectCategory(org.ofbiz.core.entity.GenericValue projectGV, org.ofbiz.core.entity.GenericValue projectCategoryGV)
category
is non-null, set project
's Project Category to category
. If
category
is null, remove project
's Project Category association, if one exists.projectGV
- projectprojectCategoryGV
- categorypublic void setProjectCategory(Project project, ProjectCategory projectCategory)
ProjectManager
project
- projectprojectCategory
- categorypublic List<Project> getProjectsLeadBy(com.atlassian.crowd.embedded.api.User leadUser)
ProjectManager
leadUser
- Project Leadpublic List<Project> getProjectsLeadBy(ApplicationUser leadUser)
ProjectManager
leadUser
- Project Leadpublic final Collection<org.ofbiz.core.entity.GenericValue> getProjectsByLead(com.atlassian.crowd.embedded.api.User leadUser)
ProjectManager
leadUser
- Project LeadGenericValue
spublic void refresh()
ProjectManager
public long getCurrentCounterForProject(Long id)
ProjectManager
id
- the ID of the project for which to retrieve the counterpublic void setCurrentCounterForProject(Project project, long counter)
ProjectManager
project
- the project for which to set the counter (required)counter
- the counter value to set@EventListener public void shutdown(ComponentManagerShutdownEvent shutdownEvent)
Copyright © 2002-2015 Atlassian. All Rights Reserved.
View cookie preferences