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
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
The ametys object resolver.protected String
The server base URL.protected ContentConsistencyManager
The content consistency managerprotected I18nUtils
The i18n utils.protected static final String
The report e-mail will be sent to users who possess this right on the application context.protected String
The content of "from" field in emails.protected File
The report directory.protected RightManager
The rights manager.protected SourceResolver
The 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
-
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.void
execute
(JobExecutionContext context) The action to perform when a trigger is fired.void
void
service
(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, setPluginInfo
Methods 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:
service
in interfaceServiceable
- Overrides:
service
in classAbstractStaticSchedulable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
execute
Description copied from interface:Schedulable
The action to perform when a trigger is fired. Do not manually call this method.- Specified by:
execute
in interfaceSchedulable
- Specified by:
execute
in 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
-