mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-14 17:58:27 +00:00
ACS-3118 Check the size of intermmitent results in a pipeline (#629)
Set the size of a transform result in the Reply to the t-router. Tidy up code: Avoid having to add the transformName to the transformOptions in the Controller class and then remove it in Transformer interface.
This commit is contained in:
@@ -352,6 +352,7 @@ public abstract class AbstractTransformerController implements TransformControll
|
||||
transformerDebug.logOptions(request);
|
||||
String transformName = getTransformerName(sourceFile, sourceMimetype, targetMimetype, transformOptions);
|
||||
transformImpl(transformName, sourceMimetype, targetMimetype, transformOptions, sourceFile, targetFile);
|
||||
reply.getInternalContext().setCurrentSourceSize(targetFile.length());
|
||||
}
|
||||
catch (TransformException e)
|
||||
{
|
||||
|
@@ -4,7 +4,7 @@ package org.alfresco.transformer.executors;
|
||||
* #%L
|
||||
* Alfresco Transform Core
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
@@ -52,11 +52,17 @@ public interface Transformer
|
||||
String getTransformerId();
|
||||
|
||||
default void transform(String sourceMimetype, String targetMimetype, Map<String, String> transformOptions,
|
||||
File sourceFile, File targetFile) throws TransformException
|
||||
File sourceFile, File targetFile) throws TransformException {
|
||||
final String transformName = transformOptions.remove(TRANSFORM_NAME_PARAMETER);
|
||||
transformExtractOrEmbed(transformName, sourceMimetype, targetMimetype, transformOptions, sourceFile, targetFile);
|
||||
}
|
||||
|
||||
default void transformExtractOrEmbed(String transformName, String sourceMimetype, String targetMimetype,
|
||||
Map<String, String> transformOptions,
|
||||
File sourceFile, File targetFile) throws TransformException
|
||||
{
|
||||
try
|
||||
{
|
||||
final String transformName = transformOptions.remove(TRANSFORM_NAME_PARAMETER);
|
||||
if (MIMETYPE_METADATA_EXTRACT.equals(targetMimetype))
|
||||
{
|
||||
extractMetadata(transformName, sourceMimetype, targetMimetype, transformOptions, sourceFile, targetFile);
|
||||
|
Reference in New Issue
Block a user