Class AbstractItemsAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.plugins.frontnotification.userprefs.AbstractItemsAction
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
GetReadItemsAction
,SaveReadItemsAction
public abstract class AbstractItemsAction extends ServiceableAction
Abstract classes for flash info user preferences
-
-
Field Summary
Fields Modifier and Type Field Description protected CurrentUserProvider
_currentUserProvider
The current user providerprotected UserPreferencesManager
_userPrefManager
The user preferences managerstatic String
FLASHINFO_USER_PREF_ITEM_IDS
The id of user preference for flash info contents-
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 AbstractItemsAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>
getReadItems(UserIdentity user, String siteName)
Get the ids of read flash infosprotected void
saveReadItems(UserIdentity owner, List<String> itemIds, String siteName)
Save the ids of read items in user preferencesvoid
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
FLASHINFO_USER_PREF_ITEM_IDS
public static final String FLASHINFO_USER_PREF_ITEM_IDS
The id of user preference for flash info contents- See Also:
- Constant Field Values
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider
-
_userPrefManager
protected UserPreferencesManager _userPrefManager
The user preferences manager
-
-
Constructor Detail
-
AbstractItemsAction
public AbstractItemsAction()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
getReadItems
protected List<String> getReadItems(UserIdentity user, String siteName) throws UserPreferencesException
Get the ids of read flash infos- Parameters:
user
- the usersiteName
- the site name- Returns:
- the ids of read contents
- Throws:
UserPreferencesException
- if failed to retrieve user preferences
-
saveReadItems
protected void saveReadItems(UserIdentity owner, List<String> itemIds, String siteName) throws UserPreferencesException
Save the ids of read items in user preferences- Parameters:
owner
- the useritemIds
- the id of read itemssiteName
- the site name- Throws:
UserPreferencesException
- if failed to save user preferences
-
-