Index: /main/trunk/greenstone2/bin/script/gsConvert.pl
===================================================================
--- /main/trunk/greenstone2/bin/script/gsConvert.pl	(revision 22641)
+++ /main/trunk/greenstone2/bin/script/gsConvert.pl	(revision 22642)
@@ -67,5 +67,4 @@
 my $pdf_allow_images_only;
 my $windows_scripting;
-my $openoffice_scripting;
 
 sub print_usage
@@ -75,10 +74,5 @@
     print STDERR "              or text using third-party programs.\n\n";
     print STDERR "  usage: $0 [options] filename\n";
-    if ($openoffice_scripting) {
-	print STDERR "  options:\n\t-type\tdoc|dot|docx|odf|pdf|ps|ppt|rtf|xls\t(input file type)\n";
-    }
-    else {
-	print STDERR "  options:\n\t-type\tdoc|dot|pdf|ps|ppt|rtf|xls\t(input file type)\n";
-    }
+    print STDERR "  options:\n\t-type\tdoc|dot|pdf|ps|ppt|rtf|xls\t(input file type)\n";
     print STDERR "\t-errlog\t<filename>\t(append err messages)\n";
     print STDERR "\t-output\tauto|html|text|pagedimg_jpg|pagedimg_gif|pagedimg_png\t(output file type)\n";
@@ -86,5 +80,4 @@
     print STDERR "\t-use_strings\tuse strings to extract text if conversion fails\n";
     print STDERR "\t-windows_scripting\tuse windows VB script (if available) to convert Microsoft Word and PPT documents\n";
-    print STDERR "\t-openoffice_scripting\tuse OpenOffice (if available) to convert Microsoft Office documents \n";
     print STDERR "\t-pdf_complex\tuse complex output when converting PDF to HTML\n";
     print STDERR "\t-pdf_nohidden\tDon't attempt to extract hidden text from PDF files\n";
@@ -106,25 +99,7 @@
 
     
-    # scan for -openoffice_scripting as it effects the permissible
-    # values for -type
-
-    foreach my $a (@ARGV) {
-	if ($a =~ m/^-openoffice_scripting$/) {
-	    $openoffice_scripting = 1;
-	    last;
-	}
-    }
-
-    my $parse_type;
-    if ($openoffice_scripting) {
-	$parse_type = 'type/(doc|dot|docx|odf|pdf|ps|ppt|rtf|xls)/';
-    }
-    else {
-	$parse_type = 'type/(doc|dot|pdf|ps|ppt|rtf|xls)/';
-    }
-
     # read command-line arguments
     if (!parsargv::parse(\@ARGV,
-			 $parse_type, \$input_type,
+			 'type/(doc|dot|pdf|ps|ppt|rtf|xls)/', \$input_type,
 			 '/errlog/.*/', \$faillogfile,
 			 'output/(auto|html|text|pagedimg).*/', \$output_type,
@@ -132,5 +107,4 @@
 			 'verbose/\d+/0', \$verbose,
 			 'windows_scripting',\$windows_scripting,
-			 'openoffice_scripting',\$openoffice_scripting,
 			 'use_strings', \$use_strings,
 			 'pdf_complex', \$pdf_complex,
@@ -173,8 +147,4 @@
 	print STDERR "Error: No filename extension or input type defined\n";
 	exit(1);
-    } 
-    elsif ($openoffice_scripting && (($input_type eq "docx") || ($input_type eq "odf"))) {
-	print &convertDOC($input_filename, $output_filestem, $output_type);
-	print "\n";
     } 
     elsif ($input_type eq "doc" || $input_type eq "dot") {
@@ -230,14 +200,4 @@
     my ($input_filename, $output_filestem, $output_type) = @_;
 
-    if (($openoffice_scripting) && ($input_filename =~ m/\.docx?$/i)) {
-	# Jump right in and process with Open Office
-        if (openoffice_doc_to_html($input_filename, $output_filestem)) {
-	    return "html";
-	}
-	else {
-	    return "fail";
-	}
-    }
-
     # Many .doc files are not in fact word documents!
     my $realtype = &find_docfile_type($input_filename);
@@ -262,7 +222,4 @@
 	    $success = &native_doc_to_html($input_filename, $output_filestem);
 	}
-	elsif ($openoffice_scripting) {
-	    $success = &openoffice_doc_to_html($input_filename, $output_filestem);
-	}
 	else {
 	    $success = &doc_to_html($input_filename, $output_filestem);	   
@@ -288,7 +245,4 @@
 	if ($windows_scripting) {
 	    $success = &native_doc_to_html($input_filename, $output_filestem);
-	}
-	elsif ($openoffice_scripting) {
-	    $success = &openoffice_doc_to_html($input_filename, $output_filestem);
 	}
 	else {
@@ -402,14 +356,4 @@
     my $ppt_convert_type = "";
 
-    if ($openoffice_scripting) {
-	# Jump right in and process with Open Office
-        if (openoffice_doc_to_html($input_filename, $output_filestem)) {
-	    return "html";
-	}
-	else {
-	    return "fail";
-	}
-    }
-    
     #if (!$output_type || $windows_scripting || ($output_type !~ m/html/i) || ($output_type !~ m/text/i)){
     if ($windows_scripting && ($output_type !~ m/html/i) && ($output_type !~ m/text/i)){
@@ -475,14 +419,4 @@
     my $success = 0;
 
-    if ($openoffice_scripting) {
-	# Jump right in and process with Open Office
-        if (openoffice_doc_to_html($input_filename, $output_filestem)) {
-	    return "html";
-	}
-	else {
-	    return "fail";
-	}
-    }
-    
     # Attempt conversion to HTML
     if (!$output_type || ($output_type =~ m/html/i)) {
@@ -897,89 +831,4 @@
 }
 
-# Attempt to convert a word document to html with JODConvert scripting program
-sub openoffice_doc_to_html {
-    my ($input_filename, $output_filestem) = @_;
-
-    if (-e "$output_filestem.html") {
-	print STDERR "    The conversion file:\n";
-	print STDERR "      $output_filestem.html\n";
-	print STDERR "    ... skipping\n";
-	return 1;
-    }
-
-    my $oo_script_dir = &util::filename_cat($ENV{'GEXT_OPENOFFICE'}, "bin", "script");
-    my $oo2html = &util::filename_cat($oo_script_dir,"oo2html");
-    if (!-e $oo2html) {
-	print STDERR "Error: Unable to find 'oo2html' in: \n";
-	print STDERR "       $oo_script_dir\n";
-	print STDERR "       Is the OpenOffice extension to Greenstone installed?\n";
-	return 0;
-    }
-
-    my $cmd = "";
-    if ($timeout) {$cmd = "ulimit -t $timeout;";}
-    $cmd .=  "$oo2html \"$input_filename\" \"$output_filestem.html\"";
-
-    # redirecting STDERR
-    $cmd .= " 2> \"$output_filestem.err\""
-	if ($ENV {'GSDLOS'} !~ m/^windows$/i || $is_winnt_2000);
-    
-    # execute the command
-    $!=0;
-    if (system($cmd)!=0)
-    {
-	print STDERR "Error executing oo2html converter: $!\n";
-	print STDERR "Command was: $cmd\n";
-
-	if (-s "$output_filestem.err") {
-	    open (ERRFILE, "<$output_filestem.err");
-	    
-	    my $write_to_fail_log=0;
-	    if ($faillogfile ne "" && defined(open(FAILLOG,">>$faillogfile")))
-	    {$write_to_fail_log=1;}
-
-	    my $line;
-	    while ($line=<ERRFILE>) {
-		if ($line =~ m/\w/) {
-		    print STDERR "$line";
-		    print FAILLOG "$line" if ($write_to_fail_log);
-		}
-		if ($line !~ m/startup error/) {next;}
-		print STDERR " (given an invalid .DOC file?)\n";
-		print FAILLOG " (given an invalid .DOC file?)\n"
-		if ($write_to_fail_log);
-		
-	    } # while ERRFILE
-	    close FAILLOG if ($write_to_fail_log);
-	}
-	return 0; # we can try any_to_text
-    }
-
-    # Was the conversion successful?
-    if (-s "$output_filestem.html") {
-	open(TMP, "$output_filestem.html");
-	my $line = <TMP>;
-	close(TMP);
-	if ($line && $line =~ m/html/i) {
-	    &util::rm("$output_filestem.err") if -e "$output_filestem.err";
-	    return 1;
-	}
-    }
-	
-    # If here, an error of some sort occurred
-    
-    &util::rm("$output_filestem.html") if -e "$output_filestem.html";
-    if (-e "$output_filestem.err") {
-	if ($faillogfile ne "" && defined(open(FAILLOG,">>$faillogfile"))) {
-	    open (ERRLOG,"$output_filestem.err");
-	    while (<ERRLOG>) {print FAILLOG $_;}
-	    close FAILLOG;
-	    close ERRLOG;
-	}
-	&util::rm("$output_filestem.err");
-    }
-    return 0;
-}
-
 # Attempt to convert an RTF document to html with rtftohtml
 sub rtf_to_html {
