Class FilterService

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

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

    • FilterService

      public FilterService(FilterStorage filterStorage)

      Constructor for FilterService.

      Parameters:
      filterStorage - a FilterStorage object.
  • Method Details

    • createFilter

      public FilterModel createFilter(FilterModel filter, String userName) throws Exception
      Create new Filter that will be available for all users. If the Filter already exits an EntityExistsException will be thrown.
      Parameters:
      filter - Filter to create
      userName - a String object.
      Returns:
      stored Filter in datasource
      Throws:
      Exception - when Filter already exists or an error occurs while creating Filter or its attached image
    • deleteFilter

      public void deleteFilter(Long filterId) throws jakarta.persistence.EntityNotFoundException, IllegalAccessException
      Delete Filter identified by its id and check if username has permission to delete it.
      Parameters:
      filterId - technical identifier of Filter
      Throws:
      jakarta.persistence.EntityNotFoundException - if Filter wasn't found
      IllegalAccessException - if user is not allowed to delete Filter
    • getFiltersList

      public org.json.JSONArray getFiltersList(String userName)
      Retrieves the list of Activities with offset, limit and a keyword that can be empty
      Parameters:
      userName - a String object.
      Returns:
      List of FilterModel that contains the list of Activities
    • getFields

      public org.json.JSONObject getFields(long filterId)

      getFields.

      Parameters:
      filterId - a long.
      Returns:
      a JSONObject object.