Class ProjectService
- java.lang.Object
-
- org.exoplatform.timetracker.service.ProjectService
-
public class ProjectService extends java.lang.ObjectA Service to access and store Activities- Version:
- $Id: $Id
- Author:
- medamine
-
-
Constructor Summary
Constructors Constructor Description ProjectService(ProjectStorage projectStorage)Constructor for ProjectService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProjectcreateProject(Project project)Create new Project that will be available for all users.voiddeleteProject(java.lang.Long projectId, java.lang.String username)Delete Project identified by its id and check if username has permission to delete it.java.util.List<Project>getProjectsList()Retrieves the list of Activities with offset, limit and a keyword that can be emptyProjectupdateProject(Project Project, java.lang.String username)Update an existing Project on datasource.
-
-
-
Constructor Detail
-
ProjectService
public ProjectService(ProjectStorage projectStorage)
Constructor for ProjectService.
- Parameters:
projectStorage- aProjectStorageobject.
-
-
Method Detail
-
createProject
public Project createProject(Project project) throws java.lang.Exception
Create new Project that will be available for all users. If the Project already exits anEntityExistsExceptionwill be thrown.- Parameters:
project- Project to create- Returns:
- stored
Projectin datasource - Throws:
java.lang.Exception- when Project already exists or an error occurs while creating Project or its attached image
-
updateProject
public Project updateProject(Project Project, java.lang.String username) throws java.lang.Exception
Update an existing Project on datasource. If the Project doesn't exit anEntityNotFoundExceptionwill be thrown.- Parameters:
Project- dto to update on storeusername- username storing Project- Returns:
- stored
Projectin datasource - Throws:
java.lang.Exception- whenExceptionis thrown or an error occurs while saving Project
-
deleteProject
public void deleteProject(java.lang.Long projectId, java.lang.String username) throws javax.persistence.EntityNotFoundException, java.lang.IllegalAccessExceptionDelete 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:
javax.persistence.EntityNotFoundException- if Project wasn't foundjava.lang.IllegalAccessException- if user is not allowed to delete Project
-
-