REPO-3335 Enterprise Docker and docker-compose simplified by pulling in transformer images

This commit is contained in:
Alan Davis 2018-03-17 12:27:55 +00:00
parent 2d6fafaf1c
commit 8d338d1b55
2 changed files with 160 additions and 149 deletions

View File

@ -69,6 +69,7 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
// "${jodconverter.maxTasksPerProcess}" will be injected. // "${jodconverter.maxTasksPerProcess}" will be injected.
private Integer maxTasksPerProcess; private Integer maxTasksPerProcess;
private String url;
private String officeHome; private String officeHome;
private int[] portNumbers; private int[] portNumbers;
private Long taskExecutionTimeout; private Long taskExecutionTimeout;
@ -90,6 +91,11 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
} }
} }
public void setUrl(String url)
{
this.url = url;
}
public void setOfficeHome(String officeHome) public void setOfficeHome(String officeHome)
{ {
this.officeHome = officeHome == null ? "" : officeHome.trim(); this.officeHome = officeHome == null ? "" : officeHome.trim();
@ -277,7 +283,7 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
*/ */
public boolean isAvailable() public boolean isAvailable()
{ {
final boolean result = isAvailable && officeManager != null; final boolean result = isAvailable && (officeManager != null || (url != null && !url.isEmpty()));
return result; return result;
} }
@ -308,6 +314,7 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
logger.debug(" jodconverter.taskExecutionTimeout = " + taskExecutionTimeout); logger.debug(" jodconverter.taskExecutionTimeout = " + taskExecutionTimeout);
logger.debug(" jodconverter.taskQueueTimeout = " + taskQueueTimeout); logger.debug(" jodconverter.taskQueueTimeout = " + taskQueueTimeout);
logger.debug(" jodconverter.connectTimeout = " + connectTimeout); logger.debug(" jodconverter.connectTimeout = " + connectTimeout);
logger.debug(" jodconverter.url = " + url);
} }
// Only start the JodConverter instance(s) if the subsystem is enabled. // Only start the JodConverter instance(s) if the subsystem is enabled.
@ -316,6 +323,9 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
return; return;
} }
if (url == null || url.isEmpty())
{
logAllSofficeFilesUnderOfficeHome(); logAllSofficeFilesUnderOfficeHome();
try try
@ -325,7 +335,7 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
{ {
defaultOfficeMgrConfig.setMaxTasksPerProcess(maxTasksPerProcess); defaultOfficeMgrConfig.setMaxTasksPerProcess(maxTasksPerProcess);
} }
if (officeHome != null) if (officeHome != null && officeHome.length() != 0)
{ {
defaultOfficeMgrConfig.setOfficeHome(officeHome); defaultOfficeMgrConfig.setOfficeHome(officeHome);
} }
@ -382,6 +392,7 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
} }
return; return;
} }
}
// If any exceptions are thrown in the above code, then isAvailable // If any exceptions are thrown in the above code, then isAvailable
// should remain false, hence the return statements. // should remain false, hence the return statements.

View File

@ -2,6 +2,6 @@ spring.http.multipart.max-file-size=8192MB
spring.http.multipart.max-request-size=8192MB spring.http.multipart.max-request-size=8192MB
server.port = 8090 server.port = 8090
logging.level.org.alfresco.util.exec.RuntimeExec=debug #logging.level.org.alfresco.util.exec.RuntimeExec=debug
logging.level.org.alfresco.transformer.LibreOfficeController=debug #logging.level.org.alfresco.transformer.LibreOfficeController=debug
logging.level.org.alfresco.transformer.JodConverterSharedInstance=debug #logging.level.org.alfresco.transformer.JodConverterSharedInstance=debug