Changeset 22640

Show
Ignore:
Timestamp:
17.08.2010 11:55:39 (9 years ago)
Author:
kjdon
Message:

now uses new OOConvertBInaryFile super class

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/PowerPointPlugin.pm

    r22597 r22640  
    2828package PowerPointPlugin; 
    2929 
    30 use ConvertBinaryFile; 
     30use OOConvertBinaryFile; 
    3131 
    3232use strict; 
     
    3535use gsprintf 'gsprintf'; 
    3636 
    37 # @ISA dynamically configured to be either OpenOfficeConverter or ConvertBinaryFile 
    38  
    39 # do not initialise these variables 
    40 my $openoffice_ext_installed; 
    41 my $openoffice_ext_working; 
    4237sub BEGIN { 
    43     eval("require OpenOfficeConverter"); 
    44     if ($@) { 
    45     # Useful debugging statement if there is a syntax error in OpenOfficeConverter   
    46     #print STDERR "$@\n"; 
    47     @PowerPointPlugin::ISA = ('ConvertBinaryFile'); 
    48     $openoffice_ext_installed = 0; 
    49     $openoffice_ext_working = 0; 
    50     } 
    51     else { 
    52     # Successfully found 
    53     $openoffice_ext_installed = 1; 
    54     # now check whether it can run soffice 
    55     if ($OpenOfficeConverter::openoffice_conversion_available) { 
    56         @PowerPointPlugin::ISA = ('OpenOfficeConverter'); 
    57         $openoffice_ext_working = 1; 
    58          
    59     } else { 
    60         @PowerPointPlugin::ISA = ('ConvertBinaryFile'); 
    61         $openoffice_ext_working = 0; 
    62     } 
    63     } 
     38    @PowerPointPlugin::ISA = ('OOConvertBinaryFile'); 
    6439} 
    6540 
     
    10075      ]; 
    10176 
    102 my $opt_openoffice_args =  
    103     [ { 'name' => "openoffice_scripting", 
    104     'desc' => "{OpenOfficeConverter.openoffice_scripting}", 
    105     'type' => "flag", 
    106     'reqd' => "no" } ]; 
    107  
    10877my $options = { 'name'     => "PowerPointPlugin", 
    10978        'desc'     => "{PowerPointPlugin.desc}", 
     
    11887    push(@$pluginlist, $class); 
    11988 
    120     if ($openoffice_ext_installed) { 
    121     print STDERR "PowerPointPlugin: OpenOffice Extension to Greenstone detected\n"; 
    122     if ($openoffice_ext_working) { 
    123         print STDERR "... and it appears to be working\n"; 
    124     } else { 
    125         print STDERR "... but it appears to be broken\n"; 
    126         &gsprintf(STDERR, "OpenOfficeConverter: {OpenOfficeConverter.noconversionavailable} ({OpenOfficeConverter.$OpenOfficeConverter::no_openoffice_conversion_reason})\n"); 
    127     } 
    128     } 
    129  
    13089    if ($ENV{'GSDLOS'} =~ m/^windows$/i) { 
    13190    push(@$arguments,@$opt_windows_args); 
    13291    } 
    133     if ($openoffice_ext_working) { 
    134     push(@$arguments,@$opt_openoffice_args); 
    135     }     
    13692 
    13793    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments}); 
     
    13995 
    14096 
    141     my $self = {}; 
    142  
    143     if ($openoffice_ext_working) { 
    144     $self = new OpenOfficeConverter($pluginlist, $inputargs, $hashArgOptLists); 
    145     } 
    146     else { 
    147     $self = new ConvertBinaryFile($pluginlist, $inputargs, $hashArgOptLists); 
    148     } 
     97    my $self = new OOConvertBinaryFile($pluginlist, $inputargs, $hashArgOptLists); 
    14998  
    15099    if ($self->{'info_only'}) { 
     
    176125    #these are passed through to gsConvert.pl by ConvertBinaryFile.pm 
    177126    $self->{'convert_options'} = "-windows_scripting" if $self->{'windows_scripting'}; 
    178     $self->{'convert_options'} = "-openoffice_scripting" if $self->{'openoffice_scripting'}; 
    179127 
    180128    # set convert_to_plugin and convert_to_ext 
    181     $self->ConvertBinaryFile::set_standard_convert_settings(); 
     129    $self->set_standard_convert_settings(); 
    182130 
    183131    my $secondary_plugin_name = $self->{'convert_to_plugin'};