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 ActivityTypeExtensionPointThe activity extension pointprotected AbstractCacheManagerThe cache managerprotected CurrentUserProviderThe current user providerprotected AmetysObjectResolverThe ametys object resolverprotected SiteManagerThe site managerprotected SubscriptionTypeExtensionPointThe subscription type extension pointprotected UserHelperThe user helperstatic final StringThe avalon role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearCache(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 uservoidvoidmarkPageAsRead(String pageId) Mark page as read for the current uservoidservice(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:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
- Specified by:
initializein 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
-