[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Coversheet Plugin Help



CAUTION: This e-mail originated outside the University of Southampton.
I've had a quick look on my server, and I may have also banged my head against this at some point.

Try adding the '$c->{executables}->{openoffice}?' line to the following places (one at a time - test, then try the next one):
~/lib/cfg.d/zzz_openoffice_test.pl
~/lib/syscfg.d/zzz_openoffice_test.pl
~/archives/ARCHIVEID/cfg/cfg.d/zzz_openoffice_test.pl

Do any of them change the behaviour?

I think I managed to get it working with the ~/lib/cfg.d/ one - but I wasn't 100% sure why?
I've also got the change David suggests in that file:-
$c->{executables}->{uno_converter} = "$c->{archiveroot}/bin/DocumentConverter.py";

Hope this gets another step along the way!
Cheers,
John

From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of David R Newman via Eprints-tech
Sent: 06 October 2021 20:24
To: James Kerwin <jkerwin2101 at gmail.com>; John Salter <J.Salter at leeds.ac.uk>
Cc: eprints-tech at ecs.soton.ac.uk
Subject: Re: [EP-tech] Coversheet Plugin Help


Hi James,

This is very odd.  You are basically saying I print out the variable $oo_cmd and then a few lines later the unless statement causes a return with undef as the "defined $oo_cmd" clause is not satisfied.  I would advise using "print STDERR" rather than just print as this could lead to problems.  However, not anything I can think should lead to the oddity you have reported.

Do you get past the line:

return undef if( $oo_cmd =~ /\$\([a-z]*\)/i );

As you do not have another log line.  I would assume not as the prior unless statement suggests $oo_cmd is not set somehow.

I very much suspect if I was fixing this problem, I would be banging my head against a wall for a while.  There are numerous things I would try but I think it would take forever for me to say, try A and tell me what happens and them I might suggest B or C depending on the result.  If I was doing this on my own EPrints instance if it had this issue, I could get to the end of the alphabet quite quickly but trying to do this over email, we could still be here next week and not really any further forward.  So for now my best suggestions are to switch to "print STDERR" and add another log line after the penultimate return statement.

Regards

David Newman
On 06/10/2021 19:59, James Kerwin wrote:
CAUTION: This e-mail originated outside the University of Southampton.
Right, I've done the unthinkable and edited OpenOffice.pm in plugins/EPrints/Plugin/OpenOffice.pm in order to see why I'm getting the "OpenOffice executable not found" in the openoffice.log. Using some imaginative logs and prints I've determined that something is happening in my:

sub get_command (starts around line 394). It gets through the if/else and comes out with the bits it needs. According to my print statements the relevant variables are:

$oo_path = /opt/openoffice.org3/program/soffice.bin
$oo_cmd = $(openoffice) "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -norestore -nofirststartwizard -nologo -headless

This is what I expect looking at the conf files. Then for some reason at line 412 it fails and returns undef to  "sub new" at line  131 and subsequently fails and gives my error mentioned above.

If I delete "&& defined $oo_cmd" from :

Line 412: return undef unless( defined $oo_path && defined $oo_cmd && (-e $oo_path) );

It progresses to my other log phrases I'm using to track progression (HERE One and HERE TWO):

sub get_command
{
my( $self ) = @_;

my ( $oo_path, $oo_cmd );

if( defined $self->{session} )
{
# Attempt to read the paths from a local conf file
$oo_path = $self->{session}->config( 'executables', 'openoffice' );
$oo_cmd = $self->{session}->config( 'invocation', 'openoffice' );
}
else
{
$oo_path = EPrints::Config::get( "executables" )->{"openoffice"};
$oo_cmd = EPrints::Config::get( "invocation" )->{"openoffice"};
}
#my $dog = "Bonnie";
print "\n";
print $oo_path;
print "\n";
print $oo_cmd;

$self->log( "HERE THREE" );
return undef unless( defined $oo_path && defined $oo_cmd && (-e $oo_path) );
$self->log( "HERE ONE" );
$oo_cmd =~ s/\$\(([a-z]*)\)/quotemeta($oo_path)/gei;
$self->log( "HERE TWO" );
return undef if( $oo_cmd =~ /\$\([a-z]*\)/i );

return $oo_cmd;
}