public class ExtractionExecutor extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Field and Description |
---|---|
private ContentTypeExtensionPoint |
_contentTypeExtensionPoint |
private ContentTypesHelper |
_contentTypesHelper |
private CurrentUserProvider |
_currentUserProvider |
private ExtractionDefinitionReader |
_reader |
private AmetysObjectResolver |
_resolver |
private PathResolver |
_resultPathResolver |
private RightManager |
_rightManager |
private SourceResolver |
_sourceResolver |
static String |
EXTRACTION_DIR_NAME
The directory under ametys home data directory for extraction results
|
static String |
ROLE
The Avalon role.
|
Constructor and Description |
---|
ExtractionExecutor() |
Modifier and Type | Method and Description |
---|---|
private void |
_checkRights() |
private void |
_doExecute(AttributesImpl attributes,
Extraction extraction,
String extractionName,
ExtractionExecutionContext context,
String defaultResultFileName,
PipelineDescriptor pipeline) |
private void |
_doExecuteForPathWithNoVar(AttributesImpl attributes,
Extraction extraction,
ExtractionExecutionContext context,
OutputStream outputStream,
PipelineDescriptor pipelineDescriptor) |
private void |
_doExecuteForPathWithVar(AttributesImpl attributes,
Extraction extraction,
ExtractionExecutionContext context,
List<TwoStepsExecutingExtractionComponent> components,
Path basePath,
String unresolvedPath,
PipelineDescriptor pipelineDescriptor) |
private void |
_execute(String fileName,
String defaultResultFileName,
OutputStream resultOutputStream,
String lang,
Map<String,Object> parameters,
PipelineDescriptor pipeline) |
private Path |
_filePathWhenNoVar(Path fileOrFolderPath,
String defaultFileName) |
private AttributesImpl |
_getAttrs(String definitionFilename) |
private ExtractionExecutionContext |
_getContext(Extraction extraction,
String lang,
Map<String,Object> parameters) |
(package private) Map<String,Boolean> |
_getDisplayOptionalColumns(List<String> displayOptionalColumnsNames,
Map<String,Object> parameters) |
private Pair<Extraction,String> |
_getExtraction(String fileName) |
private Map<String,String> |
_getQueryVariables(Map<String,String> queryVariablesNamesAndContentTypes,
Map<String,Object> parameters) |
private void |
_noVarExecute(ContentHandler contentHandler,
AttributesImpl attributes,
Extraction extraction,
ExtractionExecutionContext context) |
private String |
_unresolvedFilePathWhenVar(String unresolvedFolderOrFilePath,
PipelineDescriptor pipelineDescriptor) |
private void |
_withVarExecute(ContentHandler contentHandler,
AttributesImpl attributes,
ExtractionExecutionContext context,
List<TwoStepsExecutingExtractionComponent> components,
List<Content> involvedContentsForPath,
Map<TwoStepsExecutingExtractionComponent,List<Content>> firstLevelResultsByComponent) |
void |
execute(String fileName,
OutputStream resultOutputStream,
String lang,
Map<String,Object> parameters,
PipelineDescriptor pipeline)
Executes the given extraction
|
void |
execute(String fileName,
String defaultResultFileName,
String lang,
Map<String,Object> parameters,
PipelineDescriptor pipeline)
Executes the given extraction
|
void |
service(ServiceManager serviceManager) |
getLogger, setLogger
public static final String EXTRACTION_DIR_NAME
private RightManager _rightManager
private ExtractionDefinitionReader _reader
private CurrentUserProvider _currentUserProvider
private ContentTypeExtensionPoint _contentTypeExtensionPoint
private AmetysObjectResolver _resolver
private ContentTypesHelper _contentTypesHelper
private SourceResolver _sourceResolver
private PathResolver _resultPathResolver
public ExtractionExecutor()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public void execute(String fileName, String defaultResultFileName, String lang, Map<String,Object> parameters, PipelineDescriptor pipeline) throws Exception
fileName
- The name of the extraction file to executedefaultResultFileName
- The default file name for the result (it can be unused, for instance if resultSubFolder is a file, i.e. contains a '.' in its last element)lang
- The langparameters
- The parameterspipeline
- The execution pipelineException
- if an errors occuredpublic void execute(String fileName, OutputStream resultOutputStream, String lang, Map<String,Object> parameters, PipelineDescriptor pipeline) throws Exception
fileName
- The name of the extraction file to executeresultOutputStream
- The result output streamlang
- The langparameters
- The parameterspipeline
- The execution pipelineException
- if an errors occuredprivate void _execute(String fileName, String defaultResultFileName, OutputStream resultOutputStream, String lang, Map<String,Object> parameters, PipelineDescriptor pipeline) throws Exception
Exception
private void _checkRights()
private Pair<Extraction,String> _getExtraction(String fileName) throws Exception
Exception
private AttributesImpl _getAttrs(String definitionFilename)
private ExtractionExecutionContext _getContext(Extraction extraction, String lang, Map<String,Object> parameters)
Map<String,Boolean> _getDisplayOptionalColumns(List<String> displayOptionalColumnsNames, Map<String,Object> parameters)
private Map<String,String> _getQueryVariables(Map<String,String> queryVariablesNamesAndContentTypes, Map<String,Object> parameters)
private void _doExecute(AttributesImpl attributes, Extraction extraction, String extractionName, ExtractionExecutionContext context, String defaultResultFileName, PipelineDescriptor pipeline) throws Exception
Exception
private Path _filePathWhenNoVar(Path fileOrFolderPath, String defaultFileName)
private void _doExecuteForPathWithNoVar(AttributesImpl attributes, Extraction extraction, ExtractionExecutionContext context, OutputStream outputStream, PipelineDescriptor pipelineDescriptor) throws Exception
Exception
private void _noVarExecute(ContentHandler contentHandler, AttributesImpl attributes, Extraction extraction, ExtractionExecutionContext context) throws Exception
Exception
private void _doExecuteForPathWithVar(AttributesImpl attributes, Extraction extraction, ExtractionExecutionContext context, List<TwoStepsExecutingExtractionComponent> components, Path basePath, String unresolvedPath, PipelineDescriptor pipelineDescriptor) throws Exception
Exception
private String _unresolvedFilePathWhenVar(String unresolvedFolderOrFilePath, PipelineDescriptor pipelineDescriptor)
private void _withVarExecute(ContentHandler contentHandler, AttributesImpl attributes, ExtractionExecutionContext context, List<TwoStepsExecutingExtractionComponent> components, List<Content> involvedContentsForPath, Map<TwoStepsExecutingExtractionComponent,List<Content>> firstLevelResultsByComponent) throws Exception
Exception