Index: /gs2-extensions/open-office-src/trunk/perllib/plugins/OpenOfficeConverter.pm
===================================================================
--- /gs2-extensions/open-office-src/trunk/perllib/plugins/OpenOfficeConverter.pm	(revision 22707)
+++ /gs2-extensions/open-office-src/trunk/perllib/plugins/OpenOfficeConverter.pm	(revision 22708)
@@ -153,9 +153,13 @@
 sub convert {
     my $self = shift(@_);
-    my ($source_file_full_path, $target_file_type) = @_;
-
-    return 0 unless $openoffice_conversion_available;
+    my $source_file_full_path = shift(@_);
+    my $target_file_type      = shift(@_);
+    my $convert_options       = shift(@_) || "";
+    my $convert_id            = shift(@_) || "";
+    my $cache_mode            = shift(@_) || "";
+
+    return (0,undef,undef) unless $openoffice_conversion_available;
     # check the filename
-    return 0 if ( !-f $source_file_full_path);
+    return (0,undef,undef) if ( !-f $source_file_full_path);
 
     my $outhandle = $self->{'outhandle'};
@@ -169,5 +173,5 @@
 	my $cache_dir = $self->{'cached_dir'};
 	my $file_root = $self->{'cached_file_root'};
-	#$file_root .= "_$convert_id" if ($convert_id ne "");
+	$file_root .= "_$convert_id" if ($convert_id ne "");
 	my $target_file = "$file_root.$target_file_type";
 	$target_file_path = &util::filename_cat($cache_dir,$target_file);
@@ -180,15 +184,22 @@
 
     # Generate and run the convert command
-    my $convert_command = "oo2html \"$source_file_full_path\" \"$target_file_path\"";
+    my $jodjar;
+
+    my $gextoo_home = $ENV{'GEXT_OPENOFFICE'};
+    my $jodjar = &util::filename_cat($gextoo_home,"lib","java","jodconverter.jar");
+
+    my $convert_cmd = "java -jar \"$jodjar\"";
+    $convert_cmd .= " \"$source_file_full_path\" \"$target_file_path\"";
+
     if ($verbosity>2) {
-	print $outhandle "Convert command: $convert_command\n";
+	print $outhandle "Convert command: $convert_cmd\n";
     }
 
     my $print_info = { 'message_prefix' => "OpenOffice Conversion",
 		       'message' => "Converting $source_file_no_path to: $target_file_type" };
-    #$print_info->{'cache_mode'} = $cache_mode if ($cache_mode ne "");
+    $print_info->{'cache_mode'} = $cache_mode if ($cache_mode ne "");
 
     my ($regenerated,$result,$had_error) 
-	= $self->autorun_general_cmd($convert_command,$source_file_full_path, $target_file_path,$print_info);
+	= $self->autorun_general_cmd($convert_cmd,$source_file_full_path, $target_file_path,$print_info);
     if ($had_error) {
 	return (0, $result,$target_file_path);
@@ -198,52 +209,11 @@
 
 
-
-sub convert_orig {
-    my $self = shift(@_);
+sub convert_without_result {
+    my $self = shift(@_);
+
     my $source_file_path = shift(@_);
     my $target_file_type = shift(@_);
     my $convert_options  = shift(@_) || "";
     my $convert_id       = shift(@_) || "";
-    my $cache_mode       = shift(@_) || "";
-
-    my $outhandle = $self->{'outhandle'};
-    my $verbosity = $self->{'verbosity'};
-
-    my $source_file_no_path = &File::Basename::basename($source_file_path);
-
-    # Determine the full name and path of the output file
-    my $target_file_path;
-    if ($self->{'enable_cache'}) {
-	my $cached_image_dir = $self->{'cached_dir'};
-	my $image_root = $self->{'cached_file_root'};
-	$image_root .= "_$convert_id" if ($convert_id ne "");
-	my $image_file = "$image_root.$target_file_type";
-	$target_file_path = &util::filename_cat($cached_image_dir,$image_file);
-    }
-    else {
-	$target_file_path = &util::get_tmp_filename($target_file_type);
-	push(@{$self->{'ootmp_file_paths'}}, $target_file_path);
-    }
-
-    # Generate and run the convert command
-    my $convert_command = "oo2html $convert_options \"$source_file_path\" \"$target_file_path\"";
-
-    my $print_info = { 'message_prefix' => $convert_id,
-		       'message' => "Converting $source_file_no_path to: $convert_id $target_file_type" };
-    $print_info->{'cache_mode'} = $cache_mode if ($cache_mode ne "");
-
-    my ($regenerated,$result,$had_error) 
-	= $self->autorun_general_cmd($convert_command,$target_file_path,$print_info);
-
-    return ($result,$target_file_path);
-}
-
-sub convert_without_result {
-    my $self = shift(@_);
-
-    my $source_file_path = shift(@_);
-    my $target_file_type = shift(@_);
-    my $convert_options  = shift(@_) || "";
-    my $convert_id       = shift(@_) || "";
 
     return $self->convert($source_file_path,$target_file_type,
