- Timestamp:
- 2010-08-17T11:55:39+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/PowerPointPlugin.pm
r22597 r22640 28 28 package PowerPointPlugin; 29 29 30 use ConvertBinaryFile;30 use OOConvertBinaryFile; 31 31 32 32 use strict; … … 35 35 use gsprintf 'gsprintf'; 36 36 37 # @ISA dynamically configured to be either OpenOfficeConverter or ConvertBinaryFile38 39 # do not initialise these variables40 my $openoffice_ext_installed;41 my $openoffice_ext_working;42 37 sub 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'); 64 39 } 65 40 … … 100 75 ]; 101 76 102 my $opt_openoffice_args =103 [ { 'name' => "openoffice_scripting",104 'desc' => "{OpenOfficeConverter.openoffice_scripting}",105 'type' => "flag",106 'reqd' => "no" } ];107 108 77 my $options = { 'name' => "PowerPointPlugin", 109 78 'desc' => "{PowerPointPlugin.desc}", … … 118 87 push(@$pluginlist, $class); 119 88 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 130 89 if ($ENV{'GSDLOS'} =~ m/^windows$/i) { 131 90 push(@$arguments,@$opt_windows_args); 132 91 } 133 if ($openoffice_ext_working) {134 push(@$arguments,@$opt_openoffice_args);135 }136 92 137 93 push(@{$hashArgOptLists->{"ArgList"}},@{$arguments}); … … 139 95 140 96 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); 149 98 150 99 if ($self->{'info_only'}) { … … 176 125 #these are passed through to gsConvert.pl by ConvertBinaryFile.pm 177 126 $self->{'convert_options'} = "-windows_scripting" if $self->{'windows_scripting'}; 178 $self->{'convert_options'} = "-openoffice_scripting" if $self->{'openoffice_scripting'};179 127 180 128 # set convert_to_plugin and convert_to_ext 181 $self-> ConvertBinaryFile::set_standard_convert_settings();129 $self->set_standard_convert_settings(); 182 130 183 131 my $secondary_plugin_name = $self->{'convert_to_plugin'};
Note:
See TracChangeset
for help on using the changeset viewer.