Class ContentConsistencyEngine
java.lang.Object
org.ametys.cms.content.consistency.ContentConsistencyEngine
org.ametys.web.content.consistency.ContentConsistencyEngine
- All Implemented Interfaces:
Runnable
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.ContentConsistencyEngine
ContentConsistencyEngine.ContentExistsHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected SiteManager
The site manager.protected String
Name of the site to generate.Fields inherited from class org.ametys.cms.content.consistency.ContentConsistencyEngine
_ametysResolver, _baseUrl, _context, _environmentContext, _i18nUtils, _initialized, _LOGGER, _MAIL_RIGHT, _mailFrom, _manager, _reportDirectory, _rightManager, _sourceResolver, _userManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_dispose()
Dispose of the resources and looked-up components.protected void
_generateReport
(Site site) Generate the full consistency report for a site.protected void
Send all the alerts.Get the report e-mail parameters.protected String
_getMailUri
(Map<String, String> parameters) Get the pipeline uri for mail bodyprotected void
Send a reminder e-mail to all the users who have the right to edit.void
initialize
(ServiceManager manager, Context context, String siteName) Initialize the consistency engine.static boolean
Test if the engine is running at the time.Methods inherited from class org.ametys.cms.content.consistency.ContentConsistencyEngine
_checkInitialization, _generateReport, _getMailPart, _sendMails, configure, initialize, run
-
Field Details
-
_siteManager
The site manager. -
_siteName
Name of the site to generate.
-
-
Constructor Details
-
ContentConsistencyEngine
public ContentConsistencyEngine()
-
-
Method Details
-
initialize
public void initialize(ServiceManager manager, Context context, String siteName) throws ContextException, ServiceException Initialize the consistency engine.- Parameters:
manager
- the avalon service manager.context
- the avalon context.siteName
- the name of the site to generate or null to generate all.- Throws:
ContextException
- if an error occurs retrieving the environment context.ServiceException
- if an error occurs retrieving a component.
-
isRunning
Test if the engine is running at the time.- Parameters:
siteName
- the site name.- Returns:
- true if the engine is running, false otherwise.
-
_dispose
Description copied from class:ContentConsistencyEngine
Dispose of the resources and looked-up components.- Overrides:
_dispose
in classContentConsistencyEngine
-
_generateReports
Description copied from class:ContentConsistencyEngine
Send all the alerts. Can be overridden to add alerts.- Overrides:
_generateReports
in classContentConsistencyEngine
- Throws:
AmetysRepositoryException
- if an error occurs.IOException
- if an error occurred
-
_generateReport
Generate the full consistency report for a site.- Parameters:
site
- the site.- Throws:
IOException
- if an i/o error occurs.
-
_sendErrorEmail
Description copied from class:ContentConsistencyEngine
Send a reminder e-mail to all the users who have the right to edit.- Overrides:
_sendErrorEmail
in classContentConsistencyEngine
- Throws:
IOException
- if an error occurs building or sending the mail.
-
_getMailUri
Description copied from class:ContentConsistencyEngine
Get the pipeline uri for mail body- Overrides:
_getMailUri
in classContentConsistencyEngine
- Parameters:
parameters
- the mail paramters- Returns:
- a pipeline uri
-
_getEmailParams
Description copied from class:ContentConsistencyEngine
Get the report e-mail parameters.- Overrides:
_getEmailParams
in classContentConsistencyEngine
- Returns:
- the e-mail parameters.
-