Author: solomax
Date: Fri Oct 14 14:18:22 2016
New Revision: 1764910

URL: http://svn.apache.org/viewvc?rev=1764910&view=rev
Log:
[OPENMEETINGS-1490] jod conversion works as expected if office path is not set

Modified:
    
openmeetings/application/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
    
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
    
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java?rev=1764910&r1=1764909&r2=1764910&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
 Fri Oct 14 14:18:22 2016
@@ -29,6 +29,7 @@ import org.apache.openmeetings.db.dao.ba
 import org.apache.openmeetings.util.OmFileHelper;
 import org.apache.openmeetings.util.process.ConverterProcessResult;
 import org.apache.openmeetings.util.process.ConverterProcessResultList;
+import org.apache.wicket.util.string.Strings;
 import org.artofsolving.jodconverter.OfficeDocumentConverter;
 import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
 import org.artofsolving.jodconverter.office.OfficeException;
@@ -107,9 +108,11 @@ public class GeneratePDF {
         */
        public ConverterProcessResult doJodConvert(File fileFullPath, File 
destinationFolder, String outputfile) {
                try {
-                       String officePath = 
configurationDao.getConfValue("office.path", String.class, "");
+                       String officePath = 
configurationDao.getConfValue("office.path", String.class, null);
                        DefaultOfficeManagerConfiguration configuration = new 
DefaultOfficeManagerConfiguration();
-                       configuration.setOfficeHome(officePath);
+                       if (!Strings.isEmpty(officePath)) {
+                               configuration.setOfficeHome(officePath);
+                       }
                        OfficeManager officeManager = 
configuration.buildOfficeManager();
                        officeManager.start();
                        OfficeDocumentConverter converter = new 
OfficeDocumentConverter(officeManager);

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java?rev=1764910&r1=1764909&r2=1764910&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
 Fri Oct 14 14:18:22 2016
@@ -30,6 +30,7 @@ import org.apache.openmeetings.db.dao.ba
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
 import org.apache.openmeetings.util.process.ConverterProcessResult;
 import org.apache.openmeetings.util.process.ConverterProcessResultList;
+import org.apache.wicket.util.string.Strings;
 import org.artofsolving.jodconverter.OfficeDocumentConverter;
 import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
 import org.artofsolving.jodconverter.office.OfficeException;
@@ -74,9 +75,11 @@ public class GeneratePDF {
         */
        public ConverterProcessResult doJodConvert(File in, File out) {
                try {
-                       String officePath = 
configurationDao.getConfValue("office.path", String.class, "");
+                       String officePath = 
configurationDao.getConfValue("office.path", String.class, null);
                        DefaultOfficeManagerConfiguration configuration = new 
DefaultOfficeManagerConfiguration();
-                       configuration.setOfficeHome(officePath);
+                       if (!Strings.isEmpty(officePath)) {
+                               configuration.setOfficeHome(officePath);
+                       }
                        OfficeManager officeManager = 
configuration.buildOfficeManager();
                        officeManager.start();
                        OfficeDocumentConverter converter = new 
OfficeDocumentConverter(officeManager);

Modified: 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java?rev=1764910&r1=1764909&r2=1764910&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/documents/GeneratePDF.java
 Fri Oct 14 14:18:22 2016
@@ -30,6 +30,7 @@ import org.apache.openmeetings.db.dao.ba
 import org.apache.openmeetings.db.entity.file.FileExplorerItem;
 import org.apache.openmeetings.util.process.ConverterProcessResult;
 import org.apache.openmeetings.util.process.ConverterProcessResultList;
+import org.apache.wicket.util.string.Strings;
 import org.artofsolving.jodconverter.OfficeDocumentConverter;
 import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
 import org.artofsolving.jodconverter.office.OfficeException;
@@ -74,9 +75,11 @@ public class GeneratePDF {
         */
        public ConverterProcessResult doJodConvert(File in, File out) {
                try {
-                       String officePath = 
configurationDao.getConfValue("office.path", String.class, "");
+                       String officePath = 
configurationDao.getConfValue("office.path", String.class, null);
                        DefaultOfficeManagerConfiguration configuration = new 
DefaultOfficeManagerConfiguration();
-                       configuration.setOfficeHome(officePath);
+                       if (!Strings.isEmpty(officePath)) {
+                               configuration.setOfficeHome(officePath);
+                       }
                        OfficeManager officeManager = 
configuration.buildOfficeManager();
                        officeManager.start();
                        OfficeDocumentConverter converter = new 
OfficeDocumentConverter(officeManager);


Reply via email to