Changeset 22704 for gs2-extensions/open-office-src/trunk
- Timestamp:
- 2010-08-21T23:27:41+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/open-office-src/trunk/perllib/plugins/OpenOfficeConverter.pm
r22701 r22704 84 84 } 85 85 86 #my $arguments = [ 87 # { 'name' => "openoffice_port", 88 # 'desc' => "{OpenOfficeConverter.openoffice_port}", 89 # 'type' => "int", 90 # 'deft' => "8100", 91 # 'range' => "81,", 92 # 'reqd' => "no" }, 93 # ]; 94 95 my $arguments = [ ]; 86 my $arguments = [ 87 { 'name' => "openoffice_port", 88 'desc' => "{OpenOfficeConverter.openoffice_port}", 89 'type' => "int", 90 'deft' => "8100", 91 'range' => "81,", 92 'reqd' => "no" }, 93 ]; 96 94 97 95 … … 117 115 return bless $self, $class; 118 116 } 117 if (!$openoffice_conversion_available) { 118 $self->{'no_openoffice_conversion_reason'} = $no_openoffice_conversion_reason; 119 120 my $outhandle = $self->{'outhandle'}; 121 &gsprintf($outhandle, "OpenOfficeConverter: {OpenOfficeConverter.noconversionavailable} ({OpenOfficeConverter.$no_openoffice_conversion_reason})\n"); 122 } 123 124 $self->{'openoffice_conversion_available'} = $openoffice_conversion_available; 125 126 return bless $self, $class; 127 128 } 129 130 sub init { 131 my $self = shift(@_); 132 my ($verbosity, $outhandle, $failhandle) = @_; 133 119 134 if ($openoffice_conversion_available) { 120 # my $oo_port = $self->{'openoffice_port'}; 121 my $oo_port = 8100; 135 my $oo_port = $self->{'openoffice_port'}; 122 136 123 137 my $launch_cmd = "soffice"; 124 138 $launch_cmd .= " \"-accept=socket,host=localhost,port=$oo_port;urp;StarOffice.ServiceManager\""; 125 139 $launch_cmd .= " -headless"; 126 127 140 $self->{'openoffice_launch_cmd'} = $launch_cmd; 128 141 } 129 else {130 $self->{'no_openoffice_conversion_reason'} = $no_openoffice_conversion_reason;131 132 my $outhandle = $self->{'outhandle'};133 &gsprintf($outhandle, "OpenOfficeConverter: {OpenOfficeConverter.noconversionavailable} ({OpenOfficeConverter.$no_openoffice_conversion_reason})\n");134 }135 136 $self->{'openoffice_conversion_available'} = $openoffice_conversion_available;137 138 return bless $self, $class;139 140 }141 142 sub init {143 my $self = shift(@_);144 my ($verbosity, $outhandle, $failhandle) = @_;145 142 146 143 $self->{'ootmp_file_paths'} = (); … … 161 158 # check the filename 162 159 return 0 if ( !-f $source_file_full_path); 160 161 my $outhandle = $self->{'outhandle'}; 162 my $verbosity = $self->{'verbosity'}; 163 163 164 164 my $source_file_no_path = &File::Basename::basename($source_file_full_path); … … 181 181 # Generate and run the convert command 182 182 my $convert_command = "oo2html \"$source_file_full_path\" \"$target_file_path\""; 183 print STDERR "convert_command = $convert_command\n"; 183 if ($verbosity>2) { 184 print $outhandle "Convert command: $convert_command\n"; 185 } 186 184 187 my $print_info = { 'message_prefix' => "OpenOffice Conversion", 185 188 'message' => "Converting $source_file_no_path to: $target_file_type" };
Note:
See TracChangeset
for help on using the changeset viewer.