Package org.ametys.plugins.linkdirectory
Class LinkDirectorySetUserPreferencesAction
- java.lang.Object
 - 
- org.apache.avalon.framework.logger.AbstractLogEnabled
 - 
- org.apache.cocoon.acting.AbstractAction
 - 
- org.apache.cocoon.acting.ServiceableAction
 - 
- org.ametys.plugins.linkdirectory.LinkDirectorySetUserPreferencesAction
 
 
 
 
 
- 
- All Implemented Interfaces:
 Component,LogEnabled,Serviceable,Action
public class LinkDirectorySetUserPreferencesAction extends ServiceableAction
Create or set user preferences attached to a link directory service or the link directory input data mode for front-end users 
- 
- 
Field Summary
Fields Modifier and Type Field Description private CurrentUserProvider_currentUserProviderThe current user providerprivate DirectoryHelper_directoryHelperprivate UserPreferencesManager_userPrefManagerThe user preferences manager.- 
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager 
- 
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP 
 - 
 
- 
Constructor Summary
Constructors Constructor Description LinkDirectorySetUserPreferencesAction() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String_getHiddenLinks(Request request)Get the hidden link ids from the requestprivate String_getLinksPosition(Request request)Get the ordered link ids from the requestprivate void_setHiddenLinksUserPref(Request request, String storageContext, Map<String,String> contextVars, UserIdentity user)Set the hidden links user prefprivate void_setLinksPositionUserPref(Request request, String storageContext, Map<String,String> contextVars, UserIdentity user)Set the links position user prefMapact(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)voidservice(ServiceManager serviceManager)- 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger 
 - 
 
 - 
 
- 
- 
Field Detail
- 
_userPrefManager
private UserPreferencesManager _userPrefManager
The user preferences manager. 
- 
_currentUserProvider
private CurrentUserProvider _currentUserProvider
The current user provider 
- 
_directoryHelper
private DirectoryHelper _directoryHelper
 
 - 
 
- 
Constructor Detail
- 
LinkDirectorySetUserPreferencesAction
public LinkDirectorySetUserPreferencesAction()
 
 - 
 
- 
Method Detail
- 
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
 servicein interfaceServiceable- Overrides:
 servicein classServiceableAction- Throws:
 ServiceException
 
- 
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
- Throws:
 Exception
 
- 
_setLinksPositionUserPref
private void _setLinksPositionUserPref(Request request, String storageContext, Map<String,String> contextVars, UserIdentity user) throws UserPreferencesException
Set the links position user pref- Parameters:
 request- the requeststorageContext- the storage contextcontextVars- the context varsuser- the current user- Throws:
 UserPreferencesException- If failed to save user preferences
 
- 
_getLinksPosition
private String _getLinksPosition(Request request)
Get the ordered link ids from the request- Parameters:
 request- the request- Returns:
 - the comma-separated string of ordered links ids
 
 
- 
_setHiddenLinksUserPref
private void _setHiddenLinksUserPref(Request request, String storageContext, Map<String,String> contextVars, UserIdentity user) throws UserPreferencesException
Set the hidden links user pref- Parameters:
 request- the requeststorageContext- the storage contextcontextVars- the context varsuser- the current user- Throws:
 UserPreferencesException- if failed to save user preferences
 
- 
_getHiddenLinks
private String _getHiddenLinks(Request request)
Get the hidden link ids from the request- Parameters:
 request- the request- Returns:
 - the comma-separated string of hidden links ids
 
 
 - 
 
 -