mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V1.2.0 to HEAD
svn merge -r 2516:2518 svn://www.alfresco.org/alfresco/BRANCHES/V1.2.0/root HEAD/root git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2519 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -17,16 +17,20 @@
|
|||||||
package org.alfresco.repo.content.transform;
|
package org.alfresco.repo.content.transform;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.alfresco.repo.content.MimetypeMap;
|
import org.alfresco.repo.content.MimetypeMap;
|
||||||
import org.alfresco.repo.content.filestore.FileContentWriter;
|
import org.alfresco.repo.content.filestore.FileContentWriter;
|
||||||
|
import org.alfresco.repo.content.transform.ContentTransformerRegistry.TransformationKey;
|
||||||
import org.alfresco.service.cmr.repository.ContentReader;
|
import org.alfresco.service.cmr.repository.ContentReader;
|
||||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||||
import org.alfresco.util.BaseAlfrescoTestCase;
|
import org.alfresco.util.BaseAlfrescoTestCase;
|
||||||
import org.alfresco.util.TempFileProvider;
|
import org.alfresco.util.TempFileProvider;
|
||||||
import org.alfresco.util.exec.RuntimeExec;
|
import org.alfresco.util.exec.RuntimeExec;
|
||||||
|
import org.apache.xml.security.transforms.TransformationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer
|
* @see org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer
|
||||||
@@ -52,6 +56,11 @@ public class RuntimeExecutableContentTransformerTest extends BaseAlfrescoTestCas
|
|||||||
transformCommand.setErrorCodes("1, 2");
|
transformCommand.setErrorCodes("1, 2");
|
||||||
transformer.setTransformCommand(transformCommand);
|
transformer.setTransformCommand(transformCommand);
|
||||||
transformer.setMimetypeService(serviceRegistry.getMimetypeService());
|
transformer.setMimetypeService(serviceRegistry.getMimetypeService());
|
||||||
|
// set the explicit transformations
|
||||||
|
List<TransformationKey> explicitTranformations = new ArrayList<TransformationKey>(1);
|
||||||
|
explicitTranformations.add(
|
||||||
|
new TransformationKey(MimetypeMap.MIMETYPE_TEXT_PLAIN, MimetypeMap.MIMETYPE_XML));
|
||||||
|
transformer.setExplicitTransformations(explicitTranformations);
|
||||||
|
|
||||||
// initialise so that it doesn't score 0
|
// initialise so that it doesn't score 0
|
||||||
transformer.register();
|
transformer.register();
|
||||||
|
@@ -197,13 +197,6 @@ public abstract class AbstractImageMagickContentTransformer extends AbstractCont
|
|||||||
" target extension: " + targetExtension);
|
" target extension: " + targetExtension);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the source mimetype is the same as the target's then just stream it
|
|
||||||
if (sourceMimetype.equals(targetMimetype))
|
|
||||||
{
|
|
||||||
writer.putContent(reader.getContentInputStream());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// create required temp files
|
// create required temp files
|
||||||
File sourceFile = TempFileProvider.createTempFile(
|
File sourceFile = TempFileProvider.createTempFile(
|
||||||
getClass().getSimpleName() + "_source_",
|
getClass().getSimpleName() + "_source_",
|
||||||
|
Reference in New Issue
Block a user