Class CheckContentConsistencySchedulable
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
org.ametys.cms.content.consistency.CheckContentConsistencySchedulable
- All Implemented Interfaces:
Schedulable,LogEnabled,PluginAware,Initializable,Component,Configurable,Contextualizable,Serviceable
- Direct Known Subclasses:
CheckContentConsistencySchedulable
public class CheckContentConsistencySchedulable
extends AbstractStaticSchedulable
implements Initializable
Content consistency schedulable: generate consistency information for all contents.
Sends a report e-mail if there are inconsistencies.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
AbstractStaticSchedulable.SchedulableParameterParser -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AmetysObjectResolverThe ametys object resolver.protected StringThe server base URL.protected ContentConsistencyManagerThe content consistency managerprotected I18nUtilsThe i18n utils.protected static final StringThe report e-mail will be sent to users who possess this right on the application context.protected StringThe content of "from" field in emails.protected FileThe report directory.protected RightManagerThe rights manager.protected SourceResolverThe avalon source resolver.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
Constructors -
Method Summary
Modifier and TypeMethodDescription_getEmailParams(List<String> errorResults, List<String> unchecked) Get the report e-mail parameters.protected I18nizableText_getMailBody(Map<String, String> params) Retrieves the mail's bodyprotected I18nizableText_getMailSubject(Map<String, String> parameters) Retrieves the mail's subjectprotected void_sendEmail(List<String> errorId, List<String> unchecked) Send a reminder e-mail to all the users who have the right to edit.protected void_sendMails(String subject, String body, Set<UserIdentity> users, String from, Source attachement) Send the alert emails.voidexecute(JobExecutionContext context) The action to perform when a trigger is fired.voidvoidservice(ServiceManager manager) Methods inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
acceptConcurrentExecution, configure, contextualize, getDescription, getIconGlyph, getIconLarge, getIconMedium, getIconSmall, getId, getLabel, getParameters, isPrivate, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_MAIL_RIGHT
The report e-mail will be sent to users who possess this right on the application context.- See Also:
-
_baseUrl
The server base URL. -
_reportDirectory
The report directory. -
_ametysResolver
The ametys object resolver. -
_sourceResolver
The avalon source resolver. -
_rightManager
The rights manager. -
_i18nUtils
The i18n utils. -
_mailFrom
The content of "from" field in emails. -
_contentConsistencyManager
The content consistency manager
-
-
Constructor Details
-
CheckContentConsistencySchedulable
public CheckContentConsistencySchedulable()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractStaticSchedulable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
execute
Description copied from interface:SchedulableThe action to perform when a trigger is fired. Do not manually call this method.- Specified by:
executein interfaceSchedulable- Specified by:
executein classAbstractStaticSchedulable- Parameters:
context- the context- Throws:
Exception- if an error occured
-
_sendEmail
Send a reminder e-mail to all the users who have the right to edit.- Parameters:
errorId- the list of results with errorunchecked- the list of content that couldn't be checked- Throws:
IOException- if an error occurs building or sending the mail.
-
_getMailSubject
Retrieves the mail's subject- Parameters:
parameters- the mail parameters.- Returns:
- the mail's subject
-
_getMailBody
Retrieves the mail's body- Parameters:
params- the i18n parameters- Returns:
- the mail's body
-
_getEmailParams
Get the report e-mail parameters.- Parameters:
unchecked- the list of unchecked content iderrorResults- the list of error results- Returns:
- the e-mail parameters.
-
_sendMails
protected void _sendMails(String subject, String body, Set<UserIdentity> users, String from, Source attachement) Send the alert emails.- Parameters:
subject- the e-mail subject.body- the e-mail body.users- users to send the mail to.from- the address sending the e-mail.attachement- the
-