Class CheckContentConsistencySchedulable
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
-
- org.ametys.cms.content.consistency.CheckContentConsistencySchedulable
-
- org.ametys.web.content.consistency.CheckContentConsistencySchedulable
-
- All Implemented Interfaces:
Schedulable
,LogEnabled
,PluginAware
,Initializable
,Component
,Configurable
,Contextualizable
,Serviceable
public class CheckContentConsistencySchedulable extends CheckContentConsistencySchedulable
Content consistency engine: 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.cms.content.consistency.CheckContentConsistencySchedulable
CheckContentConsistencySchedulable.ContentExistsHandler
-
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
AbstractStaticSchedulable.SchedulableParameterParser
-
-
Field Summary
Fields Modifier and Type Field Description protected JSONUtils
_jsonUtils
The utils for JSONprotected SiteManager
_siteManager
The site manager.static String
SITE_NAME_KEY
The key for the name of the site containing the contents to check-
Fields inherited from class org.ametys.cms.content.consistency.CheckContentConsistencySchedulable
_ametysResolver, _baseUrl, _i18nUtils, _MAIL_RIGHT, _mailFrom, _reportDirectory, _rightManager, _sourceResolver
-
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 Constructor Description CheckContentConsistencySchedulable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
_getCurrentSiteName()
Retrieves the current site nameprotected Map<String,String>
_getEmailParams()
Get the report e-mail parameters.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
_getReportDirectory()
Retrieves the directory where to generate the reportprotected String
_getReportURL()
Retrieves the URL of the source to resolve to generate the reportprotected List<String>
_getSiteName(String siteAsMap)
Retrieves the names of the sites from given parametersvoid
execute(JobExecutionContext context)
The action to perform when a trigger is fired.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.cms.content.consistency.CheckContentConsistencySchedulable
_generateReport, _getMailPart, _sendErrorEmail, _sendMails, initialize
-
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 Detail
-
SITE_NAME_KEY
public static final String SITE_NAME_KEY
The key for the name of the site containing the contents to check- See Also:
- Constant Field Values
-
_jsonUtils
protected JSONUtils _jsonUtils
The utils for JSON
-
_siteManager
protected SiteManager _siteManager
The site manager.
-
-
Constructor Detail
-
CheckContentConsistencySchedulable
public CheckContentConsistencySchedulable()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classCheckContentConsistencySchedulable
- Throws:
ServiceException
-
execute
public void execute(JobExecutionContext context) throws Exception
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
- Overrides:
execute
in classCheckContentConsistencySchedulable
- Parameters:
context
- the context- Throws:
Exception
- if an error occured
-
_getReportDirectory
protected File _getReportDirectory()
Description copied from class:CheckContentConsistencySchedulable
Retrieves the directory where to generate the report- Overrides:
_getReportDirectory
in classCheckContentConsistencySchedulable
- Returns:
- the directory where to generate the report
-
_getReportURL
protected String _getReportURL()
Description copied from class:CheckContentConsistencySchedulable
Retrieves the URL of the source to resolve to generate the report- Overrides:
_getReportURL
in classCheckContentConsistencySchedulable
- Returns:
- the URL of the source to resolve to generate the report
-
_getMailSubject
protected I18nizableText _getMailSubject(Map<String,String> parameters)
Description copied from class:CheckContentConsistencySchedulable
Retrieves the mail's subject- Overrides:
_getMailSubject
in classCheckContentConsistencySchedulable
- Parameters:
parameters
- the mail parameters.- Returns:
- the mail's subject
-
_getMailUri
protected String _getMailUri(Map<String,String> parameters)
Description copied from class:CheckContentConsistencySchedulable
Get the pipeline uri for mail body- Overrides:
_getMailUri
in classCheckContentConsistencySchedulable
- Parameters:
parameters
- the mail paramters- Returns:
- a pipeline uri
-
_getEmailParams
protected Map<String,String> _getEmailParams()
Description copied from class:CheckContentConsistencySchedulable
Get the report e-mail parameters.- Overrides:
_getEmailParams
in classCheckContentConsistencySchedulable
- Returns:
- the e-mail parameters.
-
_getSiteName
protected List<String> _getSiteName(String siteAsMap)
Retrieves the names of the sites from given parameters- Parameters:
siteAsMap
- JSONMap
containing the sites names- Returns:
- the names of the sites
-
_getCurrentSiteName
protected String _getCurrentSiteName()
Retrieves the current site name- Returns:
- the current site name
-
-