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 I18nUtils
The i18n utilsprotected AmetysObjectResolver
The ametys object resolverprotected PageSubscriptionDAO
The subscription daoprotected UserLanguagesManager
The user languages managerprotected UserManager
The 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 String
Id 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 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
-
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:
service
in interfaceServiceable
- Throws:
ServiceException
-
getUsersToNotifyByLanguage
Description copied from interface:ActivityNotifier
Get the list of user email to notify by their language for a given activity- Specified by:
getUsersToNotifyByLanguage
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 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:ActivityNotifier
Get the mail body to text format from the activity- Specified by:
getMailTextBody
in 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:ActivityNotifier
Get the mail body as html from the activity- Specified by:
getMailHtmlBody
in 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
-