Class AbstractPageSubscriptionNotifier
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.pagesubscription.page.notifier.AbstractPageSubscriptionNotifier
- All Implemented Interfaces:
LogEnabled,Supporter<ActivityType>,ActivityNotifier,Serviceable
- Direct Known Subclasses:
PageSubscriptionPageDeletedNotifier,PageSubscriptionPageUpdatedNotifier,PageSubscriptionResourcesUpdatedNotifier
public abstract class AbstractPageSubscriptionNotifier
extends AbstractLogEnabled
implements ActivityNotifier, Serviceable
Abstract notifier for page activity
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected I18nUtilsThe i18n utilsprotected AmetysObjectResolverThe ametys object resolverprotected PageSubscriptionDAOThe subscription daoprotected UserLanguagesManagerThe user languages managerprotected UserManagerThe user manager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String_getAbsolutePageUrl(Page page) Get the absolute URL of a pageprotected abstract String_getMailHtmlBody(Activity activity, String language, Page page, User author) Get the mail bodyprotected abstract I18nizableText_getMailSubject(Activity activity, Page page) Get the mail subjectgetMailHtmlBody(Activity activity, String language) Get the mail body as html from the activitygetMailSubject(Activity activity, String language) Get the mail subject from the activitygetMailTextBody(Activity activity, String language) Get the mail body to text format from the activityprotected abstract StringId of the site parameter to enable/disable the notificationgetUsersToNotifyByLanguage(Activity activity) Get the list of user email to notify by their language for a given activityprotected booleanisNotificationEnabled(Page page) Determines if the notification is currently enabledvoidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.web.activities.notify.ActivityNotifier
isAsync
-
Field Details
-
_resolver
The ametys object resolver -
_i18nUtils
The i18n utils -
_userManager
The user manager -
_subscriptionDAO
The subscription dao -
_userLanguagesManager
The user languages manager
-
-
Constructor Details
-
AbstractPageSubscriptionNotifier
public AbstractPageSubscriptionNotifier()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getUsersToNotifyByLanguage
Description copied from interface:ActivityNotifierGet the list of user email to notify by their language for a given activity- Specified by:
getUsersToNotifyByLanguagein 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:ActivityNotifierGet the mail subject from the activity- Specified by:
getMailSubjectin interfaceActivityNotifier- Parameters:
activity- the activitylanguage- The language to use, can be null- 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:ActivityNotifierGet the mail body to text format from the activity- Specified by:
getMailTextBodyin interfaceActivityNotifier- Parameters:
activity- the activitylanguage- The language to use, can be null- Returns:
- the mail body to text format. Can be null.
-
getMailHtmlBody
Description copied from interface:ActivityNotifierGet the mail body as html from the activity- Specified by:
getMailHtmlBodyin interfaceActivityNotifier- Parameters:
activity- the activitylanguage- The language to use, can be null- Returns:
- the mail body as html. Can be null.
-
_getMailHtmlBody
protected abstract String _getMailHtmlBody(Activity activity, String language, Page page, User author) throws IOException Get the mail body- Parameters:
activity- the activitylanguage- The languagepage- 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
-