public class MockProjectManager extends AbstractProjectManager
Constructor and Description |
---|
MockProjectManager() |
Modifier and Type | Method and Description |
---|---|
void |
addProject(org.ofbiz.core.entity.GenericValue gv) |
void |
addProject(Project project) |
Project |
createProject(ApplicationUser user,
ProjectCreationData projectCreationData)
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.
|
Collection<ProjectCategory> |
getAllProjectCategories()
Returns all ProjectCategories, ordered by name.
|
Set<String> |
getAllProjectKeys(Long projectId)
Returns all project keys that are associated with
Project . |
List<Project> |
getArchivedProjects()
Return archived
Project s ordered by name. |
long |
getCurrentCounterForProject(Long id)
Returns the curremt issue counter for the given project.
|
long |
getNextId(Project project)
Get the next issue ID from this project (transactional).
|
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. |
ProjectCategory |
getProjectCategory(Long id)
Returns a single project category by id.
|
ProjectCategory |
getProjectCategoryForProject(Project project)
Returns a project's category.
|
ProjectCategory |
getProjectCategoryObject(Long id)
Returns a single project category by id.
|
long |
getProjectCount()
Return the total number of
Project s. |
Project |
getProjectObj(Long id)
Returns project object or null if project with that id doesn't exist.
|
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 open
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
|
List<Project> |
getProjects()
Return all
Project s ordered by name. |
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.
|
boolean |
isProjectCategoryUnique(String projectCategory)
Checks if a project category with a given name exists.
|
void |
refresh()
Causes a full refresh of the project cache.
|
void |
removeAllProjects() |
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 |
removeProjectIssues(Project project,
Context taskContext)
Removes all issues for a particular project.
|
void |
setCurrentCounterForProject(Project project,
long counter)
Set the project counter.
|
void |
setProjectCategory(Project project,
ProjectCategory category)
Sets a project's category.
|
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.
|
Project |
updateProject(UpdateProjectParameters parameters)
Updates the project with the given changes.
|
void |
updateProjectCategory(ProjectCategory projectCategory)
Persist an updated project category.
|
Project |
updateProjectType(ApplicationUser user,
Project project,
ProjectTypeKey newProjectType)
Updates the type of a project.
|
convertToProjectObjects, getDefaultAssignee, getDefaultAssignee, getProjectByCurrentKey, getProjectCategoryObjectByName, getProjectCategoryObjectByNameIgnoreCase, getProjectsByArgs, updateProject, updateProject
public void addProject(Project project)
public void addProject(org.ofbiz.core.entity.GenericValue gv)
public void removeAllProjects()
public Project createProject(@Nonnull ApplicationUser user, @Nonnull ProjectCreationData projectCreationData)
ProjectManager
If no name, key, lead or project type are provided an exception will be thrown.
user
- The user creating the projectprojectCreationData
- An object encapsulating all the data for the project that will get createdProjectCreationData
public 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 Project updateProject(UpdateProjectParameters parameters)
ProjectManager
parameters
- containing the changes to the project that needs to be made.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 removeProjectIssues(Project project, Context taskContext) throws RemoveException
ProjectManager
project
- The project for which issues will be deleted.taskContext
- A task context for providing progress.RemoveException
- if there's any errors removing issuespublic void removeProject(Project project)
ProjectManager
ProjectService.deleteProject(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.bc.project.ProjectService.DeleteProjectValidationResult)
to
properly delete a project.project
- The project to be deleted.public Project getProjectObj(Long id)
id
- project idpublic 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@Nonnull public List<Project> getProjects()
ProjectManager
Project
s ordered by name.@Nonnull public List<Project> getArchivedProjects()
ProjectManager
Project
s ordered by name.@Nonnull public List<Project> getProjectObjects()
ProjectManager
Project
s ordered by name.
This method does the same thing as getProjects() and exists for legacy reasons.
ProjectManager.getProjects()
public long getProjectCount() throws DataAccessException
ProjectManager
Project
s.DataAccessException
- if any errors occur accessing the DB.public Collection<ProjectCategory> getAllProjectCategories()
ProjectManager
public ProjectCategory getProjectCategory(Long id)
ProjectManager
id
- ProjectCategory
id.ProjectCategory
for the provided id if it was found or else null@Nullable public ProjectCategory getProjectCategoryObject(Long id) throws DataAccessException
ProjectManager
Legacy synonym for ProjectManager.getProjectCategory(Long)
id
- Project Category ID.DataAccessException
public void updateProjectCategory(ProjectCategory projectCategory) throws DataAccessException
ProjectManager
projectCategory
- project category.DataAccessException
- If any errors occur accessing the DB.public 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<Project> getProjectObjectsWithNoCategory()
ProjectManager
Project
s sorted by namepublic ProjectCategory getProjectCategoryForProject(Project project)
ProjectManager
project
- projectpublic void setProjectCategory(Project project, ProjectCategory category)
ProjectManager
project
- projectcategory
- categorypublic ProjectCategory createProjectCategory(String name, String description)
ProjectManager
name
- the Namedescription
- the Description.public void removeProjectCategory(Long id)
ProjectManager
id
- the ProjectCategory to remove.public boolean isProjectCategoryUnique(String projectCategory)
ProjectManager
projectCategory
- the name of the project categorypublic List<Project> getProjectsLeadBy(ApplicationUser leadUser)
ProjectManager
leadUser
- Project Leadpublic long getNextId(Project project) throws DataAccessException
ProjectManager
project
- The ProjectDataAccessException
- If any errors occur accessing the DB.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 setpublic Project updateProjectType(ApplicationUser user, Project project, ProjectTypeKey newProjectType)
ProjectManager
user
- The user performing the actionproject
- The project which type needs to be updatednewProjectType
- The new project typepublic void refresh()
ProjectManager
Copyright © 2002-2019 Atlassian. All Rights Reserved.