Class ActivityStreamUserPreferencesManager
- java.lang.Object
-
- org.ametys.plugins.workspaces.events.activitystream.ActivityStreamUserPreferencesManager
-
- All Implemented Interfaces:
Component
,Serviceable
public class ActivityStreamUserPreferencesManager extends Object implements Component, Serviceable
Class handling the front-office user preferences for the filtered events service
-
-
Field Summary
Fields Modifier and Type Field Description private CurrentUserProvider
_currentUserProvider
The current user providerprivate JSONUtils
_jsonUtils
Utility method for JSON stringsprivate UserPreferencesManager
_userPreferencesManager
The manager of user preferences for the front-officestatic String
ROLE
The Avalon role
-
Constructor Summary
Constructors Constructor Description ActivityStreamUserPreferencesManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Map<String,String>
_getContextVars(String siteName)
Map<String,Object>
getUserPreferences(String siteName, String zoneItemId)
Get the preferences of the current uservoid
service(ServiceManager serviceManager)
void
setUserPreferences(String siteName, String zoneItemId, List<String> projectNames, Map<String,Object> eventTypes)
Set the preferences of the current user for the filtered events service
-
-
-
Field Detail
-
_currentUserProvider
private CurrentUserProvider _currentUserProvider
The current user provider
-
_userPreferencesManager
private UserPreferencesManager _userPreferencesManager
The manager of user preferences for the front-office
-
_jsonUtils
private JSONUtils _jsonUtils
Utility method for JSON strings
-
-
Constructor Detail
-
ActivityStreamUserPreferencesManager
public ActivityStreamUserPreferencesManager()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setUserPreferences
public void setUserPreferences(String siteName, String zoneItemId, List<String> projectNames, Map<String,Object> eventTypes) throws UserPreferencesException
Set the preferences of the current user for the filtered events service- Parameters:
siteName
- the name of the sitezoneItemId
- the id of the involved zone itemprojectNames
- the names of the projects to use as a filtereventTypes
- the enabled/disabled activity types sorted by category- Throws:
UserPreferencesException
- if an error occurs while setting the user preferences
-
getUserPreferences
public Map<String,Object> getUserPreferences(String siteName, String zoneItemId) throws UserPreferencesException
Get the preferences of the current user- Parameters:
siteName
- the name of the sitezoneItemId
- the id of the involved zone item- Returns:
- the current user's preferences
- Throws:
UserPreferencesException
- if an error occurs while retrieving the preferences of the current user
-
_getContextVars
private Map<String,String> _getContextVars(String siteName)
-
-