public class ActivityStreamUserPreferencesManager extends Object implements Component, Serviceable
Modifier and Type | Field and Description |
---|---|
private CurrentUserProvider |
_currentUserProvider
The current user provider
|
private JSONUtils |
_jsonUtils
Utility method for JSON strings
|
private UserPreferencesManager |
_userPreferencesManager
The manager of user preferences for the front-office
|
static String |
ROLE
The Avalon role
|
Constructor and Description |
---|
ActivityStreamUserPreferencesManager() |
Modifier and Type | Method and Description |
---|---|
private Map<String,String> |
_getContextVars(String siteName) |
Map<String,Object> |
getUserPreferences(String siteName,
String zoneItemId)
Get the preferences of the current user
|
void |
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
|
private CurrentUserProvider _currentUserProvider
private UserPreferencesManager _userPreferencesManager
private JSONUtils _jsonUtils
public ActivityStreamUserPreferencesManager()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public void setUserPreferences(String siteName, String zoneItemId, List<String> projectNames, Map<String,Object> eventTypes) throws UserPreferencesException
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 categoryUserPreferencesException
- if an error occurs while setting the user preferencespublic Map<String,Object> getUserPreferences(String siteName, String zoneItemId) throws UserPreferencesException
siteName
- the name of the sitezoneItemId
- the id of the involved zone itemUserPreferencesException
- if an error occurs while retrieving the preferences of the current userprivate Map<String,String> _getContextVars(String siteName)