Class AbstractPageSubscriptionNotifier
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.pagesubscription.notifier.AbstractPageSubscriptionNotifier
- All Implemented Interfaces:
LogEnabled
,ActivityNotifier
,Serviceable
- Direct Known Subclasses:
PageSubscriptionPageDeletedNotifier
,PageSubscriptionPageUpdatedNotifier
,PageSubscriptionResourcesUpdatedNotifier
public abstract class AbstractPageSubscriptionNotifier
extends AbstractLogEnabled
implements ActivityNotifier, Serviceable
Abstract notifier for page activity
-
Field Summary
Modifier and TypeFieldDescriptionprotected I18nUtils
The i18n utilsprotected AmetysObjectResolver
The ametys object resolverprotected PageSubscriptionDAO
The subscription daoprotected UserManager
The user manager -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getAbsolutePageUrl
(Page page) Get the absolute URL of a pageprotected abstract String
_getMailHtmlBody
(Activity activity, Page page, User author) Get the mail bodyprotected abstract I18nizableText
_getMailSubject
(Activity activity, Page page) Get the mail subjectgetMailHtmlBody
(Activity activity) Get the mail body as html from the activitygetMailSubject
(Activity activity) Get the mail subject from the activitygetMailTextBody
(Activity activity) Get the mail body to text format from the activityprotected abstract String
Id of the site parameter to enable/disable the notificationgetUsersEmailToNotify
(Activity activity) Get the list of user email to notify for a given activityprotected boolean
isNotificationEnabled
(Page page) Determines if the notification is currently enabledvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.web.activities.notify.ActivityNotifier
isAsync, support
-
Field Details
-
_resolver
The ametys object resolver -
_i18nUtils
The i18n utils -
_userManager
The user manager -
_subscriptionDAO
The subscription dao
-
-
Constructor Details
-
AbstractPageSubscriptionNotifier
public AbstractPageSubscriptionNotifier()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getUsersEmailToNotify
Description copied from interface:ActivityNotifier
Get the list of user email to notify for a given activity- Specified by:
getUsersEmailToNotify
in interfaceActivityNotifier
- Parameters:
activity
- the activity- Returns:
- the list of user email to notify
-
isNotificationEnabled
Determines if the notification is currently enabled- Parameters:
page
- The page- Returns:
- true if the notification is enabled
-
getSiteParameterId
Id of the site parameter to enable/disable the notification- Returns:
- The id of site
-
getMailSubject
Description copied from interface:ActivityNotifier
Get the mail subject from the activity- Specified by:
getMailSubject
in interfaceActivityNotifier
- Parameters:
activity
- the activity- Returns:
- the mail subject
-
_getMailSubject
Get the mail subject- Parameters:
activity
- the activitypage
- the page from activity- Returns:
- the mail subject
-
getMailTextBody
Description copied from interface:ActivityNotifier
Get the mail body to text format from the activity- Specified by:
getMailTextBody
in interfaceActivityNotifier
- Parameters:
activity
- the activity- Returns:
- the mail body to text format. Can be null.
-
getMailHtmlBody
Description copied from interface:ActivityNotifier
Get the mail body as html from the activity- Specified by:
getMailHtmlBody
in interfaceActivityNotifier
- Parameters:
activity
- the activity- Returns:
- the mail body as html. Can be null.
-
_getMailHtmlBody
protected abstract String _getMailHtmlBody(Activity activity, Page page, User author) throws IOException Get the mail body- Parameters:
activity
- the activitypage
- the page from activityauthor
- the author of the activity- Returns:
- the mail body
- Throws:
IOException
- if an error occurred
-
_getAbsolutePageUrl
Get the absolute URL of a page- Parameters:
page
- The page to retrieve the url- Returns:
- The absolute url of the page
-