public class SetUserPreferencesAction extends AbstractCurrentUserProviderServiceableAction
Modifier and Type | Field and Description |
---|---|
protected static Set<DateFormat> |
_INPUT_DATE_FORMATS
The input date format.
|
protected UserPreferencesExtensionPoint |
_userPrefEP
The user preferences extension point.
|
protected UserPreferencesManager |
_userPrefManager
The user preferences manager.
|
manager
EMPTY_MAP
Constructor and Description |
---|
SetUserPreferencesAction() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,String> |
_getValues(Request request,
Map<String,String> contextVars,
UserIdentity user,
Collection<String> preferenceIds,
UserPreferencesErrors errors)
Get the preferences values from the request.
|
protected Date |
_parseDate(String value)
Parse a user-submitted date.
|
Map |
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters) |
protected Map<String,String> |
getContextVars(Request request)
Get the preferences context variables.
|
protected Collection<String> |
getPreferenceIds(Request request,
Map<String,Object> parentContext)
Get the preferences to set.
|
protected String |
getStorageContext(Request request,
Parameters parameters)
Get the context of user's preference storage
|
protected UserIdentity |
getUser(Request request,
Parameters parameters)
Get the user
|
void |
service(ServiceManager serviceManager) |
protected Map<String,String> |
setUserPreferences(Request request,
String storageContext,
Map<String,String> contextVars,
UserIdentity user)
Set user preferences.
|
protected Map<String,String> |
setUserPreferences(Request request,
String storageContext,
Map<String,String> contextVars,
UserIdentity user,
Collection<String> preferenceIds)
Set user preferences.
|
_getCurrentUser
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected static final Set<DateFormat> _INPUT_DATE_FORMATS
protected UserPreferencesExtensionPoint _userPrefEP
protected UserPreferencesManager _userPrefManager
public SetUserPreferencesAction()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableAction
ServiceException
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
Exception
protected UserIdentity getUser(Request request, Parameters parameters)
request
- The requestparameters
- The sitemap parametersprotected String getStorageContext(Request request, Parameters parameters)
request
- The requestparameters
- The sitemap parametersprotected Map<String,String> setUserPreferences(Request request, String storageContext, Map<String,String> contextVars, UserIdentity user) throws UserPreferencesException
request
- the request.storageContext
- the preferences storage context.contextVars
- the preferences context map.user
- the user.UserPreferencesException
- if an error occurredprotected Map<String,String> setUserPreferences(Request request, String storageContext, Map<String,String> contextVars, UserIdentity user, Collection<String> preferenceIds) throws UserPreferencesException
request
- the request.storageContext
- the preferences context.contextVars
- the preferences context map.user
- the user.preferenceIds
- a collection of the IDs of preferences to set.UserPreferencesException
- if an error occurredprotected Map<String,String> _getValues(Request request, Map<String,String> contextVars, UserIdentity user, Collection<String> preferenceIds, UserPreferencesErrors errors)
request
- the request.contextVars
- The context varsuser
- the user.preferenceIds
- a collection of the IDs of preferences to set.errors
- the errors object to fill in.protected Date _parseDate(String value)
value
- the date value as a String.protected Map<String,String> getContextVars(Request request)
request
- the request.protected Collection<String> getPreferenceIds(Request request, Map<String,Object> parentContext)
request
- the request.parentContext
- the parent context.