Class ContentConsistencyEngine
- java.lang.Object
-
- org.ametys.cms.content.consistency.ContentConsistencyEngine
-
- org.ametys.web.content.consistency.ContentConsistencyEngine
-
- All Implemented Interfaces:
Runnable
public class ContentConsistencyEngine extends ContentConsistencyEngine
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
Fields Modifier and Type Field Description private static Map<String,Boolean>
_RUNNING_SITES
protected SiteManager
_siteManager
The site manager.protected String
_siteName
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
Constructors Constructor Description ContentConsistencyEngine()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
_generateReports()
Send all the alerts.protected Map<String,String>
_getEmailParams()
Get the report e-mail parameters.protected String
_getMailUri(Map<String,String> parameters)
Get the pipeline uri for mail bodyprotected void
_sendErrorEmail()
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
isRunning(String siteName)
Test if the engine is running at the time.private static void
setRunning(String siteName, boolean running)
Set the running status of a site.-
Methods inherited from class org.ametys.cms.content.consistency.ContentConsistencyEngine
_checkInitialization, _generateReport, _getMailPart, _sendMails, configure, initialize, run
-
-
-
-
Field Detail
-
_RUNNING_SITES
private static Map<String,Boolean> _RUNNING_SITES
-
_siteManager
protected SiteManager _siteManager
The site manager.
-
-
Constructor Detail
-
ContentConsistencyEngine
public ContentConsistencyEngine()
-
-
Method Detail
-
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
public static boolean isRunning(String siteName)
Test if the engine is running at the time.- Parameters:
siteName
- the site name.- Returns:
- true if the engine is running, false otherwise.
-
setRunning
private static void setRunning(String siteName, boolean running)
Set the running status of a site.- Parameters:
siteName
- the site name.running
- true to set the site running, false otherwise.
-
_dispose
protected void _dispose()
Description copied from class:ContentConsistencyEngine
Dispose of the resources and looked-up components.- Overrides:
_dispose
in classContentConsistencyEngine
-
_generateReports
protected void _generateReports() throws AmetysRepositoryException, IOException
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
protected void _generateReport(Site site) throws IOException
Generate the full consistency report for a site.- Parameters:
site
- the site.- Throws:
IOException
- if an i/o error occurs.
-
_sendErrorEmail
protected void _sendErrorEmail() throws IOException
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
protected String _getMailUri(Map<String,String> parameters)
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
protected Map<String,String> _getEmailParams()
Description copied from class:ContentConsistencyEngine
Get the report e-mail parameters.- Overrides:
_getEmailParams
in classContentConsistencyEngine
- Returns:
- the e-mail parameters.
-
-