public class LinkDirectorySetUserPreferencesAction extends ServiceableAction
Modifier and Type | Field and Description |
---|---|
private CurrentUserProvider |
_currentUserProvider
The current user provider
|
private AmetysObjectResolver |
_resolver
The ametys object resolver
|
private UserPreferencesManager |
_userPrefManager
The user preferences manager.
|
manager
EMPTY_MAP
Constructor and Description |
---|
LinkDirectorySetUserPreferencesAction() |
Modifier and Type | Method and Description |
---|---|
private Map<String,String> |
_getContextVars(String siteName,
String language)
Get the context with the language and the site name
|
private String |
_getHiddenLinks(Request request)
Get the hidden link ids from the request
|
private String |
_getLinksPosition(Request request)
Get the ordered link ids from the request
|
private String |
_getStorageContext(String siteName,
String language,
String zoneItemId)
Get the appropriate storage context
|
private void |
_setHiddenLinksUserPref(Request request,
String storageContext,
Map<String,String> contextVars,
UserIdentity user)
Set the hidden links user pref
|
private void |
_setLinksPositionUserPref(Request request,
String storageContext,
Map<String,String> contextVars,
UserIdentity user)
Set the links position user pref
|
Map |
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters) |
void |
service(ServiceManager serviceManager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private UserPreferencesManager _userPrefManager
private AmetysObjectResolver _resolver
private CurrentUserProvider _currentUserProvider
public LinkDirectorySetUserPreferencesAction()
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
private String _getStorageContext(String siteName, String language, String zoneItemId)
siteName
- the name of the sitelanguage
- the languagezoneItemId
- the id of the zone item if we deal with a service, null for an input dataprivate Map<String,String> _getContextVars(String siteName, String language)
siteName
- the name of the sitelanguage
- the languageprivate void _setLinksPositionUserPref(Request request, String storageContext, Map<String,String> contextVars, UserIdentity user) throws UserPreferencesException
request
- the requeststorageContext
- the storage contextcontextVars
- the context varsuser
- the current userUserPreferencesException
- If failed to save user preferencesprivate String _getLinksPosition(Request request)
request
- the requestprivate void _setHiddenLinksUserPref(Request request, String storageContext, Map<String,String> contextVars, UserIdentity user) throws UserPreferencesException
request
- the requeststorageContext
- the storage contextcontextVars
- the context varsuser
- the current userUserPreferencesException
- if failed to save user preferencesprivate String _getHiddenLinks(Request request)
request
- the request