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
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
FieldsModifier and TypeFieldDescriptionprotected boolean
True if the alert of page publication ending is enabledprotected String
The "page nearing end of publication" e-mail body i18n key.The "page nearing end of publication" e-mail will be sent to users that have this right.protected String
The "page nearing end of publication" e-mail subject i18n key.Fields inherited from class org.ametys.cms.alerts.AlertEngine
__VALIDATION_ALERT_EXPR_CONTEXT, _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
ConstructorsConstructorDescriptionDefault constructorAlertEngine
(List<String> contentIds, String message) Constructor used to send instant alerts -
Method Summary
Modifier and TypeMethodDescription_getAdditionalParams
(Content content) Get the additional i18n parameters for contentprotected String
_getContentUrl
(Content content) Get the URL to the given content tool.protected Page
Get the page referenced by this contentGet 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
Get the site nameprotected void
Send all the alerts.protected void
Send the "page nearing end of publication" alerts.protected void
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 attributesvoid
configure
(Configuration configuration) Configure the engine (called by the scheduler).protected String
getI18nKeyBody
(String bodyI18nKey, Content content) Get the transform i18n body key for specific contentMethods 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 Details
-
_pagePublicationEnabled
True if the alert of page publication ending is enabled -
_pagePublicationEndRights
The "page nearing end of publication" e-mail will be sent to users that have this right. -
_pagePublicationEndSubject
The "page nearing end of publication" e-mail subject i18n key. -
_pagePublicationEndBody
The "page nearing end of publication" e-mail body i18n key.
-
-
Constructor Details
-
AlertEngine
public AlertEngine()Default constructor -
AlertEngine
Constructor used to send instant alerts- Parameters:
contentIds
- The content's idmessage
- the message
-
-
Method Details
-
configure
Description copied from class:AlertEngine
Configure the engine (called by the scheduler).- Overrides:
configure
in classAlertEngine
- Parameters:
configuration
- the component configuration.- Throws:
ConfigurationException
- if the configuration is not valid
-
_sendAlerts
Description copied from class:AlertEngine
Send all the alerts. Can be overridden to add alerts.- Overrides:
_sendAlerts
in classAlertEngine
- Throws:
AmetysRepositoryException
- if an error occurs.
-
_setRequestAttributes
Description copied from class:AlertEngine
Set the necessary request attributes- Overrides:
_setRequestAttributes
in classAlertEngine
- Parameters:
content
- The content
-
_setRequestAttributes
Set the necessary request attributes- Parameters:
page
- The concerned page
-
_sendPagePublicationEndAlerts
Send the "page nearing end of publication" alerts.- Throws:
AmetysRepositoryException
- if an error occurs.
-
_sendPagePublicationEndEmail
Send the "page publication end" alert e-mail.- Parameters:
page
- the page nearing publication end.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getI18nKeyBody
Description copied from class:AlertEngine
Get the transform i18n body key for specific content- Overrides:
getI18nKeyBody
in classAlertEngine
- Parameters:
bodyI18nKey
- the original body keycontent
- the content- Returns:
- the transform i18n body key
-
_getAdditionalParams
Description copied from class:AlertEngine
Get the additional i18n parameters for content- Overrides:
_getAdditionalParams
in classAlertEngine
- Parameters:
content
- The content- Returns:
- The additional i18n parameters
-
_getPagePublicationEndParams
Get the "page nearing end of publication" mail parameters.- Parameters:
page
- the page.- Returns:
- the mail parameters.
-
_getContentUrl
Description copied from class:AlertEngine
Get the URL to the given content tool.- Overrides:
_getContentUrl
in classAlertEngine
- Parameters:
content
- the content.- Returns:
- the content URL.
-
_getPageUrl
Get the URL of the back-office, opening on the page tool.- Parameters:
page
- the page to link to.- Returns:
- the page URL.
-
_getSite
Get the site name- Parameters:
content
- The content- Returns:
- the site name
-
_getPage
Get the page referenced by this content- Parameters:
content
- The contentsite
- the site- Returns:
- the page or null.
-