ATS-448 : Small T-Engine configuration improvements

- ignore empty fields during serialization
 - changed application.properties files to application-default.yaml
This commit is contained in:
Cezar.Leahu
2019-06-04 19:30:12 +03:00
committed by CezarLeahu
parent f965f76206
commit 8419cc4b6d
10 changed files with 16 additions and 10 deletions

View File

@@ -0,0 +1,2 @@
queue:
engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.alfresco-pdf-renderer.acs}

View File

@@ -1 +0,0 @@
queue.engineRequestQueue=${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.alfresco-pdf-renderer.acs}

View File

@@ -0,0 +1,2 @@
queue:
engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.imagemagick.acs}

View File

@@ -1 +0,0 @@
queue.engineRequestQueue=${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.imagemagick.acs}

View File

@@ -0,0 +1,2 @@
queue:
engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.libreoffice.acs}

View File

@@ -1 +0,0 @@
queue.engineRequestQueue=${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.libreoffice.acs}

View File

@@ -0,0 +1,2 @@
queue:
engineRequestQueue: ${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.tika.acs}

View File

@@ -1 +0,0 @@
queue.engineRequestQueue=${TRANSFORM_ENGINE_REQUEST_QUEUE:org.alfresco.transform.engine.tika.acs}

View File

@@ -21,7 +21,6 @@
*/ */
package org.alfresco.transformer; package org.alfresco.transformer;
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
import static org.alfresco.transformer.fs.FileManager.buildFile; import static org.alfresco.transformer.fs.FileManager.buildFile;
import static org.alfresco.transformer.fs.FileManager.createTargetFileName; import static org.alfresco.transformer.fs.FileManager.createTargetFileName;
import static org.alfresco.transformer.fs.FileManager.deleteFile; import static org.alfresco.transformer.fs.FileManager.deleteFile;
@@ -37,13 +36,12 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.alfresco.transform.client.model.TransformReply; import org.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.client.model.TransformRequest; import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transform.client.model.TransformRequestValidator; import org.alfresco.transform.client.model.TransformRequestValidator;
import org.alfresco.transform.client.model.config.TransformConfig; import org.alfresco.transform.client.model.config.TransformConfig;
import org.alfresco.transformer.clients.AlfrescoSharedFileStoreClient;
import org.alfresco.transform.exceptions.TransformException; import org.alfresco.transform.exceptions.TransformException;
import org.alfresco.transformer.clients.AlfrescoSharedFileStoreClient;
import org.alfresco.transformer.logging.LogEntry; import org.alfresco.transformer.logging.LogEntry;
import org.alfresco.transformer.model.FileRefResponse; import org.alfresco.transformer.model.FileRefResponse;
import org.alfresco.util.TempFileProvider; import org.alfresco.util.TempFileProvider;
@@ -59,13 +57,15 @@ import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.validation.DirectFieldBindingResult; import org.springframework.validation.DirectFieldBindingResult;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpClientErrorException;
import com.fasterxml.jackson.databind.ObjectMapper;
/** /**
* <p>Abstract Controller, provides structure and helper methods to sub-class transformer controllers.</p> * <p>Abstract Controller, provides structure and helper methods to sub-class transformer controllers.</p>
* *
@@ -117,8 +117,8 @@ public abstract class AbstractTransformerController implements TransformControll
ClassPathResource classPathResource = new ClassPathResource(ENGINE_CONFIG); ClassPathResource classPathResource = new ClassPathResource(ENGINE_CONFIG);
InputStream engineConfigFile = classPathResource.getInputStream(); InputStream engineConfigFile = classPathResource.getInputStream();
TransformConfig transformConfig = objectMapper.setSerializationInclusion(NON_NULL) TransformConfig transformConfig = objectMapper.readValue(engineConfigFile,
.readValue(engineConfigFile, TransformConfig.class); TransformConfig.class);
return new ResponseEntity<>(transformConfig, OK); return new ResponseEntity<>(transformConfig, OK);
} }
catch (IOException e) catch (IOException e)

View File

@@ -10,6 +10,8 @@ spring:
pool: pool:
enabled: true enabled: true
max-connections: 20 max-connections: 20
jackson:
default-property-inclusion: non_empty
server: server:
port: 8090 port: 8090