public class GetUserPreferencesAction extends ServiceableAction
| Modifier and Type | Field and Description |
|---|---|
private CurrentUserProvider |
_currentUserProvider
The current user provider
|
protected UserPreferencesExtensionPoint |
_userPrefEP
The user preferences extension point.
|
protected UserPreferencesManager |
_userPrefManager
The user preferences manager.
|
managerEMPTY_MAP| Constructor and Description |
|---|
GetUserPreferencesAction() |
| Modifier and Type | Method and Description |
|---|---|
Map |
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters) |
protected Map<String,String> |
getContextVars(Request request)
Get the preferences context.
|
protected UserIdentity |
getUser(Parameters parameters)
Get the user in the user manager.
|
protected Map<String,Object> |
userPref2JsonObject(UserPreference userPref,
Object value)
Convert a user preference to JSON object
|
protected Map<String,Object> |
userPrefs2JsonObject(List<UserPreference> userPrefs,
Map<String,String> prefValues,
boolean excludePrivate)
Convert user preferences to JSON object
|
protected Map<String,Object> |
userPrefs2JsonObject(String storageContext,
Map<String,String> contextVars,
UserIdentity user,
boolean excludePrivate)
Convert user preferences to JSON object
|
serviceenableLogging, getLogger, setupLogger, setupLogger, setupLoggerprotected UserPreferencesExtensionPoint _userPrefEP
protected UserPreferencesManager _userPrefManager
private CurrentUserProvider _currentUserProvider
public GetUserPreferencesAction()
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
Exceptionprotected Map<String,Object> userPrefs2JsonObject(String storageContext, Map<String,String> contextVars, UserIdentity user, boolean excludePrivate) throws ProcessingException, UserPreferencesException
storageContext - the preferences context.contextVars - The context varsuser - the userexcludePrivate - true to exclude private preferencesProcessingException - if an error occurredUserPreferencesException - if an error occurredprotected Map<String,Object> userPrefs2JsonObject(List<UserPreference> userPrefs, Map<String,String> prefValues, boolean excludePrivate) throws ProcessingException
userPrefs - the user preferences.prefValues - The valuesexcludePrivate - true to exclude private preferencesProcessingException - if an error occurredprotected Map<String,Object> userPref2JsonObject(UserPreference userPref, Object value) throws ProcessingException
userPref - the user preference.value - The valueProcessingException - if an error occurredprotected UserIdentity getUser(Parameters parameters)
parameters - The parametersprotected Map<String,String> getContextVars(Request request)
request - the request.