diff --git a/pom.xml b/pom.xml index fea021393c..6a57cc9425 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 alfresco-repository Alfresco Repository - 6.32-TOKEN-AUTH-SNAPSHOT + 6.37-TOKEN-AUTH-SNAPSHOT jar @@ -36,12 +36,12 @@ convert 6.2 - 7.0 + 7.1 6.1 - 8.1 + 8.2 7.0 1.1 - 1.0.5 + 1.0.6 5.0.4.RELEASE @@ -396,13 +396,13 @@ org.bouncycastle - bcprov-jdk15 - 1.46 + bcprov-jdk15on + 1.59 org.bouncycastle - bcmail-jdk15 - 1.46 + bcmail-jdk15on + 1.59 com.googlecode.mp4parser @@ -630,7 +630,7 @@ com.google.guava guava - 11.0.2 + 24.0-jre org.springframework.security diff --git a/src/main/java/org/alfresco/repo/content/JodConverterSharedInstance.java b/src/main/java/org/alfresco/repo/content/JodConverterSharedInstance.java index 6a859d3341..a563b2ec29 100644 --- a/src/main/java/org/alfresco/repo/content/JodConverterSharedInstance.java +++ b/src/main/java/org/alfresco/repo/content/JodConverterSharedInstance.java @@ -2,7 +2,7 @@ * #%L * Alfresco Repository * %% - * Copyright (C) 2005 - 2017 Alfresco Software Limited + * Copyright (C) 2005 - 2018 Alfresco Software Limited * %% * This file is part of the Alfresco software. * If the software was purchased under a paid Alfresco license, the terms of @@ -41,6 +41,8 @@ import org.artofsolving.jodconverter.office.OfficeManager; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; +///////// THIS FILE IS A COPY OF THE CODE IN alfresco-docker-transformers ///////////// + /** * Makes use of the JodConverter library and an installed * OpenOffice application to perform OpenOffice-driven conversions. @@ -67,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; @@ -87,7 +90,12 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB this.maxTasksPerProcess = l.intValue(); } } - + + public void setUrl(String url) + { + this.url = url == null ? null : url.trim(); + } + public void setOfficeHome(String officeHome) { this.officeHome = officeHome == null ? "" : officeHome.trim(); @@ -275,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; } @@ -306,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. @@ -314,71 +323,75 @@ public class JodConverterSharedInstance implements InitializingBean, DisposableB return; } - logAllSofficeFilesUnderOfficeHome(); - - try + if (url == null || url.isEmpty()) { - DefaultOfficeManagerConfiguration defaultOfficeMgrConfig = new DefaultOfficeManagerConfiguration(); - if (maxTasksPerProcess != null && maxTasksPerProcess > 0) + + logAllSofficeFilesUnderOfficeHome(); + + try { - defaultOfficeMgrConfig.setMaxTasksPerProcess(maxTasksPerProcess); + DefaultOfficeManagerConfiguration defaultOfficeMgrConfig = new DefaultOfficeManagerConfiguration(); + if (maxTasksPerProcess != null && maxTasksPerProcess > 0) + { + defaultOfficeMgrConfig.setMaxTasksPerProcess(maxTasksPerProcess); + } + if (officeHome != null && officeHome.length() != 0) + { + defaultOfficeMgrConfig.setOfficeHome(officeHome); + } + if (portNumbers != null && portNumbers.length != 0) + { + defaultOfficeMgrConfig.setPortNumbers(portNumbers); + } + if (taskExecutionTimeout != null && taskExecutionTimeout > 0) + { + defaultOfficeMgrConfig.setTaskExecutionTimeout(taskExecutionTimeout); + } + if (taskQueueTimeout != null && taskQueueTimeout > 0) + { + defaultOfficeMgrConfig.setTaskQueueTimeout(taskQueueTimeout); + } + if (templateProfileDir != null) + { + defaultOfficeMgrConfig.setTemplateProfileDir(templateProfileDir); + } + if (connectTimeout != null) + { + defaultOfficeMgrConfig.setConnectTimeout(connectTimeout); + } + // Try to configure and start the JodConverter library. + officeManager = defaultOfficeMgrConfig.buildOfficeManager(); + officeManager.start(); } - if (officeHome != null) + catch (IllegalStateException isx) { - defaultOfficeMgrConfig.setOfficeHome(officeHome); + if (logger.isErrorEnabled()) + { + logger.error("Unable to pre-initialise JodConverter library. " + + "The following error is shown for informational purposes only.", isx); + } + return; } - if (portNumbers != null && portNumbers.length != 0) + catch (OfficeException ox) { - defaultOfficeMgrConfig.setPortNumbers(portNumbers); + if (logger.isErrorEnabled()) + { + logger.error("Unable to start JodConverter library. " + + "The following error is shown for informational purposes only.", ox); + } + + // We need to let it continue (comment-out return statement) even if an error occurs. See MNT-13706 and associated issues. + //return; } - if (taskExecutionTimeout != null && taskExecutionTimeout > 0) + catch (Exception x) { - defaultOfficeMgrConfig.setTaskExecutionTimeout(taskExecutionTimeout); + if (logger.isErrorEnabled()) + { + logger.error("Unexpected error in configuring or starting the JodConverter library." + + "The following error is shown for informational purposes only.", x); + } + return; } - if (taskQueueTimeout != null && taskQueueTimeout > 0) - { - defaultOfficeMgrConfig.setTaskQueueTimeout(taskQueueTimeout); - } - if (templateProfileDir != null) - { - defaultOfficeMgrConfig.setTemplateProfileDir(templateProfileDir); - } - if (connectTimeout != null) - { - defaultOfficeMgrConfig.setConnectTimeout(connectTimeout); - } - // Try to configure and start the JodConverter library. - officeManager = defaultOfficeMgrConfig.buildOfficeManager(); - officeManager.start(); - } - catch (IllegalStateException isx) - { - if (logger.isErrorEnabled()) - { - logger.error("Unable to pre-initialise JodConverter library. " - + "The following error is shown for informational purposes only.", isx); - } - return; - } - catch (OfficeException ox) - { - if (logger.isErrorEnabled()) - { - logger.error("Unable to start JodConverter library. " - + "The following error is shown for informational purposes only.", ox); - } - - // We need to let it continue (comment-out return statement) even if an error occurs. See MNT-13706 and associated issues. - //return; - } - catch (Exception x) - { - if (logger.isErrorEnabled()) - { - logger.error("Unexpected error in configuring or starting the JodConverter library." - + "The following error is shown for informational purposes only.",x); - } - return; } // If any exceptions are thrown in the above code, then isAvailable diff --git a/src/main/resources/alfresco/subsystems/OOoJodconverter/default/jodconverter-context.xml b/src/main/resources/alfresco/subsystems/OOoJodconverter/default/jodconverter-context.xml index b13acb5744..d628a278cd 100644 --- a/src/main/resources/alfresco/subsystems/OOoJodconverter/default/jodconverter-context.xml +++ b/src/main/resources/alfresco/subsystems/OOoJodconverter/default/jodconverter-context.xml @@ -2,8 +2,11 @@ + + ${jodconverter.url} + - ${jodconverter.officeHome} + ${jodconverter.officeHome} ${jodconverter.maxTasksPerProcess} diff --git a/src/main/resources/alfresco/subsystems/fileServers/default/file-servers.properties b/src/main/resources/alfresco/subsystems/fileServers/default/file-servers.properties index 91fd39bec2..f01c998059 100644 --- a/src/main/resources/alfresco/subsystems/fileServers/default/file-servers.properties +++ b/src/main/resources/alfresco/subsystems/fileServers/default/file-servers.properties @@ -21,7 +21,7 @@ filesystem.setReadOnlyFlagOnFolders=false ### CIFS Server Configuration ### -cifs.enabled=true +cifs.enabled=false cifs.serverName=${localname}A cifs.domain= cifs.broadcast=255.255.255.255 @@ -74,7 +74,7 @@ cifs.pseudoFiles.shareURL.enabled=true cifs.pseudoFiles.shareURL.fileName=__Share.url ### FTP Server Configuration ### -ftp.enabled=true +ftp.enabled=false ftp.port=21 # Timeout for socket, that is waiting response from client ftp.sessionTimeout=5000