Class PageNotificationsHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.pagesubscription.notification.PageNotificationsHelper
- All Implemented Interfaces:
LogEnabled
,Initializable
,Component
,Serviceable
public class PageNotificationsHelper
extends AbstractLogEnabled
implements Component, Serviceable, Initializable
Helper for page notifications
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActivityTypeExtensionPoint
The activity extension pointprotected AbstractCacheManager
The cache managerprotected CurrentUserProvider
The current user providerprotected AmetysObjectResolver
The ametys object resolverprotected SiteManager
The site managerprotected SubscriptionTypeExtensionPoint
The subscription type extension pointprotected UserHelper
The user helperstatic final String
The avalon role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearCache
(String siteName, String pageId) Clear page subscription cachegetLastActivity
(String siteName, String pageId, FrequencyHelper.Frequency frequency) Get the last page activitygetUnreadPages
(String siteName) Get the unread page notifications for each subscription of the current uservoid
void
markPageAsRead
(String pageId) Mark page as read for the current uservoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon role -
_resolver
The ametys object resolver -
_siteManager
The site manager -
_subscriptionTypeEP
The subscription type extension point -
_currentUserProvider
The current user provider -
_userHelper
The user helper -
_cacheManager
The cache manager -
_activityTypeEP
The activity extension point
-
-
Constructor Details
-
PageNotificationsHelper
public PageNotificationsHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getUnreadPages
Get the unread page notifications for each subscription of the current user- Parameters:
siteName
- the site name- Returns:
- the unread page notifications
-
getLastActivity
public Activity getLastActivity(String siteName, String pageId, FrequencyHelper.Frequency frequency) Get the last page activity- Parameters:
siteName
- the site namepageId
- the pagefrequency
- the frequency- Returns:
- the last page activity
-
markPageAsRead
Mark page as read for the current user- Parameters:
pageId
- the page id
-
clearCache
Clear page subscription cache- Parameters:
siteName
- the site namepageId
- the page id
-