REPO-3422 Startup check for LibreOffice

Also included the transformer name on the log and error pages.
This commit is contained in:
Alan Davis
2018-04-09 06:57:53 +01:00
parent 419d71bfbf
commit a0dd60d6a6
10 changed files with 152 additions and 50 deletions

View File

@@ -96,6 +96,24 @@ public class LibreOfficeController extends AbstractTransformerController
this.jodconverter = jodconverter;
}
@Override
protected String getTransformerName()
{
return "LibreOffice";
}
@Override
protected String version()
{
// This method is simply used to check the availability in the case of LibreOffice.
if (!jodconverter.isAvailable())
{
throw new TransformException(500, "LibreOffice is not yet available");
}
return "LibreOffice available";
}
@PostMapping("/transform")
public ResponseEntity<Resource> transform(HttpServletRequest request,
@RequestParam("file") MultipartFile sourceMultipartFile,

View File

@@ -1,10 +1,6 @@
<html xmlns:th="http://www.thymeleaf.org">
<body>
<div th:if="${message}">
<h2 th:text="${message}"/>
</div>
<div>
<h2>LibreOffice Test Transformation</h2>
<form method="POST" enctype="multipart/form-data" action="/transform">