Package org.ametys.odf.cdmfr
Class AbstractCDMfrProcessor
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.odf.cdmfr.AbstractCDMfrProcessor
- All Implemented Interfaces:
LogEnabled,Initializable,Component,Serviceable
- Direct Known Subclasses:
DepositCDMfrProcessor,SendCDMfrProcessor
public abstract class AbstractCDMfrProcessor
extends AbstractLogEnabled
implements Component, Serviceable, Initializable
Processor to process CDM-fr files.
- Filter programs if need
- Iterate on programs
- Generate the CDM-fr file
- Process on the CDM-fr file
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ODFHelperThe ODF helperprotected SourceResolverThe source resolver -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Source_getCDMfrContent(Program program) Get the CDM-fr of the current program.filterPrograms(Stream<Program> programs) Filter programs if needed.protected abstract StringGet the configuration parameter name to determine if the process is active.protected abstract StringGet the error message if process fails.voidbooleanisActive()trueif the process is activeprotected abstract booleantrueto generate CDM-fr for another Ametys,falseotherwise.protected abstract voidprocessProgram(Program program, InputStream cdmfrContent) Process the program and its CDM-fr input stream.voidprocessPrograms(Set<Program> programs) Process the CDM-fr of the given programs.voidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_sourceResolver
The source resolver -
_odfHelper
The ODF helper
-
-
Constructor Details
-
AbstractCDMfrProcessor
public AbstractCDMfrProcessor()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
getConfigActiveParam
Get the configuration parameter name to determine if the process is active.- Returns:
- The configuration parameter name
-
isActive
trueif the process is active- Returns:
trueif the process is active
-
processPrograms
Process the CDM-fr of the given programs.- Parameters:
programs- The programs to process
-
processProgram
protected abstract void processProgram(Program program, InputStream cdmfrContent) throws IOException Process the program and its CDM-fr input stream.- Parameters:
program- The programcdmfrContent- The CDM-fr content asInputStream- Throws:
IOException- if an exception occurs
-
getErrorMessage
Get the error message if process fails.- Returns:
- the error message
-
filterPrograms
Filter programs if needed.- Parameters:
programs- The programs to filter- Returns:
- The filtered programs
-
_getCDMfrContent
Get the CDM-fr of the current program.- Parameters:
program- The program to export as CDM-fr- Returns:
- The
InputStreamwith the CDM-fr content - Throws:
IOException- if an exception occurs
-
isCDMfrForAmetys
trueto generate CDM-fr for another Ametys,falseotherwise.- Returns:
trueto generate CDM-fr for another Ametys instance
-