mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-14 17:58:27 +00:00
Feature/repo 3505 probes
This commit is contained in:
@@ -12,8 +12,6 @@
|
||||
package org.alfresco.transformer;
|
||||
|
||||
import com.sun.star.task.ErrorCodeIOException;
|
||||
import org.alfresco.transformer.base.AbstractTransformerController;
|
||||
import org.alfresco.transformer.base.TransformException;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.pdmodel.PDPage;
|
||||
@@ -71,9 +69,6 @@ public class LibreOfficeController extends AbstractTransformerController
|
||||
logEnterpriseLicenseMessage();
|
||||
logger.info("This transformer uses LibreOffice from The Document Foundation. See the license at https://www.libreoffice.org/download/license/ or in /libreoffice.txt");
|
||||
logger.info("-------------------------------------------------------------------------------------------------------------------------------------------------------");
|
||||
|
||||
// TODO Remove this when we are happy that creating the jodconverter on the first transform is okay.
|
||||
// setJodConverter(createJodConverter(null));
|
||||
}
|
||||
|
||||
private static JodConverter createJodConverter(Long taskExecutionTimeout)
|
||||
@@ -122,14 +117,24 @@ public class LibreOfficeController extends AbstractTransformerController
|
||||
@Override
|
||||
protected String version()
|
||||
{
|
||||
// TODO Remove this when we are happy that creating the jodconverter on the first transform is okay.
|
||||
// if (!jodconverter.isAvailable())
|
||||
// {
|
||||
// throw new TransformException(500, "LibreOffice is not yet available");
|
||||
// }
|
||||
return "LibreOffice available";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ProbeTestTransform getProbeTestTransform()
|
||||
{
|
||||
// See the Javadoc on this method and Probes.md for the choice of these values.
|
||||
return new ProbeTestTransform(this, "quick.doc", "quick.pdf",
|
||||
11817, 1024, 150, 10240, 60*30+1, 60*15+20)
|
||||
{
|
||||
@Override
|
||||
protected void executeTransformCommand(File sourceFile, File targetFile)
|
||||
{
|
||||
LibreOfficeController.this.executeTransformCommand(sourceFile, targetFile, null);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@PostMapping("/transform")
|
||||
public ResponseEntity<Resource> transform(HttpServletRequest request,
|
||||
@RequestParam("file") MultipartFile sourceMultipartFile,
|
||||
|
@@ -66,6 +66,8 @@ public class LibreOfficeControllerTest extends AbstractTransformerControllerTest
|
||||
@Before
|
||||
public void before() throws IOException
|
||||
{
|
||||
super.controller = controller;
|
||||
|
||||
sourceExtension = "doc";
|
||||
targetExtension = "pdf";
|
||||
sourceMimetype = "application/msword";
|
||||
|
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
package org.alfresco.transformer;
|
||||
|
||||
import org.alfresco.transformer.AbstractHttpRequestTest;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
Reference in New Issue
Block a user