Class ExportXlsSchedulable
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
org.ametys.cms.schedule.AbstractSendingMailSchedulable
org.ametys.plugins.forms.schedulable.ExportXlsSchedulable
- All Implemented Interfaces:
Schedulable,LogEnabled,PluginAware,Initializable,Component,Configurable,Contextualizable,Serviceable
Schedulable for form xls export-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
AbstractStaticSchedulable.SchedulableParameterParser -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AmetysObjectResolverThe ametys object resolverprotected SourceResolverThe avalon source resolver.static final StringThe directory under ametys home data directory for form xls exportstatic final StringScheduler parameter name for form idFields 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 void_doExecute(JobExecutionContext context, ContainerProgressionTracker progressionTracker) Executes the schedulable.protected void_generateFormExportXls(File xslExportDirectory, Form form) Generate the form xls exportprotected String_getDownloadLink(Form form) Get the link to download form xls exportprotected 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 HTMLvoidservice(ServiceManager manager) Methods inherited from class org.ametys.cms.schedule.AbstractSendingMailSchedulable
_getRecipient, _sendMail, execute, initializeMethods 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
-
FORM_EXPORT_XLS_DIR_NAME
The directory under ametys home data directory for form xls export- See Also:
-
PARAM_FORM_ID
Scheduler parameter name for form id- See Also:
-
_sourceResolver
The avalon source resolver. -
_resolver
The ametys object resolver
-
-
Constructor Details
-
ExportXlsSchedulable
public ExportXlsSchedulable()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSendingMailSchedulable- Throws:
ServiceException
-
_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
-
_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
-
_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- Throws:
Exception- If an error occurs while retrieving if mail body should be HTML
-
_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:
IOException
-
_getDownloadLink
Get the link to download form xls export- Parameters:
form- the form- Returns:
- the download link
- Throws:
IOException- if failed to build the download uri
-
_getErrorMailBody
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
-
_generateFormExportXls
Generate the form xls export- Parameters:
xslExportDirectory- the xls export directoryform- the form- Throws:
IOException- if an error occured with files
-