mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-14 17:58:27 +00:00
[release] 3.0.0-HXP-A2
* Fix ready probe in libreoffice & imagemagick * Add switch for behind-proxy
This commit is contained in:
@@ -37,6 +37,7 @@ import org.alfresco.transform.registry.TransformServiceRegistry;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
@@ -104,6 +105,8 @@ public class TransformController
|
|||||||
private String coreVersion;
|
private String coreVersion;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OptionLister optionLister;
|
private OptionLister optionLister;
|
||||||
|
@Value("${container.behind-ingres}")
|
||||||
|
private boolean behindIngres;
|
||||||
|
|
||||||
TransformEngine transformEngine;
|
TransformEngine transformEngine;
|
||||||
|
|
||||||
@@ -181,14 +184,19 @@ public class TransformController
|
|||||||
return "log"; // display log.html
|
return "log"; // display log.html
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Object getPathPrefix(String transformEngineName)
|
private Object getPathPrefix(String transformEngineName)
|
||||||
|
{
|
||||||
|
String pathPrefix = "";
|
||||||
|
if (behindIngres)
|
||||||
{
|
{
|
||||||
int i = transformEngineName.lastIndexOf('-');
|
int i = transformEngineName.lastIndexOf('-');
|
||||||
if (i != -1)
|
if (i != -1)
|
||||||
{
|
{
|
||||||
transformEngineName = transformEngineName.substring(i + 1);
|
transformEngineName = transformEngineName.substring(i + 1);
|
||||||
}
|
}
|
||||||
return "/"+transformEngineName.toLowerCase();
|
pathPrefix = "/" + transformEngineName.toLowerCase();
|
||||||
|
}
|
||||||
|
return pathPrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -53,6 +53,7 @@ management:
|
|||||||
|
|
||||||
container:
|
container:
|
||||||
name: ${HOSTNAME:t-engine}
|
name: ${HOSTNAME:t-engine}
|
||||||
|
behind-ingres: true
|
||||||
|
|
||||||
async-task-executor:
|
async-task-executor:
|
||||||
core-pool-size: 1
|
core-pool-size: 1
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<br/>
|
<br/>
|
||||||
<a th:href="${proxyPathPrefix+'/'}">Test</a>
|
<a th:href="${proxyPathPrefix+'/'}">Test</a>
|
||||||
<a th:href="${proxyPathPrefix+'/log'}">Log</a>
|
Log
|
||||||
<a th:href="${proxyPathPrefix+'/ready'}">Ready</a>
|
<a th:href="${proxyPathPrefix+'/ready'}">Ready</a>
|
||||||
<a th:href="${proxyPathPrefix+'/live'}">Live</a>
|
<a th:href="${proxyPathPrefix+'/live'}">Live</a>
|
||||||
<a th:href="${proxyPathPrefix+'/transform/config?configVersion=9999'}">Config</a>
|
<a th:href="${proxyPathPrefix+'/transform/config?configVersion=9999'}">Config</a>
|
||||||
|
@@ -69,6 +69,6 @@ public class ImageMagickTransformEngine implements TransformEngine
|
|||||||
public ProbeTransform getProbeTransform()
|
public ProbeTransform getProbeTransform()
|
||||||
{
|
{
|
||||||
return new ProbeTransform("probe.jpg", MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, Collections.emptyMap(),
|
return new ProbeTransform("probe.jpg", MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, Collections.emptyMap(),
|
||||||
35593, 1024, 150, 1024, 60 * 15 + 1, 60 * 15);
|
25383, 1024, 150, 1024, 60 * 15 + 1, 60 * 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -69,7 +69,7 @@ public class LibreOfficeTransformEngine implements TransformEngine
|
|||||||
@Override
|
@Override
|
||||||
public ProbeTransform getProbeTransform()
|
public ProbeTransform getProbeTransform()
|
||||||
{
|
{
|
||||||
return new ProbeTransform("probe.jpg", MIMETYPE_WORD, MIMETYPE_PDF, Collections.emptyMap(),
|
return new ProbeTransform("probe.doc", MIMETYPE_WORD, MIMETYPE_PDF, Collections.emptyMap(),
|
||||||
11817, 1024, 150, 10240, 60 * 30 + 1, 60 * 15 + 20);
|
11817, 1024, 150, 10240, 60 * 30 + 1, 60 * 15 + 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user