Changeset 22508
- Timestamp:
- 2010-07-26T15:44:03+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/open-office/trunk/perllib/plugins/OpenOfficeConverter.pm
r22506 r22508 35 35 use gsprintf 'gsprintf'; 36 36 37 # these two variables mustn't be initialised here or they will get stuck 38 # at those values. 39 our $openoffice_conversion_available; 40 our $no_openoffice_conversion_reason; 41 37 42 BEGIN { 38 43 @OpenOfficeConverter::ISA = ('ConvertBinaryFile', 'BaseMediaConverter'); 39 }40 41 my $arguments = [ ];42 43 my $opt_arguments = [44 { 'name' => "openoffice_port",45 'desc' => "{OpenOfficeConverter.openoffice_port}",46 'type' => "int",47 'deft' => "8100",48 'range' => "81,",49 'reqd' => "no" },50 ];51 52 my $options = { 'name' => "OpenOfficeConverter",53 'desc' => "{OpenOfficeConverter.desc}",54 'abstract' => "yes",55 'inherits' => "yes",56 'args' => $arguments };57 58 sub new {59 my ($class) = shift (@_);60 my ($pluginlist,$inputargs,$hashArgOptLists) = @_;61 push(@$pluginlist, $class);62 63 44 64 45 # Check that OpenOffice and jodconverter are installed and available on 65 46 # the path 66 47 67 my$openoffice_conversion_available = 1;68 my$no_openoffice_conversion_reason = "";48 $openoffice_conversion_available = 1; 49 $no_openoffice_conversion_reason = ""; 69 50 70 51 if (! defined $ENV{'GEXT_OPENOFFICE'}) { … … 91 72 } 92 73 } 93 94 74 my $cmd = "soffice -headless 2>&1"; 95 75 … … 104 84 } 105 85 106 if ($openoffice_conversion_available) { 107 push(@$arguments,@$opt_arguments); 108 } 86 } 87 88 my $arguments = [ 89 { 'name' => "openoffice_port", 90 'desc' => "{OpenOfficeConverter.openoffice_port}", 91 'type' => "int", 92 'deft' => "8100", 93 'range' => "81,", 94 'reqd' => "no" }, 95 ]; 96 97 my $options = { 'name' => "OpenOfficeConverter", 98 'desc' => "{OpenOfficeConverter.desc}", 99 'abstract' => "yes", 100 'inherits' => "yes", 101 'args' => $arguments }; 102 103 sub new { 104 my ($class) = shift (@_); 105 my ($pluginlist,$inputargs,$hashArgOptLists) = @_; 106 push(@$pluginlist, $class); 109 107 110 108 push(@{$hashArgOptLists->{"ArgList"}},@{$arguments}); … … 113 111 my $bmc_self = new BaseMediaConverter($pluginlist, $inputargs, $hashArgOptLists,1); 114 112 my $cbf_self = new ConvertBinaryFile($pluginlist, $inputargs, $hashArgOptLists); 115 116 113 my $self = BasePlugin::merge_inheritance($bmc_self,$cbf_self); 117 114 115 if ($self->{'info_only'}) { 116 # don't worry about any options etc 117 return bless $self, $class; 118 } 118 119 if ($openoffice_conversion_available) { 119 120 my $oo_port = $self->{'openoffice_port'}; … … 129 130 my $outhandle = $self->{'outhandle'}; 130 131 &gsprintf($outhandle, "OpenOfficeConverter: {OpenOfficeConverter.noconversionavailable} ({OpenOfficeConverter.$no_openoffice_conversion_reason})\n"); 132 &gsprintf($outhandle, "OpenOfficeConverter {OpenOfficeConverter.ConvertBinaryFileDefault}\n"); 131 133 } 132 134
Note:
See TracChangeset
for help on using the changeset viewer.