Class TimeTrackerSettingsService
java.lang.Object
org.exoplatform.timetracker.service.TimeTrackerSettingsService
A Service to access and store Activities
- Version:
- $Id: $Id
- Author:
- medamine
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.exoplatform.ws.frameworks.json.JsonGeneratorstatic final org.exoplatform.ws.frameworks.json.JsonParserstatic final org.exoplatform.commons.api.settings.data.Contextstatic final Stringstatic final org.exoplatform.commons.api.settings.data.Scopestatic final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionTimeTrackerSettingsService(SettingsStorage settingsStorage, org.exoplatform.commons.api.settings.SettingService settingService) Constructor for SettingsService. -
Method Summary
Modifier and TypeMethodDescriptioncreateLocation(Location location) Create new Location that will be available for all users.createOffice(Office office) Create new Office that will be available for all users.createWorkTime(WorkTime workTime) Create new WorkTime.voiddeleteLocation(String code, String username) Delete Location identified by its id and check if username has permission to delete it.voiddeleteOffice(String code, String username) Delete Office identified by its id and check if username has permission to delete it.voiddeleteWorkTime(Long workTimeId, String username) Delete WorkTime identified by its id and check if username has permission to delete it.static final <T> TfromJsonString(String value, Class<T> resultClass) Retrieves the list of Activities with offset, limit and a keyword that can be emptyRetrieves the list of Activities with offset, limit and a keyword that can be emptyRetrieves the list of Activities with offset, limit and a keyword that can be emptyvoidsaveSettings(TimeTrackerSetting timeTrackerSetting) static final StringtoJsonString(Object object) updateLocation(Location Location, String username) Update an existing Location on datasource.updateOffice(Office office, String username) Update an existing Office on datasource.updateWorkTime(WorkTime workTime, String username) Update an existing WorkTime on datasource.
-
Field Details
-
TIME_TRACKER_SCOPE_NAME
- See Also:
-
TIME_TRACKER_CONTEXT_NAME
- See Also:
-
TIME_TRACKER_CONTEXT
public static final org.exoplatform.commons.api.settings.data.Context TIME_TRACKER_CONTEXT -
TIME_TRACKER_SCOPE
public static final org.exoplatform.commons.api.settings.data.Scope TIME_TRACKER_SCOPE -
TIME_TRACKER_SETTINGS_KEY_NAME
- See Also:
-
JSON_PARSER
public static final org.exoplatform.ws.frameworks.json.JsonParser JSON_PARSER -
JSON_GENERATOR
public static final org.exoplatform.ws.frameworks.json.JsonGenerator JSON_GENERATOR
-
-
Constructor Details
-
TimeTrackerSettingsService
public TimeTrackerSettingsService(SettingsStorage settingsStorage, org.exoplatform.commons.api.settings.SettingService settingService) Constructor for SettingsService.
- Parameters:
settingsStorage-SettingsStorageobject.settingService-SettingServiceobject.
-
-
Method Details
-
createWorkTime
Create new WorkTime. If the WorkTime already exits anEntityExistsExceptionwill be thrown. -
updateWorkTime
Update an existing WorkTime on datasource. If the WorkTime doesn't exit anEntityNotFoundExceptionwill be thrown. -
deleteWorkTime
public void deleteWorkTime(Long workTimeId, String username) throws javax.persistence.EntityNotFoundException, IllegalAccessException Delete WorkTime identified by its id and check if username has permission to delete it.- Parameters:
workTimeId- technical identifier of WorkTimeusername- user currently deleting WorkTime- Throws:
javax.persistence.EntityNotFoundException- if WorkTime wasn't foundIllegalAccessException- if user is not allowed to delete WorkTime
-
getWorkTimesList
Retrieves the list of Activities with offset, limit and a keyword that can be empty- Returns:
- List of
WorkTimethat contains the list of Activities
-
createLocation
Create new Location that will be available for all users. If the Location already exits anEntityExistsExceptionwill be thrown. -
updateLocation
Update an existing Location on datasource. If the Location doesn't exit anEntityNotFoundExceptionwill be thrown. -
deleteLocation
public void deleteLocation(String code, String username) throws javax.persistence.EntityNotFoundException, IllegalAccessException Delete Location identified by its id and check if username has permission to delete it.- Parameters:
code- technical identifier of Locationusername- user currently deleting Location- Throws:
javax.persistence.EntityNotFoundException- if Location wasn't foundIllegalAccessException- if user is not allowed to delete Location
-
getLocationsList
Retrieves the list of Activities with offset, limit and a keyword that can be empty- Returns:
- List of
Locationthat contains the list of Activities
-
createOffice
Create new Office that will be available for all users. If the Office already exits anEntityExistsExceptionwill be thrown. -
updateOffice
Update an existing Office on datasource. If the Office doesn't exit anEntityNotFoundExceptionwill be thrown. -
deleteOffice
public void deleteOffice(String code, String username) throws javax.persistence.EntityNotFoundException, IllegalAccessException Delete Office identified by its id and check if username has permission to delete it.- Parameters:
code- technical identifier of Officeusername- user currently deleting Office- Throws:
javax.persistence.EntityNotFoundException- if Office wasn't foundIllegalAccessException- if user is not allowed to delete Office
-
getOfficesList
Retrieves the list of Activities with offset, limit and a keyword that can be empty- Returns:
- List of
Officethat contains the list of Activities
-
getSettings
-
saveSettings
- Throws:
Exception
-
toJsonString
-
fromJsonString
-