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.BinaryExpressionNested classes/interfaces inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
AbstractStaticSchedulable.SchedulableParameterParser -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanTrue if the alert of page publication ending is enabledprotected StringThe "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 StringThe "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_IDFields 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
Constructors -
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 PageGet 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 SiteGet the site nameprotected voidSend the "page nearing end of publication" alerts.protected voidSend 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).voidexecute(JobExecutionContext context) Send all the alerts.protected StringgetI18nKeyBody(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, serviceMethods inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
acceptConcurrentExecution, contextualize, getDescription, getIconGlyph, getIconLarge, getIconMedium, getIconSmall, getId, getLabel, getParameters, isPrivate, setPluginInfoMethods 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:AlertSchedulableConfigure the engine (called by the scheduler).- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classAlertSchedulable- Parameters:
configuration- the component configuration.- Throws:
ConfigurationException- if the configuration is not valid
-
execute
Description copied from class:AlertSchedulableSend all the alerts. Can be overridden to add alerts.- Specified by:
executein interfaceSchedulable- Overrides:
executein classAlertSchedulable- Parameters:
context- the context- Throws:
Exception- if an error occured
-
_setRequestAttributes
Description copied from class:AlertSchedulableSet the necessary request attributes- Overrides:
_setRequestAttributesin 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:AlertSchedulableGet the transform i18n body key for specific content- Overrides:
getI18nKeyBodyin classAlertSchedulable- Parameters:
bodyI18nKey- the original body keycontent- the content- Returns:
- the transform i18n body key
-
_getAdditionalParams
Description copied from class:AlertSchedulableGet the additional i18n parameters for content- Overrides:
_getAdditionalParamsin 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:AlertSchedulableGet the URL to the given content tool.- Overrides:
_getContentUrlin 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.
-