Index: /main/trunk/greenstone2/perllib/plugins/ConvertBinaryFile.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/ConvertBinaryFile.pm	(revision 31760)
+++ /main/trunk/greenstone2/perllib/plugins/ConvertBinaryFile.pm	(revision 31761)
@@ -496,4 +496,48 @@
 
 }
+
+# This sub is shared across PowerPointPlugin and UnknownConverterPlugin,
+# so it's been copied into here from the former.
+sub generate_item_file {
+    my $self = shift(@_);
+    my ($input_filename) = @_;
+    my $outhandle = $self->{'outhandle'};
+    my ($tailname, $dirname, $suffix)
+	= &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$");
+
+    my $plugin_name = $self->{'plugin_type'}; # inherited from BaseImporter
+
+    # find all the files in the directory
+    if (!opendir (DIR, $dirname)) {
+	print $outhandle "$plugin_name: Couldn't read directory $dirname\n";
+	return $input_filename;
+    }
+
+    my @dir = readdir (DIR);
+    closedir (DIR);
+
+    # start the item file
+    my $itemfile_name = &util::filename_cat($dirname, "$tailname.item");
+
+    # encoding specification????
+    if (!open (ITEMFILE, ">$itemfile_name")) {
+	print $outhandle "$plugin_name: Couldn't open $itemfile_name for writing\n";
+    }
+    print ITEMFILE "<GeneratedBy>$plugin_name\n";
+    # print the first page
+    my @sorted_dir = sort alphanum_sort @dir;
+    for (my $i = 0; $i < scalar(@sorted_dir); $i++) {
+	my $file = $sorted_dir[$i];
+	if ($file =~ /^img(\d+)\.jpg$/) {
+	    my $num = $1;
+	    $self->tidy_up_html(&util::filename_cat($dirname, "text$num.html"));
+	    print ITEMFILE "$num:img$num.jpg:text$num.html:\n";
+	}
+    }
+    close ITEMFILE;
+    return $itemfile_name;
+
+}
+
 1;
 
Index: /main/trunk/greenstone2/perllib/plugins/PowerPointPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/PowerPointPlugin.pm	(revision 31760)
+++ /main/trunk/greenstone2/perllib/plugins/PowerPointPlugin.pm	(revision 31761)
@@ -398,47 +398,4 @@
 }
 
-sub generate_item_file
-{
-    my $self = shift(@_);
-    my ($input_filename) = @_;
-    my $outhandle = $self->{'outhandle'};
-    my ($tailname, $dirname, $suffix)
-	= &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$");
-
-    my $plugin_name = $self->{'plugin_type'};
-
-    # find all the files in the directory
-    if (!opendir (DIR, $dirname)) {
-	print $outhandle "$plugin_name: Couldn't read directory $dirname\n";
-	return $input_filename;
-    }
-
-    my @dir = readdir (DIR);
-    closedir (DIR);
-
-    # start the item file
-    my $itemfile_name = &util::filename_cat($dirname, "$tailname.item");
-
-    # encoding specification????
-    if (!open (ITEMFILE, ">$itemfile_name")) {
-	print $outhandle "$plugin_name: Couldn't open $itemfile_name for writing\n";
-    }
-    print ITEMFILE "<GeneratedBy>$plugin_name\n";
-    # print the first page
-    my @sorted_dir = sort alphanum_sort @dir;
-    for (my $i = 0; $i < scalar(@sorted_dir); $i++) {
-	my $file = $sorted_dir[$i];
-	if ($file =~ /^img(\d+)\.jpg$/) {
-	    my $num = $1;
-	    $self->tidy_up_html(&util::filename_cat($dirname, "text$num.html"));
-	    print ITEMFILE "$num:img$num.jpg:text$num.html:\n";
-	}
-    }
-    close ITEMFILE;
-    return $itemfile_name;
-
-    
-}
-
 # want to sort img1, img2, ...img10, img11 etc.
 sub alphanum_sort {
Index: /main/trunk/greenstone2/perllib/plugins/UnknownConverterPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/UnknownConverterPlugin.pm	(revision 31760)
+++ /main/trunk/greenstone2/perllib/plugins/UnknownConverterPlugin.pm	(revision 31761)
@@ -45,5 +45,7 @@
 # At present, a file or folder of files is assumed.
 # Need to look in there for files with extension process_ext.
-# Support html_multi as output? Then a folder of html files is generated per document? OR Flag that indicates whether an html file + associated folder (such as of images) gets generated. And name of assoc folder. Such output gets generated for instance when a doc file is replaced by its html version.
+# Do we also need a html_multi option to convert_to? Support html_multi as output?
+# Then a folder of html files is generated per document? 
+# OR Flag that indicates whether an html file + associated folder (such as of images) gets generated. And name of assoc folder. Such output gets generated for instance when a doc file is replaced by its html version.
 
 sub BEGIN {
@@ -75,10 +77,5 @@
 	'reqd' => "yes",
 	'list' => $convert_to_list, 
-	'deft' => "text" },
-      { 'name' => "output_file_or_dir_name",
-	'desc' => "{UnknownConverterPlugin.output_file_or_dir_name}",
-	'type' => "string",
-	'reqd' => "no",
-	'deft' => "" } ];
+	'deft' => "text" } ];
 
 my $options = { 'name'     => "UnknownConverterPlugin",
@@ -292,9 +289,14 @@
     } else {
 	$cmd =~ s@OUTPUT@\"$output_filename\"@g;
-    }   
-
-    print STDERR "@@@@ $plugin_name: executing conversion cmd \n|$cmd|\n";
-    print STDERR "   on infile |$input_filename|\n";
-    print STDERR "   to produce expected $output_filename\n";
+    }
+
+    # Some debugging
+    if ($self->{'verbosity'} > 2) {
+	print STDERR "$plugin_name: executing conversion cmd \n|$cmd|\n";
+	print STDERR "   on infile |$input_filename|\n";
+	print STDERR "   to produce expected $output_filename\n";
+    }
+
+    # Run the command at last
     my $status = system($cmd);
 
@@ -326,5 +328,5 @@
     # if multiple images were generated by running the conversion
     if ($self->{'convert_to'} =~ /^pagedimg/) {
-	my $item_filename = $self->generate_item_file($output_filename); #my $item_filename = $self->generate_item_file($output_file_or_dir);
+	my $item_filename = $self->generate_item_file($output_filename);
 
 	if (!-e $item_filename) {
@@ -338,5 +340,5 @@
     $self->{'output_filename'} = $output_filename;
     
-    return $output_filename; #$output_file_or_dir;
+    return $output_filename;
 }
 
@@ -463,44 +465,4 @@
 }
 
-# do we also need a html_multi option to convert_to?
-# move the following, copied from PPT Plugin, into parent ConvertBinaryPlugin, as it's now shared
-sub generate_item_file {
-    my $self = shift(@_);
-    my ($input_filename) = @_;
-    my $outhandle = $self->{'outhandle'};
-    my ($tailname, $dirname, $suffix)
-	= &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$");
-
-    my $plugin_name = $self->{'plugin_type'}; # inherited from BaseImporter
-
-    # find all the files in the directory
-    if (!opendir (DIR, $dirname)) {
-	print $outhandle "$plugin_name: Couldn't read directory $dirname\n";
-	return $input_filename;
-    }
-
-    my @dir = readdir (DIR);
-    closedir (DIR);
-
-    # start the item file
-    my $itemfile_name = &util::filename_cat($dirname, "$tailname.item");
-
-    # encoding specification????
-    if (!open (ITEMFILE, ">$itemfile_name")) {
-	print $outhandle "$plugin_name: Couldn't open $itemfile_name for writing\n";
-    }
-    print ITEMFILE "<GeneratedBy>$plugin_name\n";
-    # print the first page
-    my @sorted_dir = sort alphanum_sort @dir;
-    for (my $i = 0; $i < scalar(@sorted_dir); $i++) {
-	my $file = $sorted_dir[$i];
-	if ($file =~ /^img(\d+)\.jpg$/) {
-	    my $num = $1;
-	    $self->tidy_up_html(&util::filename_cat($dirname, "text$num.html"));
-	    print ITEMFILE "$num:img$num.jpg:text$num.html:\n";
-	}
-    }
-    close ITEMFILE;
-    return $itemfile_name;
-
-}
+
+1;
