Package org.ametys.web.alerts
Class AlertSchedulable
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
org.ametys.cms.alerts.AlertSchedulable
org.ametys.web.alerts.AlertSchedulable
- All Implemented Interfaces:
Schedulable
,LogEnabled
,PluginAware
,Initializable
,Component
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
AlertSchedulable
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.AlertSchedulable
AlertSchedulable.BinaryExpression
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
AbstractStaticSchedulable.SchedulableParameterParser
-
Field Summary
Modifier 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.AlertSchedulable
__VALIDATION_ALERT_EXPR_CONTEXT, _awaitingValidationBody, _awaitingValidationRights, _awaitingValidationSubject, _baseUrl, _environmentContext, _i18nUtils, _initialized, _instantAlertBody, _instantAlertRights, _instantAlertSubject, _mailFrom, _manager, _reminderBody, _reminderRights, _reminderSubject, _resolver, _rightManager, _scheduledArchivingReminderBody, _scheduledArchivingReminderRights, _scheduledArchivingReminderSubject, _unmodifiedContentBody, _unmodifiedContentRights, _unmodifiedContentStepIds, _unmodifiedContentSubject, JOBDATAMAP_CONTENT_IDS_KEY, JOBDATAMAP_INSTANT_MODE_KEY, JOBDATAMAP_MESSAGE_KEY, SCHEDULABLE_ID
Fields inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
_acceptConcurrentExecution, _context, _description, _iconGlyph, _iconLarge, _iconMedium, _iconSmall, _id, _label, _parameters, _pluginName, _private, _schedulableParameterTypeExtensionPoint, _smanager, _userManager
-
Constructor Summary
-
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 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).void
execute
(JobExecutionContext context) Send all the alerts.protected String
getI18nKeyBody
(String bodyI18nKey, Content content) Get the transform i18n body key for specific contentMethods inherited from class org.ametys.cms.alerts.AlertSchedulable
_getAwaitingValidationParams, _getInstantAlertParams, _getReminderParams, _getRightsFromConf, _getScheduledArchivingReminderParams, _getUnmodifiedContentParams, _removeTimeParts, _sendAwaitingValidationAlerts, _sendAwaitingValidationEmail, _sendInstantAlertEmail, _sendInstantAlerts, _sendMails, _sendReminderEmail, _sendReminders, _sendScheduledArchivingReminderEmail, _sendScheduledArchivingReminders, _sendUnmodifiedAlerts, _sendUnmodifiedContentEmail, initialize, isInstantMode, service
Methods inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
acceptConcurrentExecution, contextualize, getDescription, getIconGlyph, getIconLarge, getIconMedium, getIconSmall, getId, getLabel, getParameters, isPrivate, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
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
-
AlertSchedulable
public AlertSchedulable()
-
-
Method Details
-
configure
Description copied from class:AlertSchedulable
Configure the engine (called by the scheduler).- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classAlertSchedulable
- Parameters:
configuration
- the component configuration.- Throws:
ConfigurationException
- if the configuration is not valid
-
execute
Description copied from class:AlertSchedulable
Send all the alerts. Can be overridden to add alerts.- Specified by:
execute
in interfaceSchedulable
- Overrides:
execute
in classAlertSchedulable
- Parameters:
context
- the context- Throws:
Exception
- if an error occured
-
_setRequestAttributes
Description copied from class:AlertSchedulable
Set the necessary request attributes- Overrides:
_setRequestAttributes
in classAlertSchedulable
- 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:AlertSchedulable
Get the transform i18n body key for specific content- Overrides:
getI18nKeyBody
in classAlertSchedulable
- Parameters:
bodyI18nKey
- the original body keycontent
- the content- Returns:
- the transform i18n body key
-
_getAdditionalParams
Description copied from class:AlertSchedulable
Get the additional i18n parameters for content- Overrides:
_getAdditionalParams
in classAlertSchedulable
- 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:AlertSchedulable
Get the URL to the given content tool.- Overrides:
_getContentUrl
in classAlertSchedulable
- 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.
-