Ignore:
Timestamp:
2012-04-03T15:33:33+12:00 (12 years ago)
Author:
ak19
Message:

Katherine discovered a bug when using the openoffice extension on CentOS. We discovered there were 2 fixes required to the perl code: SOFFICE_HOME has a new possible path (usr/lib64) and in Linux we were not starting up soffice with the correct accept string for recent updates (which were only made for windows).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/open-office/trunk/src/perllib/plugins/OpenOfficeConverter.pm

    r25218 r25334  
    6464    else {
    6565        # test to see if soffice is in path     
    66         my $cmd = "soffice -headless 2>&1"; # for linux and mac
     66
     67        if(!defined $ENV{'SOFFICE_HOST'}) {
     68        $ENV{'SOFFICE_HOST'} = "localhost";
     69        }
     70        if(!defined $ENV{'SOFFICE_PORT'}) {
     71        $ENV{'SOFFICE_PORT'} = "8100";
     72        }
     73       
     74        #my $cmd = "soffice -headless 2>&1"; # for linux and mac
     75        my $cmd = "soffice \"-accept=socket,host=$ENV{'SOFFICE_HOST'},port=$ENV{'SOFFICE_PORT'};urp;StarOffice.ServiceManager\" -headless 2>&1"; # for linux and mac
    6776        my $status = 0;
    6877
     
    7180        # The default port that jodconverter expects OO to listen on is 8100, so we try that.
    7281        if ($ENV{'GSDLOS'} =~ m/^windows$/) {       
    73         if(!defined $ENV{'SOFFICE_HOST'}) {
    74             $ENV{'SOFFICE_HOST'} = "localhost";
    75         }
    76         if(!defined $ENV{'SOFFICE_PORT'}) {
    77             $ENV{'SOFFICE_PORT'} = "8100";
    78         }
     82       
    7983        # important to have this set when the Greenstone server
    8084        # and open office is on a remote windows machine
     
    166170}
    167171
     172# launch_cmd variable seems to be entirely unused
    168173sub init {
    169174    my $self = shift(@_);
     
    252257        } elsif (-d "/usr/lib/openoffice") { # perhaps it's more likely that openoffice exists (fallback)
    253258        $office_short_path = "/usr/lib/openoffice";
     259        } elsif (-d "/usr/lib64/openoffice.org3") { # on 64 bit linux such as kjdon's CentOS
     260        $office_short_path = "/usr/lib64/openoffice.org3";
    254261        } else { # set to default linux officeHome which jodconverter tries for
    255262        $office_short_path = "/opt/openoffice.org3";
Note: See TracChangeset for help on using the changeset viewer.