Class FilterService
- java.lang.Object
-
- org.exoplatform.timetracker.service.FilterService
-
public class FilterService extends java.lang.ObjectA Service to access and store Activities- Version:
- $Id: $Id
- Author:
- medamine
-
-
Constructor Summary
Constructors Constructor Description FilterService(FilterStorage filterStorage)Constructor for FilterService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilterModelcreateFilter(FilterModel filter, java.lang.String userName)Create new Filter that will be available for all users.voiddeleteFilter(java.lang.Long filterId)Delete Filter identified by its id and check if username has permission to delete it.org.json.JSONObjectgetFields(long filterId)getFields.org.json.JSONArraygetFiltersList(java.lang.String userName)Retrieves the list of Activities with offset, limit and a keyword that can be empty
-
-
-
Constructor Detail
-
FilterService
public FilterService(FilterStorage filterStorage)
Constructor for FilterService.
- Parameters:
filterStorage- aFilterStorageobject.
-
-
Method Detail
-
createFilter
public FilterModel createFilter(FilterModel filter, java.lang.String userName) throws java.lang.Exception
Create new Filter that will be available for all users. If the Filter already exits anEntityExistsExceptionwill be thrown.- Parameters:
filter- Filter to createuserName- aStringobject.- Returns:
- stored
Filterin datasource - Throws:
java.lang.Exception- when Filter already exists or an error occurs while creating Filter or its attached image
-
deleteFilter
public void deleteFilter(java.lang.Long filterId) throws javax.persistence.EntityNotFoundException, java.lang.IllegalAccessExceptionDelete Filter identified by its id and check if username has permission to delete it.- Parameters:
filterId- technical identifier of Filter- Throws:
javax.persistence.EntityNotFoundException- if Filter wasn't foundjava.lang.IllegalAccessException- if user is not allowed to delete Filter
-
getFiltersList
public org.json.JSONArray getFiltersList(java.lang.String userName)
Retrieves the list of Activities with offset, limit and a keyword that can be empty- Parameters:
userName- aStringobject.- Returns:
- List of
FilterModelthat contains the list of Activities
-
getFields
public org.json.JSONObject getFields(long filterId)
getFields.
- Parameters:
filterId- a long.- Returns:
- a
JSONObjectobject.
-
-