[OFBiz] SVN: r7266 - trunk/applications/content/src/org/ofbiz/content/openoffice

byersa@svn.ofbiz.org byersa at svn.ofbiz.org
Mon Apr 10 16:28:29 CDT 2006


Author: byersa
Date: 2006-04-10 16:28:26 -0500 (Mon, 10 Apr 2006)
New Revision: 7266

Modified:
   trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java
   trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeWorker.java
Log:
The last version broke what worked, so I am restoring what worked.


Modified: trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java
===================================================================
--- trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java	2006-04-10 20:04:16 UTC (rev 7265)
+++ trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeServices.java	2006-04-10 21:28:26 UTC (rev 7266)
@@ -82,11 +82,11 @@
             byte[] inByteArray = inByteWrapper.getBytes();
             
             // The following line work in linux, but not Windows or Mac environment. It is preferred because it does not use temporary files
-            //OpenOfficeByteArrayInputStream oobais = new OpenOfficeByteArrayInputStream(inByteArray);
+            OpenOfficeByteArrayInputStream oobais = new OpenOfficeByteArrayInputStream(inByteArray);
             //Debug.logInfo("Doing convertDocumentByteWrapper, inBytes size is [" + inByteArray.length + "]", module);
-            // OpenOfficeByteArrayOutputStream baos = OpenOfficeWorker.convertOODocByteStreamToByteStream(xmulticomponentfactory, oobais, inputMimeType, outputMimeType);
+             OpenOfficeByteArrayOutputStream baos = OpenOfficeWorker.convertOODocByteStreamToByteStream(xmulticomponentfactory, oobais, inputMimeType, outputMimeType);
             
-            
+            /*
             String tempDir = UtilProperties.getPropertyValue("content", "content.temp.dir");
             fileIn = new File(tempDir + fileInName);
             FileOutputStream fos = new FileOutputStream(fileIn);
@@ -101,7 +101,7 @@
                 baos.write(c);
             }
             fis.close();
-            
+            */
             results.put("outByteWrapper", new ByteWrapper(baos.toByteArray()));
             baos.close();
 
@@ -115,8 +115,8 @@
             Debug.logError(e, "Error in OpenOffice operation: ", module);
             return ServiceUtil.returnError(e.toString());
         } finally {
-            fileIn.delete();
-            fileOut.delete();
+            //fileIn.delete();
+           // fileOut.delete();
         }
         return results;
     }

Modified: trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeWorker.java
===================================================================
--- trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeWorker.java	2006-04-10 20:04:16 UTC (rev 7265)
+++ trunk/applications/content/src/org/ofbiz/content/openoffice/OpenOfficeWorker.java	2006-04-10 21:28:26 UTC (rev 7266)
@@ -42,7 +42,6 @@
 import com.sun.star.lang.XMultiComponentFactory;
 import com.sun.star.uno.UnoRuntime;
 import com.sun.star.uno.XComponentContext;
-import com.sun.star.comp.helper.Bootstrap;
 
 /**
  * OpenOfficeWorker Class
@@ -56,26 +55,6 @@
 
     public static final String module = OpenOfficeWorker.class.getName();
     
-    public static XMultiComponentFactory getRemoteServer_test(String host, String port) throws IOException, Exception {
-        XMultiComponentFactory xmulticomponentfactory = null;
-        String sofficepath = "file:///usr/lib/openoffice2/program";
-
-        String unoini = sofficepath + "/unorc";  // To change in uno.ini for Windows
-
-     
-
-        Hashtable params = new Hashtable();
-
-        params.put("SYSBINDIR", sofficepath);
-        //XComponentContext xComponentContext = Bootstrap.defaultBootstrap_InitialComponentContext(unoini, params);
-        XComponentContext xComponentContext = Bootstrap.bootstrap();
-
-//        XComponentContext xComponentContext = Bootstrap.bootstrap();
-        if (xComponentContext != null) {
-            xmulticomponentfactory = xComponentContext.getServiceManager();
-        }
-        return xmulticomponentfactory;
-    }
     /**
      * Use OpenOffice to convert documents between types
      */



More information about the Svn mailing list