Package org.ametys.web.alerts
Class AlertEngine
- java.lang.Object
-
- org.ametys.cms.alerts.AlertEngine
-
- org.ametys.web.alerts.AlertEngine
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
AlertEngine
public class AlertEngine extends AlertEngine
Alerts engine: sends alerts mail. This is the web version of the engine: it sets the currently processed content's site name in the request object, and sends additional site and page information in the alerts e-mails.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ametys.cms.alerts.AlertEngine
AlertEngine.BinaryExpression
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_pagePublicationEnabledTrue if the alert of page publication ending is enabledprotected String_pagePublicationEndBodyThe "page nearing end of publication" e-mail body i18n key.protected Set<String>_pagePublicationEndRightsThe "page nearing end of publication" e-mail will be sent to users that have this right.protected String_pagePublicationEndSubjectThe "page nearing end of publication" e-mail subject i18n key.-
Fields inherited from class org.ametys.cms.alerts.AlertEngine
_ametysResolver, _awaitingValidationBody, _awaitingValidationRights, _awaitingValidationSubject, _baseUrl, _context, _environmentContext, _i18nUtils, _initialized, _instantAlertBody, _instantAlertRights, _instantAlertSubject, _instantMode, _LOGGER, _mailFrom, _manager, _reminderBody, _reminderRights, _reminderSubject, _rightManager, _scheduledArchivingReminderBody, _scheduledArchivingReminderRights, _scheduledArchivingReminderSubject, _unmodifiedContentBody, _unmodifiedContentRights, _unmodifiedContentStepIds, _unmodifiedContentSubject, _userManager
-
-
Constructor Summary
Constructors Constructor Description AlertEngine()Default constructorAlertEngine(List<String> contentIds, String message)Constructor used to send instant alerts
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>_getAdditionalParams(Content content)Get the additional i18n parameters for contentprotected String_getContentUrl(Content content)Get the URL to the given content tool.protected Page_getPage(Content content, Site site)Get the page referenced by this contentprotected List<String>_getPagePublicationEndParams(Page page)Get the "page nearing end of publication" mail parameters.protected String_getPageUrl(Page page)Get the URL of the back-office, opening on the page tool.protected Site_getSite(Content content)Get the site nameprotected void_sendAlerts()Send all the alerts.protected void_sendPagePublicationEndAlerts()Send the "page nearing end of publication" alerts.protected void_sendPagePublicationEndEmail(Page page)Send the "page publication end" alert e-mail.protected void_setRequestAttributes(Content content)Set the necessary request attributesprotected void_setRequestAttributes(Page page)Set the necessary request attributesvoidconfigure(Configuration configuration)Configure the engine (called by the scheduler).protected StringgetI18nKeyBody(String bodyI18nKey, Content content)Get the transform i18n body key for specific content-
Methods inherited from class org.ametys.cms.alerts.AlertEngine
_checkInitialization, _dispose, _getAwaitingValidationParams, _getInstantAlertParams, _getReminderParams, _getRightsFromConf, _getScheduledArchivingReminderParams, _getUnmodifiedContentParams, _removeTimeParts, _sendAwaitingValidationAlerts, _sendAwaitingValidationEmail, _sendInstantAlertEmail, _sendInstantAlerts, _sendMails, _sendReminderEmail, _sendReminders, _sendScheduledArchivingReminderEmail, _sendScheduledArchivingReminders, _sendUnmodifiedAlerts, _sendUnmodifiedContentEmail, initialize, run
-
-
-
-
Field Detail
-
_pagePublicationEnabled
protected boolean _pagePublicationEnabled
True if the alert of page publication ending is enabled
-
_pagePublicationEndRights
protected Set<String> _pagePublicationEndRights
The "page nearing end of publication" e-mail will be sent to users that have this right.
-
_pagePublicationEndSubject
protected String _pagePublicationEndSubject
The "page nearing end of publication" e-mail subject i18n key.
-
_pagePublicationEndBody
protected String _pagePublicationEndBody
The "page nearing end of publication" e-mail body i18n key.
-
-
Constructor Detail
-
AlertEngine
public AlertEngine()
Default constructor
-
AlertEngine
public AlertEngine(List<String> contentIds, String message)
Constructor used to send instant alerts- Parameters:
contentIds- The content's idmessage- the message
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
Description copied from class:AlertEngineConfigure the engine (called by the scheduler).- Overrides:
configurein classAlertEngine- Parameters:
configuration- the component configuration.- Throws:
ConfigurationException- if the configuration is not valid
-
_sendAlerts
protected void _sendAlerts() throws AmetysRepositoryException
Description copied from class:AlertEngineSend all the alerts. Can be overridden to add alerts.- Overrides:
_sendAlertsin classAlertEngine- Throws:
AmetysRepositoryException- if an error occurs.
-
_setRequestAttributes
protected void _setRequestAttributes(Content content)
Description copied from class:AlertEngineSet the necessary request attributes- Overrides:
_setRequestAttributesin classAlertEngine- Parameters:
content- The content
-
_setRequestAttributes
protected void _setRequestAttributes(Page page)
Set the necessary request attributes- Parameters:
page- The concerned page
-
_sendPagePublicationEndAlerts
protected void _sendPagePublicationEndAlerts() throws AmetysRepositoryException
Send the "page nearing end of publication" alerts.- Throws:
AmetysRepositoryException- if an error occurs.
-
_sendPagePublicationEndEmail
protected void _sendPagePublicationEndEmail(Page page) throws AmetysRepositoryException
Send the "page publication end" alert e-mail.- Parameters:
page- the page nearing publication end.- Throws:
AmetysRepositoryException- if an error occurs.
-
getI18nKeyBody
protected String getI18nKeyBody(String bodyI18nKey, Content content)
Description copied from class:AlertEngineGet the transform i18n body key for specific content- Overrides:
getI18nKeyBodyin classAlertEngine- Parameters:
bodyI18nKey- the original body keycontent- the content- Returns:
- the transform i18n body key
-
_getAdditionalParams
protected List<String> _getAdditionalParams(Content content)
Description copied from class:AlertEngineGet the additional i18n parameters for content- Overrides:
_getAdditionalParamsin classAlertEngine- Parameters:
content- The content- Returns:
- The additional i18n parameters
-
_getPagePublicationEndParams
protected List<String> _getPagePublicationEndParams(Page page)
Get the "page nearing end of publication" mail parameters.- Parameters:
page- the page.- Returns:
- the mail parameters.
-
_getContentUrl
protected String _getContentUrl(Content content)
Description copied from class:AlertEngineGet the URL to the given content tool.- Overrides:
_getContentUrlin classAlertEngine- Parameters:
content- the content.- Returns:
- the content URL.
-
_getPageUrl
protected String _getPageUrl(Page page)
Get the URL of the back-office, opening on the page tool.- Parameters:
page- the page to link to.- Returns:
- the page URL.
-
_getSite
protected Site _getSite(Content content)
Get the site name- Parameters:
content- The content- Returns:
- the site name
-
-