Class ConfigurablePipelineDescriptor
- java.lang.Object
-
- org.ametys.plugins.extraction.execution.pipeline.impl.ConfigurablePipelineDescriptor
-
- All Implemented Interfaces:
PipelineDescriptor
,Configurable
public class ConfigurablePipelineDescriptor extends Object implements PipelineDescriptor, Configurable
Implementation ofPipelineDescriptor
which isConfigurable
.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__DEFAULT_SERIALIZER
private static org.slf4j.Logger
__LOGGER
private List<String>
_extractions
private String
_id
private I18nizableText
_label
private Map<String,String>
_outputParams
private PipelineSerializerModelExtensionPoint
_pipelineSerializers
private SourceResolver
_resolver
private PipelineSerializerModel
_serializer
private List<String>
_xslts
-
Constructor Summary
Constructors Constructor Description ConfigurablePipelineDescriptor(String id, SourceResolver resolver, PipelineSerializerModelExtensionPoint pipelineSerializers)
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Configuration configuration)
String
getDefaultExtension()
Gets the default extension of the file result(s)
The default extension is used whenPipelineDescriptor.getResultSubfolder()
is a folder and not a file.ExtractionMatcher
getExtractionMatcher()
Gets theextraction matcher
to check if the pipeline is able to handle a given extractionI18nizableText
getLabel()
Gets the labelMap<String,String>
getOutputParameters()
Get the output parameters to add some specific features in each serializer.String
getResultSubfolder()
Gets the result subfolder (or file).PipelineSerializerModel
getSerializerModel()
Gets theserializer model
List<String>
getStylesheets()
Gets the XSLT file names to chainPipeline
newPipeline(OutputStream out)
Provides a newPipeline
protected void
setOutputParameters(Configuration outputConf)
Set the output parameters to get the extension, path, encoding, etc.
-
-
-
Field Detail
-
__LOGGER
private static final org.slf4j.Logger __LOGGER
-
__DEFAULT_SERIALIZER
private static final String __DEFAULT_SERIALIZER
- See Also:
- Constant Field Values
-
_label
private I18nizableText _label
-
_extractions
private List<String> _extractions
-
_serializer
private PipelineSerializerModel _serializer
-
_outputParams
private Map<String,String> _outputParams
-
_resolver
private SourceResolver _resolver
-
_pipelineSerializers
private PipelineSerializerModelExtensionPoint _pipelineSerializers
-
-
Constructor Detail
-
ConfigurablePipelineDescriptor
public ConfigurablePipelineDescriptor(String id, SourceResolver resolver, PipelineSerializerModelExtensionPoint pipelineSerializers)
Default constructor- Parameters:
id
- The id of the pipeline descriptorresolver
- The source resolverpipelineSerializers
- The extension point for pipeline serializers
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getLabel
public I18nizableText getLabel()
Description copied from interface:PipelineDescriptor
Gets the label- Specified by:
getLabel
in interfacePipelineDescriptor
- Returns:
- the label
-
getExtractionMatcher
public ExtractionMatcher getExtractionMatcher()
Description copied from interface:PipelineDescriptor
Gets theextraction matcher
to check if the pipeline is able to handle a given extraction- Specified by:
getExtractionMatcher
in interfacePipelineDescriptor
- Returns:
- the
extraction matcher
of the pipeline
-
getStylesheets
public List<String> getStylesheets()
Description copied from interface:PipelineDescriptor
Gets the XSLT file names to chain- Specified by:
getStylesheets
in interfacePipelineDescriptor
- Returns:
- the XSLT file names to chain
-
getSerializerModel
public PipelineSerializerModel getSerializerModel()
Description copied from interface:PipelineDescriptor
Gets theserializer model
- Specified by:
getSerializerModel
in interfacePipelineDescriptor
- Returns:
- the
serializer model
-
getResultSubfolder
public String getResultSubfolder()
Description copied from interface:PipelineDescriptor
Gets the result subfolder (or file).
Can contain variables (seePathResolver
), resolved against the extraction results.
If it returns- a file path without variable, then all extraction results will be in this file;
- a file path with variables, then extraction results will be dispatched in the resolved file paths;
-
a folder path without variable, then all extraction results will be in one file under this folder
(the file name will be the one provided in
defaultResultFileName
parameter ofExtractionExecutor#execute method
); -
a folder path with variables, then each first level content extraction result will be dispatched in one file under the resolved folders
(the file name will be the title of the content, and the extension is the return of
PipelineDescriptor.getDefaultExtension()
);
- Specified by:
getResultSubfolder
in interfacePipelineDescriptor
- Returns:
- the result subfolder (or file)
-
getDefaultExtension
public String getDefaultExtension()
Description copied from interface:PipelineDescriptor
Gets the default extension of the file result(s)
The default extension is used whenPipelineDescriptor.getResultSubfolder()
is a folder and not a file.- Specified by:
getDefaultExtension
in interfacePipelineDescriptor
- Returns:
- the default extension of the file result(s)
-
newPipeline
public Pipeline newPipeline(OutputStream out)
Description copied from interface:PipelineDescriptor
Provides a newPipeline
- Specified by:
newPipeline
in interfacePipelineDescriptor
- Parameters:
out
- the output stream to write on- Returns:
- the built
Pipeline
-
getOutputParameters
public Map<String,String> getOutputParameters()
Description copied from interface:PipelineDescriptor
Get the output parameters to add some specific features in each serializer.- Specified by:
getOutputParameters
in interfacePipelineDescriptor
- Returns:
- The output parameters
-
setOutputParameters
protected void setOutputParameters(Configuration outputConf) throws ConfigurationException
Set the output parameters to get the extension, path, encoding, etc.- Parameters:
outputConf
- The output configuration- Throws:
ConfigurationException
- throws an exception if an error occurs
-
-