Package org.ametys.odf.schedulable
Class CopyCatalogSchedulable
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
-
- org.ametys.cms.schedule.AbstractSendingMailSchedulable
-
- org.ametys.odf.schedulable.CopyCatalogSchedulable
-
- All Implemented Interfaces:
Schedulable
,LogEnabled
,PluginAware
,Initializable
,Component
,Configurable
,Contextualizable
,Serviceable
public class CopyCatalogSchedulable extends AbstractSendingMailSchedulable
Schedulable to copy a catalog.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
AbstractStaticSchedulable.SchedulableParameterParser
-
-
Field Summary
Fields Modifier and Type Field Description protected CatalogsManager
_catalogsManager
The catalogs managerstatic String
JOBDATAMAP_DEST_CATALOG_KEY
The key for the destinationcatalogstatic String
JOBDATAMAP_SRC_CATALOG_KEY
The key for the source catalogstatic String
SCHEDULABLE_ID
Schedulable ID-
Fields inherited from class org.ametys.cms.schedule.AbstractSendingMailSchedulable
_currentUserProvider, _i18nUtils, _mailSender, _sysadminMail, _userHelper
-
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 CopyCatalogSchedulable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_doExecute(JobExecutionContext context)
Executes the schedulable.protected I18nizableText
_getErrorMailBody(JobExecutionContext context, Throwable throwable)
Retrieves the body of the error mailprotected I18nizableText
_getErrorMailSubject(JobExecutionContext context)
Retrieves the subject of the error mailprotected I18nizableText
_getSuccessMailBody(JobExecutionContext context)
Retrieves the body of the success mailprotected I18nizableText
_getSuccessMailSubject(JobExecutionContext context)
Retrieves the subject of the success mailvoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.cms.schedule.AbstractSendingMailSchedulable
_getRecipient, _isMailBodyInHTML, _sendMail, execute, 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
-
SCHEDULABLE_ID
public static final String SCHEDULABLE_ID
Schedulable ID
-
JOBDATAMAP_SRC_CATALOG_KEY
public static final String JOBDATAMAP_SRC_CATALOG_KEY
The key for the source catalog- See Also:
- Constant Field Values
-
JOBDATAMAP_DEST_CATALOG_KEY
public static final String JOBDATAMAP_DEST_CATALOG_KEY
The key for the destinationcatalog- See Also:
- Constant Field Values
-
_catalogsManager
protected CatalogsManager _catalogsManager
The catalogs manager
-
-
Constructor Detail
-
CopyCatalogSchedulable
public CopyCatalogSchedulable()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractSendingMailSchedulable
- Throws:
ServiceException
-
_doExecute
protected void _doExecute(JobExecutionContext context) throws Exception
Description copied from class:AbstractSendingMailSchedulable
Executes the schedulable.- Specified by:
_doExecute
in classAbstractSendingMailSchedulable
- Parameters:
context
- the context- Throws:
Exception
- if an error occurred
-
_getSuccessMailSubject
protected I18nizableText _getSuccessMailSubject(JobExecutionContext context) throws Exception
Description copied from class:AbstractSendingMailSchedulable
Retrieves the subject of the success mail- Specified by:
_getSuccessMailSubject
in classAbstractSendingMailSchedulable
- Parameters:
context
- the context- Returns:
- the subject of the success mail
- Throws:
Exception
- If an error occurs while building the mail subject
-
_getSuccessMailBody
protected I18nizableText _getSuccessMailBody(JobExecutionContext context) throws Exception
Description copied from class:AbstractSendingMailSchedulable
Retrieves the body of the success mail- Specified by:
_getSuccessMailBody
in classAbstractSendingMailSchedulable
- Parameters:
context
- the context- Returns:
- the body of the success mail
- Throws:
Exception
- If an error occurs while building the mail body
-
_getErrorMailSubject
protected I18nizableText _getErrorMailSubject(JobExecutionContext context) throws Exception
Description copied from class:AbstractSendingMailSchedulable
Retrieves the subject of the error mail- Specified by:
_getErrorMailSubject
in 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 I18nizableText _getErrorMailBody(JobExecutionContext context, Throwable throwable) throws Exception
Description copied from class:AbstractSendingMailSchedulable
Retrieves the body of the error mail- Specified by:
_getErrorMailBody
in 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
-
-