cancel
Showing results for 
Search instead for 
Did you mean: 

decoupling OpenOffice and Alfresco

dmakovey
Champ in-the-making
Champ in-the-making
I've got a dilemma: installing Alfresco as WAR on the server we used J2EE stack provided by JPackage team using SUN's JVM etc (it's a requirement). However since we're running RedHat and they ship now their own re-packaged JPackage stack using gcj to compile "natively" we avoid any RedHat Java-related packages. Now, to install OpenOffice on RedHat you need to install some libraries that create conflict between JPackage installed libraries and RedHat's repackaged ones. To eliminate this problem it seems the most natural solution would be to decouple Alfresco and OpenOffice and deploy them on 2 separate machines.

Now Alfresco expects OpenOffice to be on 127.0.0.1:8100 but OO sits on 192.168.1.22:8100 . How do I configure Alfresco to access OpenOffice remotely on 192.168.1.22:8100? (for now I'm doing ssh port forwarding, however it's a workaround - I'd rather configure Alfresco to do "the right thing")

Is decoupling approach even feasible? Is there a strict requirement for OO to be on the same machine as Alfresco? Having it decoupled I can (I think) recycle same OO instance for several instances of Alfresco.
9 REPLIES 9

jottley
Confirmed Champ
Confirmed Champ
Yes, this is possible.

On the remote machine, in the script for starting OpenOffice use something like: (my path is for Mac OS X, replace it for Linux)

'/Applications/OpenOffice.org 2.3.app/Contents/MacOS/soffice' "-accept=socket,host=156.124.12.101,port=8100;urp;StarOffice.ServiceManager" -nologo -headless &

Note the host and port arguments.

In Alfresco, under the extensions directory (ex. tomcat/shared/classes/alfresco/extension)

create a custom-content-services-context.xml file

insert into the file:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

        <bean id="openOfficeConnection" class="net.sf.jooreports.openoffice.connection.SocketOpenOfficeConnection">
                <constructor-arg type="java.lang.String" value="156.124.12.101"/>
                <constructor-arg type="int" value="8100"/>
        </bean>

</beans>

Again note the address (which can be IP or DNS) and the port

dmakovey
Champ in-the-making
Champ in-the-making
awesome. It worked as expected. Thanks for quick reply! Smiley Happy

dmakovey
Champ in-the-making
Champ in-the-making
is it me or is Enterprise 2.1.2 doesn't send documents over TCP anymore? I can swear 2.1.1 did send stuff over TCP (I ran a quick test originally and I *never* had OO running on the same machine before) and it worked at least once.

jottley
Confirmed Champ
Confirmed Champ
Are you getting an error?  Can you post it?

dmakovey
Champ in-the-making
Champ in-the-making
Alfresco WebUI error:



Please correct the errors below then click OK.

    * A system error happened during the operation: Content conversion failed: reader: ContentAccessor[ contentUrl=store://2008/4/28/14/41/73526caf-1563-11dd-8825-f113fc91d4b3.bin, mimetype=application/msword, size=65024, encoding=UTF-8, locale=en_US] writer: ContentAccessor[ contentUrl=store://2008/4/28/14/41/73875f63-1563-11dd-8825-f113fc91d4b3.bin, mimetype=application/pdf, size=0, encoding=UTF-8, locale=en_US] options: {}

Tcpdump:


        …..
        0x0040:  044e 6669 6c65 3a2f 2f2f 7661 722f 746d  .Nfile:///var/tm
        0x0050:  702f 746f 6d63 6174 362f 416c 6672 6573  p/tomcat6/Alfres
        0x0060:  636f 2f4f 7065 6e4f 6666 6963 6543 6f6e  co/OpenOfficeCon
        0x0070:  7465 6e74 5472 616e 7366 6f72 6d65 722d  tentTransformer-
        0x0080:  736f 7572 6365 2d36 3534 3932 2e64 6f63  source-65492.doc
        0x0090:  065f 626c 616e 6b00 0000 0002 0852 6561  ._blank……Rea
        0x00a0:  644f 6e6c 7900 0000 0002 0100 0000 0006  dOnly………..
        0x00b0:  4869 6464 656e 0000 0000 0201 0000 0000  Hidden……….

        …..

        0x0040:  2355 524c 2073 6565 6d73 2074 6f20 6265  #URL.seems.to.be
        0x0050:  2061 6e20 756e 7375 7070 6f72 7465 6420  .an.unsupported.
        0x0060:  6f6e 652e 0000 0300 01                   one……

got more tcpdump so in case if that's needed I can post it externally as a raw file for further inspection.

jottley
Confirmed Champ
Confirmed Champ
Are you using a trial version on enterprise trial.  I am wondering about the read only information there…..

dmakovey
Champ in-the-making
Champ in-the-making
As far as I can tell - it's a full enterprise edition.

14:38:53,813 INFO  [service.descriptor.DescriptorService] Alfresco license: Enterprise Network granted to Enterprise Network License Holder (does not expire)
14:38:53,813 INFO  [service.descriptor.DescriptorService] Alfresco started (Enterprise Network): Current version 2.1.2 (268) schema 81 - Installed version 2.1.2 (268) schema 81
moreso - I checked and files are created just fine under /var/tmp/tomcat6 (both source .doc and destination .pdf). It's just that .pdf is 0-length.

I'm not a "pro" with OO communication etc, but could it be that ReadOnly is passed to OO just to discourage it from trying to modify original document?

dmakovey
Champ in-the-making
Champ in-the-making
Can anybody reproduce similar problem with 2.1.2E ? Should I start considering switching to 2.2.0E maybe ?

jottley
Confirmed Champ
Confirmed Champ
I've updated the wiki page with instructions to enable the remote OO transformations.

Basically, I created an AMP that will add the code to perform the transformations.  You will also need to add the remote-openoffice-context.xml file configured to reference the remote OpenOffice.