Package com.taskadapter.redmineapi
Class ProjectManager
- java.lang.Object
-
- com.taskadapter.redmineapi.ProjectManager
-
public class ProjectManager extends java.lang.Object
Works with Projects and their Versions.Obtain it via RedmineManager:
RedmineManager redmineManager = RedmineManagerFactory.createWithUserAuth(redmineURI, login, password); ProjectManager projectManager = redmineManager.getProjectManager();
Sample usage:
projectManager.getProjectById(123); projects = projectManager.getProjects();
- See Also:
RedmineManager.getIssueManager()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Membership
addGroupToProject(int projectId, int groupId, java.util.Collection<Role> roles)
Deprecated.Membership
addUserToProject(int projectId, int userId, java.util.Collection<Role> roles)
Deprecated.Project
createProject(Project project)
Deprecated.Version
createVersion(Version version)
Deprecated.void
deleteProject(java.lang.String projectKey)
Deprecated.void
deleteProjectMembership(int membershipId)
Deprecated.void
deleteProjectMembership(Membership membership)
Deprecated.void
deleteVersion(Version version)
Deprecated.java.util.List<News>
getNews(java.lang.String projectKey)
Project
getProjectById(int id)
Project
getProjectByKey(java.lang.String projectKey)
Membership
getProjectMember(int membershipId)
java.util.List<Membership>
getProjectMembers(int projectId)
java.util.List<Membership>
getProjectMembers(java.lang.String projectKey)
java.util.List<Project>
getProjects()
Load the list of projects available to the user, which is represented by the API access key.Version
getVersionById(int versionId)
java.util.List<Version>
getVersions(int projectID)
void
update(Project object)
Deprecated.void
update(Version object)
Deprecated.void
updateProjectMembership(Membership membership)
Deprecated.
-
-
-
Method Detail
-
createProject
@Deprecated public Project createProject(Project project) throws RedmineException
Deprecated.DEPRECATED. use project.create() instead- Throws:
RedmineException
-
getProjects
public java.util.List<Project> getProjects() throws RedmineException
Load the list of projects available to the user, which is represented by the API access key.Redmine ignores "get trackers info" parameter for "get projects" request. see bug http://www.redmine.org/issues/8545 The field is already accessible for a specific project for a long time (GET /projects/:id) but in the projects list (GET /projects) it's only on the svn trunk for now (Sep 8, 2014). It will be included in Redmine 2.6.0 which isn't out yet.
- Returns:
- list of Project objects
- Throws:
RedmineAuthenticationException
- invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.RedmineException
-
getProjectByKey
public Project getProjectByKey(java.lang.String projectKey) throws RedmineException
- Parameters:
projectKey
- string key like "project-ABC", NOT a database numeric ID- Returns:
- Redmine's project
- Throws:
RedmineAuthenticationException
- invalid or no API access key is used with the server, which requires authorization. Check the constructor arguments.NotFoundException
- the project with the given key is not foundRedmineException
-
getProjectById
public Project getProjectById(int id) throws RedmineException
- Parameters:
id
- project database Id, like 123. this is not a string "key" like "myproject".- Returns:
- Redmine's project
- Throws:
RedmineAuthenticationException
- invalid or no API access key is used with the server, which requires authorization.NotFoundException
- the project with the given id is not foundRedmineException
-
deleteProject
@Deprecated public void deleteProject(java.lang.String projectKey) throws RedmineException
Deprecated.DEPRECATED. use project.delete() instead- Throws:
RedmineException
-
createVersion
@Deprecated public Version createVersion(Version version) throws RedmineException
Deprecated.DEPRECATED. use version.create() instead.- Throws:
RedmineException
-
deleteVersion
@Deprecated public void deleteVersion(Version version) throws RedmineException
Deprecated.DEPRECATED. use version.create() instead.- Throws:
RedmineException
-
getVersions
public java.util.List<Version> getVersions(int projectID) throws RedmineException
- Parameters:
projectID
- the ID of theProject
- Returns:
- the list of
Version
s of theProject
- Throws:
RedmineAuthenticationException
- thrown in case something went wrong while trying to loginRedmineException
- thrown in case something went wrong in RedmineNotFoundException
- thrown in case an object can not be found
-
getVersionById
public Version getVersionById(int versionId) throws RedmineException
- Throws:
RedmineException
-
update
@Deprecated public void update(Project object) throws RedmineException
Deprecated.- Throws:
RedmineException
-
update
@Deprecated public void update(Version object) throws RedmineException
Deprecated.- Throws:
RedmineException
-
getNews
public java.util.List<News> getNews(java.lang.String projectKey) throws RedmineException
- Parameters:
projectKey
- ignored if NULL- Returns:
- list of news objects
- Throws:
RedmineException
- See Also:
News
-
addUserToProject
@Deprecated public Membership addUserToProject(int projectId, int userId, java.util.Collection<Role> roles) throws RedmineException
Deprecated.DEPRECATED. use membership.create()- Throws:
RedmineException
-
addGroupToProject
@Deprecated public Membership addGroupToProject(int projectId, int groupId, java.util.Collection<Role> roles) throws RedmineException
Deprecated.DEPRECATED. use membership.create()- Throws:
RedmineException
-
getProjectMembers
public java.util.List<Membership> getProjectMembers(java.lang.String projectKey) throws RedmineException
- Parameters:
projectKey
- string-based project key (like "TEST")- Returns:
- list of project members (users or groups)
- Throws:
RedmineException
-
getProjectMembers
public java.util.List<Membership> getProjectMembers(int projectId) throws RedmineException
- Parameters:
projectId
- database ID of the project (like 123)- Returns:
- list of project members (users or groups)
- Throws:
RedmineException
-
getProjectMember
public Membership getProjectMember(int membershipId) throws RedmineException
- Throws:
RedmineException
-
deleteProjectMembership
@Deprecated public void deleteProjectMembership(int membershipId) throws RedmineException
Deprecated.DEPRECATED. use membership.delete() instead.- Throws:
RedmineException
-
deleteProjectMembership
@Deprecated public void deleteProjectMembership(Membership membership) throws RedmineException
Deprecated.DEPRECATED. use membership.delete() instead.- Throws:
RedmineException
-
updateProjectMembership
@Deprecated public void updateProjectMembership(Membership membership) throws RedmineException
Deprecated.DEPRECATED. use membership.update() instead.- Throws:
RedmineException
-
-