|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.project.AbstractProjectManager
com.atlassian.jira.mock.MockProjectManager
public class MockProjectManager
Constructor Summary | |
---|---|
MockProjectManager()
|
Method Summary | |
---|---|
void |
addProject(org.ofbiz.core.entity.GenericValue gv)
|
void |
addProject(Project project)
|
static MockProjectManager |
createDefaultProjectManager()
Creates a "default" MockProjectManager. |
Project |
createProject(String name,
String key,
String description,
String lead,
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. |
Collection<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)
Get a component from within this project, based on the project and the component name. |
org.ofbiz.core.entity.GenericValue |
getComponent(Long id)
Get a component from within this project, by it's id. |
Collection<org.ofbiz.core.entity.GenericValue> |
getComponents(org.ofbiz.core.entity.GenericValue project)
Returns a collection of components in a project. |
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). |
org.ofbiz.core.entity.GenericValue |
getProject(Long id)
Retrieve a single project by it's id. |
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)
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 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)
Returns a list of projects in a particular 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()
Returns a list of projects without project category, sorted by project name |
boolean |
isAssignee(org.ofbiz.core.entity.GenericValue project,
com.atlassian.crowd.embedded.api.User user)
Checks if given user is assignee of at least one issue in the given project. |
boolean |
isAssignee(Project project,
com.atlassian.crowd.embedded.api.User user)
Checks if given user is assignee of at least one issue in the given project. |
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 project,
org.ofbiz.core.entity.GenericValue category)
Sets a projects category. |
void |
setProjectCategory(Project project,
ProjectCategory category)
Sets a project's category. |
Project |
updateProject(Project updatedProject,
String name,
String description,
String lead,
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockProjectManager()
Method Detail |
---|
public void addProject(Project project)
public void addProject(org.ofbiz.core.entity.GenericValue gv)
public Project createProject(String name, String key, String description, String lead, 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 projectlead
- 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 Project updateProject(Project updatedProject, String name, String description, String lead, 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 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.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)
id
- project id
public org.ofbiz.core.entity.GenericValue getProjectByName(String name)
ProjectManager
name
- project name
public org.ofbiz.core.entity.GenericValue getProjectByKey(String key)
ProjectManager
key
- the project key
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 project
Project
object specified by the supplied name or nullpublic Collection<org.ofbiz.core.entity.GenericValue> getProjects()
ProjectManager
GenericValue
s.
public List<Project> getProjectObjects()
ProjectManager
Project
s ordered by name.
public long getProjectCount() throws DataAccessException
ProjectManager
Project
s.
DataAccessException
- if any errors occur accessing the DB.public org.ofbiz.core.entity.GenericValue getComponent(Long id)
ProjectManager
id
- id
GenericValue
.ProjectComponentManager.find(Long)
public org.ofbiz.core.entity.GenericValue getComponent(org.ofbiz.core.entity.GenericValue project, String name)
ProjectManager
project
- projectname
- name
GenericValue
.ProjectComponentManager.findByComponentName(java.lang.Long, java.lang.String)
public Collection<org.ofbiz.core.entity.GenericValue> getComponents(org.ofbiz.core.entity.GenericValue project)
ProjectManager
project
- project
GenericValue
s.ProjectComponentManager.findAllForProject(java.lang.Long)
public Collection<org.ofbiz.core.entity.GenericValue> getProjectCategories()
ProjectManager
GenericValue
spublic Collection<ProjectCategory> getAllProjectCategories()
ProjectManager
public org.ofbiz.core.entity.GenericValue getProjectCategory(Long id)
ProjectManager
id
- Project Category ID.
GenericValue
public ProjectCategory getProjectCategoryObject(Long id) throws DataAccessException
ProjectManager
id
- Project Category ID.
DataAccessException
public void updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
ProjectManager
projectCat
- project category.public void updateProjectCategory(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)
ProjectManager
projectCategory
- project category.
GenericValue
s sorted by name.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<org.ofbiz.core.entity.GenericValue> getProjectsWithNoCategory()
ProjectManager
GenericValue
s sorted by namepublic Collection<Project> getProjectObjectsWithNoCategory()
ProjectManager
Project
s sorted by namepublic org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
ProjectManager
project
- project
GenericValue
or null if no category exists.public ProjectCategory getProjectCategoryForProject(Project project)
ProjectManager
project
- project
public void setProjectCategory(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue category)
ProjectManager
project
- projectcategory
- categorypublic 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 List<Project> getProjectsLeadBy(com.atlassian.crowd.embedded.api.User leadUser)
ProjectManager
leadUser
- Project Lead
public List<Project> getProjectsLeadBy(ApplicationUser leadUser)
ProjectManager
leadUser
- Project Lead
public Collection<org.ofbiz.core.entity.GenericValue> getProjectsByLead(com.atlassian.crowd.embedded.api.User leadUser)
ProjectManager
leadUser
- Project Lead
GenericValue
spublic long getNextId(Project project) throws DataAccessException
ProjectManager
project
- The Project
DataAccessException
- If any errors occur accessing the DB.public long getCurrentCounterForProject(Long id)
ProjectManager
id
- the ID of the project for which to retrieve the counter
public void setCurrentCounterForProject(Project project, long counter)
ProjectManager
project
- the project for which to set the counter (required)counter
- the counter value to setpublic void refresh()
ProjectManager
public boolean isAssignee(org.ofbiz.core.entity.GenericValue project, com.atlassian.crowd.embedded.api.User user)
ProjectManager
project
- projectuser
- user
public boolean isAssignee(Project project, com.atlassian.crowd.embedded.api.User user)
ProjectManager
project
- projectuser
- user
public static MockProjectManager createDefaultProjectManager()
This will include the following projects:
ID | Key | Name |
1 | HSP | Homosapien |
2 | MNK | Monkey |
3 | RAT | Rattus |
4 | COW | Bovine |
5 | DOG | Canine |
6 | PIG | Porcine |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |