Class ProjectService
java.lang.Object
org.exoplatform.timetracker.service.ProjectService
A Service to access and store Activities
- Version:
- $Id: $Id
- Author:
- medamine
-
Constructor Summary
ConstructorsConstructorDescriptionProjectService(ProjectStorage projectStorage) Constructor for ProjectService. -
Method Summary
Modifier and TypeMethodDescriptioncreateProject(Project project) Create new Project that will be available for all users.voiddeleteProject(Long projectId, String username) Delete Project identified by its id and check if username has permission to delete it.Retrieves the list of Activities with offset, limit and a keyword that can be emptyupdateProject(Project Project, String username) Update an existing Project on datasource.
-
Constructor Details
-
ProjectService
Constructor for ProjectService.
- Parameters:
projectStorage- aProjectStorageobject.
-
-
Method Details
-
createProject
Create new Project that will be available for all users. If the Project already exits anEntityExistsExceptionwill be thrown. -
updateProject
Update an existing Project on datasource. If the Project doesn't exit anEntityNotFoundExceptionwill be thrown. -
deleteProject
public void deleteProject(Long projectId, String username) throws jakarta.persistence.EntityNotFoundException, IllegalAccessException Delete Project identified by its id and check if username has permission to delete it.- Parameters:
projectId- technical identifier of Projectusername- user currently deleting Project- Throws:
jakarta.persistence.EntityNotFoundException- if Project wasn't foundIllegalAccessException- if user is not allowed to delete Project
-
getProjectsList
Retrieves the list of Activities with offset, limit and a keyword that can be empty- Returns:
- List of
Projectthat contains the list of Activities
-