Class DuplicateContentsDetectionSchedulable
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
org.ametys.cms.schedule.AbstractSendingMailSchedulable
org.ametys.cms.duplicate.contents.DuplicateContentsDetectionSchedulable
- All Implemented Interfaces:
Schedulable,LogEnabled,PluginAware,Initializable,Component,Configurable,Contextualizable,Serviceable
- Direct Known Subclasses:
DuplicateContentsDetectionSchedulable
A
Schedulable job for detecting duplicates.-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
AbstractStaticSchedulable.SchedulableParameterParser -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe server base URL.protected ContentTypesHelperThe content types helperprotected ContentTypeExtensionPointThe content type extension pointprotected DuplicateContentsManagerThe duplicates managerFields inherited from class org.ametys.cms.schedule.AbstractSendingMailSchedulable
_currentUserProvider, _i18nUtils, _mailSender, _sysadminMail, _userHelperFields inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
_acceptConcurrentExecution, _context, _description, _iconGlyph, _iconLarge, _iconMedium, _iconSmall, _id, _label, _parameters, _pluginName, _private, _schedulableParameterTypeExtensionPoint, _smanager, _startTime, _userManager, PROGRESSION_TRACKER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String_createBody(Map<Content, List<Content>> duplicatesMap, Map<Content, List<Content>> nearDuplicatesMap, Map<Content, DuplicateContentsManager.Status> tooComplexMap, boolean hasErrors) Create the body of the emailprotected String_displayContents(Map<Content, List<Content>> duplicatesMap, Map<Content, List<Content>> nearDuplicatesMap, Map<Content, DuplicateContentsManager.Status> tooComplexMap) Create StringBuilder used to display contentsprotected StringBuilder_displayDuplicateContent(Map<Content, List<Content>> duplicatesMap, Map<Content, List<Content>> nearDuplicatesMap, Map<Content, DuplicateContentsManager.Status> tooComplexMap, Content content) Create StringBuilder used to display a contentprotected void_doExecute(JobExecutionContext context, ContainerProgressionTracker progressionTracker) Executes the schedulable.protected String_getErrorMailBody(JobExecutionContext context, Throwable throwable) Retrieves the body of the error mailprotected I18nizableText_getErrorMailSubject(JobExecutionContext context) Retrieves the subject of the error mailprotected String_getSuccessMailBody(JobExecutionContext context) Retrieves the body of the success mailprotected I18nizableTextRetrieves the subject of the success mailprotected boolean_isMailBodyInHTML(JobExecutionContext context) Determines if the mail body is in HTMLprotected String_renderCmsToolLink(Content content) Render the cms tool linkprotected String_renderContentTitle(Content content) Render the content titlevoidvoidservice(ServiceManager manager) Methods inherited from class org.ametys.cms.schedule.AbstractSendingMailSchedulable
_getRecipient, _sendMail, executeMethods inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
acceptConcurrentExecution, configure, contextualize, getDescription, getIconGlyph, getIconLarge, getIconMedium, getIconSmall, getId, getLabel, getParameters, getProgressionTracker, isPrivate, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_duplicatesManager
The duplicates manager -
_baseUrl
The server base URL. -
_contentTypesHelper
The content types helper -
_cTypeEP
The content type extension point
-
-
Constructor Details
-
DuplicateContentsDetectionSchedulable
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSendingMailSchedulable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Overrides:
initializein classAbstractSendingMailSchedulable- Throws:
Exception
-
_doExecute
protected void _doExecute(JobExecutionContext context, ContainerProgressionTracker progressionTracker) throws Exception Description copied from class:AbstractSendingMailSchedulableExecutes the schedulable.- Specified by:
_doExecutein classAbstractSendingMailSchedulable- Parameters:
context- the contextprogressionTracker- The progression tracker- Throws:
Exception- if an error occurred
-
_getSuccessMailSubject
Description copied from class:AbstractSendingMailSchedulableRetrieves the subject of the success mail- Specified by:
_getSuccessMailSubjectin classAbstractSendingMailSchedulable- Parameters:
context- the context- Returns:
- the subject of the success mail
- Throws:
Exception- If an error occurs while building the mail subject
-
_isMailBodyInHTML
Description copied from class:AbstractSendingMailSchedulableDetermines if the mail body is in HTML- Overrides:
_isMailBodyInHTMLin classAbstractSendingMailSchedulable- Parameters:
context- the context- Returns:
trueif the mail body is in HTML,falseotherwise
-
_getSuccessMailBody
Description copied from class:AbstractSendingMailSchedulableRetrieves the body of the success mail- Specified by:
_getSuccessMailBodyin classAbstractSendingMailSchedulable- Parameters:
context- the context- Returns:
- the body of the success mail
- Throws:
Exception- If an error occurs while building the mail body
-
_createBody
protected String _createBody(Map<Content, List<Content>> duplicatesMap, Map<Content, throws IOExceptionList<Content>> nearDuplicatesMap, Map<Content, DuplicateContentsManager.Status> tooComplexMap, boolean hasErrors) Create the body of the email- Parameters:
duplicatesMap- map linking a content to his duplicatesnearDuplicatesMap- map linking a content to his near duplicatestooComplexMap- map linking a content to his search status (used to know if a query failed because the fuzzy query was too complex for example)hasErrors- true if the configuration have some errors- Returns:
- the body
- Throws:
IOException- if failed to build HTML email body for report
-
_displayContents
protected String _displayContents(Map<Content, List<Content>> duplicatesMap, Map<Content, List<Content>> nearDuplicatesMap, Map<Content, DuplicateContentsManager.Status> tooComplexMap) Create StringBuilder used to display contents- Parameters:
duplicatesMap- map linking a content to his duplicatesnearDuplicatesMap- map linking a content to his near duplicatestooComplexMap- map linking a content to his search status (used to know if a query failed because the fuzzy query was too complex for example)- Returns:
- the StringBuilder used to display contents
-
_displayDuplicateContent
protected StringBuilder _displayDuplicateContent(Map<Content, List<Content>> duplicatesMap, Map<Content, List<Content>> nearDuplicatesMap, Map<Content, DuplicateContentsManager.Status> tooComplexMap, Content content) Create StringBuilder used to display a content- Parameters:
duplicatesMap- map linking a content to his duplicatesnearDuplicatesMap- map linking a content to his near duplicatestooComplexMap- map linking a content to his search status (used to know if a query failed because the fuzzy query was too complex for example)content- the content- Returns:
- the StringBuilder used to display a content
-
_renderContentTitle
Render the content title- Parameters:
content- The content- Returns:
- the link
-
_renderCmsToolLink
Render the cms tool link- Parameters:
content- The content- Returns:
- the link
-
_getErrorMailSubject
Description copied from class:AbstractSendingMailSchedulableRetrieves the subject of the error mail- Specified by:
_getErrorMailSubjectin classAbstractSendingMailSchedulable- Parameters:
context- the context- Returns:
- the subject of the error mail
- Throws:
Exception- If an error occurs while building the mail subject
-
_getErrorMailBody
protected String _getErrorMailBody(JobExecutionContext context, Throwable throwable) throws Exception Description copied from class:AbstractSendingMailSchedulableRetrieves the body of the error mail- Specified by:
_getErrorMailBodyin classAbstractSendingMailSchedulable- Parameters:
context- the contextthrowable- the error- Returns:
- the body of the error mail
- Throws:
Exception- If an error occurs while building the mail body
-