Package org.ametys.odf.schedulable
Class CatalogPDFExportSchedulable
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.CatalogPDFExportSchedulable
- All Implemented Interfaces:
Schedulable,LogEnabled,PluginAware,Initializable,Component,Configurable,Contextualizable,Serviceable
- Direct Known Subclasses:
CatalogPDFExportSchedulable
Schedulable to export the ODF catalog as PDF
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
AbstractStaticSchedulable.SchedulableParameterParser -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringMap key where the generated filename is storedprotected FileThe catalog directory.protected JSONUtilsThe JSON utilsprotected OdfReferenceTableHelperThe ODF reference table helper.protected AmetysObjectResolverThe Ametys object resolver.protected SourceResolverThe avalon source resolver.static final StringThe key for the catalogstatic final StringThe key for the degreesstatic final StringThe key for including subprogramsstatic final StringThe key for the langstatic final StringThe key for the modestatic final StringThe key for the orgunitsstatic final StringThe key for the query'idstatic final StringMode when catalog is generated from a queryFields 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, _userManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_doExecute(JobExecutionContext context) Executes the schedulable.protected String_getCatalogFilename(String queryId, Object[] orgunits, Object[] degrees) Get the catalog PDF file name from configurationprotected 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 I18nizableTextRetrieves the subject of the success mailGet the parameters for job executionvoidvoidservice(ServiceManager manager) Methods inherited from class org.ametys.cms.schedule.AbstractSendingMailSchedulable
_getRecipient, _isMailBodyInHTML, _sendMail, executeMethods inherited from class org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
acceptConcurrentExecution, configure, contextualize, getDescription, getIconGlyph, getIconLarge, getIconMedium, getIconSmall, getId, getLabel, isPrivate, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
JOBDATAMAP_CATALOG_KEY
The key for the catalog- See Also:
-
JOBDATAMAP_LANG_KEY
The key for the lang- See Also:
-
JOBDATAMAP_ORGUNIT_KEY
The key for the orgunits- See Also:
-
JOBDATAMAP_DEGREE_KEY
The key for the degrees- See Also:
-
JOBDATAMAP_QUERY_KEY
The key for the query'id- See Also:
-
JOBDATAMAP_MODE_KEY
The key for the mode- See Also:
-
JOBDATAMAP_INCLUDE_SUBPROGRAMS
The key for including subprograms- See Also:
-
MODE_QUERY
Mode when catalog is generated from a query- See Also:
-
_CATALOG_FILENAME
Map key where the generated filename is stored- See Also:
-
_resolver
The Ametys object resolver. -
_odfRefTableHelper
The ODF reference table helper. -
_sourceResolver
The avalon source resolver. -
_catalogRootDirectory
The catalog directory. -
_jsonUtils
The JSON utils
-
-
Constructor Details
-
CatalogPDFExportSchedulable
public CatalogPDFExportSchedulable()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSendingMailSchedulable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Overrides:
initializein classAbstractSendingMailSchedulable- Throws:
Exception
-
_doExecute
Description copied from class:AbstractSendingMailSchedulableExecutes the schedulable.- Specified by:
_doExecutein classAbstractSendingMailSchedulable- Parameters:
context- the context- Throws:
Exception- if an error occurred
-
_getCatalogFilename
Get the catalog PDF file name from configuration- Parameters:
queryId- The id of query to execute.nullwhen export is not based on a queryorgunits- The restricted orgunits.nullwhen export is based on a querydegrees- The restricted degrees.nullwhen export is based on a query- Returns:
- the computed catalog file name
-
getParameters
Description copied from interface:SchedulableGet the parameters for job execution- Specified by:
getParametersin interfaceSchedulable- Overrides:
getParametersin classAbstractStaticSchedulable- Returns:
- the parameters
-
_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
-
_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
-
_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 I18nizableText _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
-