Class AbstractProgramElementExporter<T extends Content & ProgramItem>
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.odf.ose.export.impl.odf.AbstractProgramElementExporter<T>
- Type Parameters:
T
- The type of the element to export, should extendContent
andProgramItem
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
- Direct Known Subclasses:
CourseExporter
,ProgramPartExporter
public abstract class AbstractProgramElementExporter<T extends Content & ProgramItem>
extends AbstractLogEnabled
implements Component, Serviceable
Exporter for program elements.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
An object to represent common computed data on the program element like orgunit, step holder, etc. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract List<ParameterizableQuery>
_getQueries
(T programElement, AbstractProgramElementExporter.ProgramElementData data, Long oseCatalog, CostComputationData costData) Get the queries to create the program element in the OSE database.getQueries
(T programElement, Long oseCatalog, CostComputationData costData) Get queries to export the given program element.void
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_elementRetriever
The retriever of elements from ODF
-
-
Constructor Details
-
AbstractProgramElementExporter
public AbstractProgramElementExporter()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getQueries
public List<ParameterizableQuery> getQueries(T programElement, Long oseCatalog, CostComputationData costData) Get queries to export the given program element.- Parameters:
programElement
- The program element to exportoseCatalog
- The OSE catalogcostData
- the result of cost computation of the catalog- Returns:
- A
List
ofParameterizableQuery
to export the program element, it can be empty if there is a problem (see logs)
-
_getQueries
protected abstract List<ParameterizableQuery> _getQueries(T programElement, AbstractProgramElementExporter.ProgramElementData data, Long oseCatalog, CostComputationData costData) Get the queries to create the program element in the OSE database.- Parameters:
programElement
- The program elementdata
- The calculated data attached to the program elementoseCatalog
- The OSE catalogcostData
- the result of cost computation of the catalog- Returns:
- The list of queries
-