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
Modifier and TypeClassDescriptionprotected class
Handler which tests if exists a "/contents/content" tag.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 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 TypeMethodDescriptionprotected void
Generate the full consistency report.Get the report e-mail parameters.protected String
_getMailPart
(Map<String, String> parameters) Get a mail part.protected I18nizableText
_getMailSubject
(Map<String, String> parameters) Retrieves the mail's subjectprotected String
_getMailUri
(Map<String, String> parameters) Get the pipeline uri for mail bodyprotected File
Retrieves the directory where to generate the reportprotected String
Retrieves the URL of the source to resolve to generate the reportprotected void
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) 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.
-
-
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
-
_generateReport
Generate the full consistency report.- Throws:
IOException
- if an i/o error occurs.
-
_getReportDirectory
Retrieves the directory where to generate the report- Returns:
- the directory where to generate the report
-
_getReportURL
Retrieves the URL of the source to resolve to generate the report- Returns:
- the URL of the source to resolve to generate the report
-
_sendErrorEmail
Send a reminder e-mail to all the users who have the right to edit.- 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
-
_getMailPart
Get a mail part.- Parameters:
parameters
- the mail parameters.- Returns:
- the mail part.
- Throws:
IOException
- if an error occurred
-
_getMailUri
Get the pipeline uri for mail body- Parameters:
parameters
- the mail paramters- Returns:
- a pipeline uri
-
_getEmailParams
Get the report e-mail parameters.- Returns:
- the e-mail parameters.
-
_sendMails
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.
-