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.
private Integer maxTasksPerProcess;
private String url;
private String officeHome;
private int[] portNumbers;
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)
{
this.officeHome = officeHome == null ? "" : officeHome.trim();
@ -277,7 +283,7 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
*/
public boolean isAvailable()
{
final boolean result = isAvailable && officeManager != null;
final boolean result = isAvailable && (officeManager != null || (url != null && !url.isEmpty()));
return result;
}
@ -308,6 +314,7 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
logger.debug(" jodconverter.taskExecutionTimeout = " + taskExecutionTimeout);
logger.debug(" jodconverter.taskQueueTimeout = " + taskQueueTimeout);
logger.debug(" jodconverter.connectTimeout = " + connectTimeout);
logger.debug(" jodconverter.url = " + url);
}
// Only start the JodConverter instance(s) if the subsystem is enabled.
@ -316,6 +323,9 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
return;
}
if (url == null || url.isEmpty())
{
logAllSofficeFilesUnderOfficeHome();
try
@ -325,7 +335,7 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
{
defaultOfficeMgrConfig.setMaxTasksPerProcess(maxTasksPerProcess);
}
if (officeHome != null)
if (officeHome != null && officeHome.length() != 0)
{
defaultOfficeMgrConfig.setOfficeHome(officeHome);
}
@ -378,10 +388,11 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB
if (logger.isErrorEnabled())
{
logger.error("Unexpected error in configuring or starting the JodConverter library."
+ "The following error is shown for informational purposes only.",x);
+ "The following error is shown for informational purposes only.", x);
}
return;
}
}
// If any exceptions are thrown in the above code, then isAvailable
// 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
server.port = 8090
logging.level.org.alfresco.util.exec.RuntimeExec=debug
logging.level.org.alfresco.transformer.LibreOfficeController=debug
logging.level.org.alfresco.transformer.JodConverterSharedInstance=debug
#logging.level.org.alfresco.util.exec.RuntimeExec=debug
#logging.level.org.alfresco.transformer.LibreOfficeController=debug
#logging.level.org.alfresco.transformer.JodConverterSharedInstance=debug