Class ProjectService

java.lang.Object
org.exoplatform.timetracker.service.ProjectService

public class ProjectService extends Object
A Service to access and store Activities
Version:
$Id: $Id
Author:
medamine
  • Constructor Details

    • ProjectService

      public ProjectService(ProjectStorage projectStorage)

      Constructor for ProjectService.

      Parameters:
      projectStorage - a ProjectStorage object.
  • Method Details

    • createProject

      public Project createProject(Project project) throws Exception
      Create new Project that will be available for all users. If the Project already exits an EntityExistsException will be thrown.
      Parameters:
      project - Project to create
      Returns:
      stored Project in datasource
      Throws:
      Exception - when Project already exists or an error occurs while creating Project or its attached image
    • updateProject

      public Project updateProject(Project Project, String username) throws Exception
      Update an existing Project on datasource. If the Project doesn't exit an EntityNotFoundException will be thrown.
      Parameters:
      Project - dto to update on store
      username - username storing Project
      Returns:
      stored Project in datasource
      Throws:
      Exception - when Exception is thrown or an error occurs while saving Project
    • 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 Project
      username - user currently deleting Project
      Throws:
      jakarta.persistence.EntityNotFoundException - if Project wasn't found
      IllegalAccessException - if user is not allowed to delete Project
    • getProjectsList

      public List<Project> getProjectsList()
      Retrieves the list of Activities with offset, limit and a keyword that can be empty
      Returns:
      List of Project that contains the list of Activities