Interface OpenProjectApiClient
@Role
public interface OpenProjectApiClient
Defines the methods that a OpenProject api client should implement.
- Version:
- $Id$
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves all available priorities from the current OpenProject configuration.getProjects(int offset, int pageSize, String filters) Retrieves a paginated list of available projects based on the specified page size and filter criteria from the current OpenProject configuration.getProjectWorkPackages(String project, int offset, int pageSize, String filters, String sortBy) Retrieves a list of available work packages from the current OpenProject configuration and specified project.Retrieves all available statuses from the current OpenProject configuration.getTypes()Retrieves all available types from the current OpenProject configuration.getUserAvatar(String userId) Retrieve the user avatar.Retrieves a list of available users based on the specified page size and filter criteria from the current OpenProject configuration.getWorkPackages(int offset, int pageSize, String filters, String sortBy) Retrieves a list of available work packages from the current OpenProject configuration.
-
Method Details
-
getWorkPackages
PaginatedResult<WorkPackage> getWorkPackages(int offset, int pageSize, String filters, String sortBy) throws ProjectManagementException Retrieves a list of available work packages from the current OpenProject configuration.- Parameters:
offset- the offset index from which to start retrieving work packages.pageSize- the maximum number of work packages to return.filters- optional filters to apply (e.g. query parameters encoded as a string).sortBy- optional sorting criteria to apply (e.g. field name and sort direction).- Returns:
- a
PaginatedResultcontaining the list ofWorkPackageand pagination metadata. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the work packages.
-
getProjectWorkPackages
PaginatedResult<WorkPackage> getProjectWorkPackages(String project, int offset, int pageSize, String filters, String sortBy) throws ProjectManagementException Retrieves a list of available work packages from the current OpenProject configuration and specified project.- Parameters:
project- the project (project name or id) from which we want to retrieve the work packagesoffset- the offset index from which to start retrieving work packages.pageSize- the maximum number of work packages to return.filters- optional filters to apply (e.g. query parameters encoded as a string).sortBy- optional sorting criteria to apply (e.g. field name and sort direction).- Returns:
- a
PaginatedResultcontaining the list ofWorkPackageand pagination metadata. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the work packages.
-
getUsers
PaginatedResult<User> getUsers(int offset, int pageSize, String filters) throws ProjectManagementException Retrieves a list of available users based on the specified page size and filter criteria from the current OpenProject configuration.- Parameters:
offset- the offset from which to start retrieving users.pageSize- the number of users to retrieve per page.filters- a JSON-formatted string representing filter criteria to apply to the request- Returns:
- a list of
User - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the users.
-
getProjects
PaginatedResult<Project> getProjects(int offset, int pageSize, String filters) throws ProjectManagementException Retrieves a paginated list of available projects based on the specified page size and filter criteria from the current OpenProject configuration.- Parameters:
offset- the offset from which to start retrieving projects.pageSize- the number of users to retrieve per page.filters- a JSON-formatted string representing filter criteria to apply to the request.- Returns:
- a list of
Project. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the projects.
-
getTypes
Retrieves all available types from the current OpenProject configuration.- Returns:
- a List of
Type. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the types.
-
getStatuses
Retrieves all available statuses from the current OpenProject configuration.- Returns:
- a List of
Status. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the statuses.
-
getPriorities
Retrieves all available priorities from the current OpenProject configuration.- Returns:
- a List of
Priority. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the priorities.
-
getUserAvatar
Retrieve the user avatar.- Parameters:
userId- the id of the user for which we want to retrieve the avatar.- Returns:
- the model containing the image stream and its content type.
- Throws:
ProjectManagementException- Since:
- 1.0-rc-5
-