Index: /main/trunk/greenstone2/perllib/extrametautil.pm
===================================================================
--- /main/trunk/greenstone2/perllib/extrametautil.pm	(revision 36372)
+++ /main/trunk/greenstone2/perllib/extrametautil.pm	(revision 36373)
@@ -100,77 +100,4 @@
 }
 
-#----------------------------------------------
-#### unused below here
-
-# Unused. Added for symmetry
-sub addmetadata_UNUSED {
-	my ($extrametadata, $filename_re_for_metadata, $value) = @_;	
-	my $metanames = $extrametadata->{$filename_re_for_metadata};
-	push(@$metanames, $value);
-}
-
-# Unused. Added for symmetry
-sub addmetafile_UNUSED {
-	my ($extrametafile, $filename_re_for_metadata, $file) = @_;	
-	my $metafiles = $extrametafile->{$filename_re_for_metadata};
-	push(@$metafiles, $file);
-}
-
-sub addmetadata_for_named_metaname_OLD { # e.g. push(@{$extrametadata->{$filename_re_for_metadata}->{$field_name}}, $value);
-	my ($extrametadata, $filename_re_for_metadata, $field_name, $value) = @_;
-	my $metaname_vals = $extrametadata->{$filename_re_for_metadata}->{$field_name};
-	push(@$metaname_vals, $value); 
-}
-
-# Unused. Added for symmetry
-sub addmetafile_for_named_file_UNUSED {	
-	my ($extrametafile, $filename_re_for_metadata, $file, $filename_full_path) = @_;
-	my $metafile_vals = $extrametafile->{$filename_re_for_metadata}->{$file};
-	push(@$metafile_vals, $filename_full_path); 
-}
-
-
-#**************** In future, may be useful to expand this utility file 
-#**************** by having remove methods to mirror the add methods
-
-
-#******************* GET methods
-
-
-sub getmetadata_for_named_metaname_OLD {
-	my ($extrametadata, $filename_re_for_metadata, $field_name) = @_;
-	return $extrametadata->{$filename_re_for_metadata}->{$field_name}; # e.g. $extrametadata->{$filename_re_for_metadata}->{$field_name}
-}
-
-# Unused. Added for symmetry
-sub getmetafile_for_named_file_UNUSED {
-	my ($extrametafile, $filename_re_for_metadata, $file) = @_;
-	return $extrametafile->{$filename_re_for_metadata}->{$file};
-}
-
-
-
-#******************* SET methods
-
-# set an individual name-value pair in the metadata hash for a particular file
-sub setmetadata_for_named_metaname_OLD {
-	my ($extrametadata, $filename_re_for_metadata, $field_name, $value) = @_;
-	$extrametadata->{$filename_re_for_metadata}->{$field_name} = $value;
-}
-sub setmetafile_UNUSED { # e.g. $extrametafile{$filename_re_for_metadata} = $file;
-	my ($extrametafile, $filename_re_for_metadata, $file, $filename_full_path) = @_;
-	$extrametafile->{$filename_re_for_metadata} = $file; 
-}
-
-sub setmetafile_for_named_file_OLD {
-	my ($extrametafile, $filename_re_for_metadata, $file, $filename_full_path) = @_;
-	$extrametafile->{$filename_re_for_metadata}->{$file} = $filename_full_path;
-}
-
-# Unused. Added for symmetry
-sub setmetadata_for_named_pos_UNUSED {
-	my ($extrametadata, $filename_re_for_metadata, $metaname, $index, $value) = @_;
-	$extrametadata->{$filename_re_for_metadata}->{$metaname}->[$index] =  $value;
-}
 
 
Index: /main/trunk/greenstone2/perllib/plugins/EmbeddedMetadataPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/EmbeddedMetadataPlugin.pm	(revision 36372)
+++ /main/trunk/greenstone2/perllib/plugins/EmbeddedMetadataPlugin.pm	(revision 36373)
@@ -30,5 +30,4 @@
 use BaseImporter;
 use MetadataRead;
-use extrametautil;
 use util;
 
@@ -437,38 +436,10 @@
     }
 
-    # Indexing into the extrameta data structures requires the filename's style of slashes to be in URL format
-	# Then need to convert the filename to a regex, no longer to protect windows directory chars \, but for
-	# protecting special characters like brackets in the filepath such as "C:\Program Files (x86)\Greenstone".
-    #print STDERR "file = $file " . &unicode::debug_unicode_string($file);
+   #print STDERR "file = $file " . &unicode::debug_unicode_string($file);
     $file = &util::raw_filename_to_unicode(&util::filename_head($filename), $file);
 
     $self->store_meta_in_extrametadata($file, $exif_metadata, undef, undef, $extrametakeys, $extrametadata, $extrametafile);
 
-    if (0) {
-    #print STDERR "$file ". &unicode::debug_unicode_string($file);
-	$file = &util::filepath_to_url_format($file);
-    #print STDERR "$file " . &unicode::debug_unicode_string($file);
-    $file = &util::filename_to_regex($file); 
-    #print STDERR "$file ".&unicode::debug_unicode_string($file) ."\n";
-    
-    # Associate the metadata now
-
-    if (defined &extrametautil::getmetadata($extrametadata, $file)) {
-	print STDERR "\n****  EmbeddedMetadataPlugin: Need to merge new metadata with existing stored metadata: file = $file\n" if $verbosity > 3;
-
-	my $file_metadata_table = &extrametautil::getmetadata($extrametadata, $file);
-
-	foreach my $metaname (keys %exif_metadata) {
-	    # will create new entry if one does not already exist
-	    push(@{$file_metadata_table->{$metaname}}, @{$exif_metadata{$metaname}});	    
-	}
-
-	# no need to push $file on to $extrametakeys as it is already in the list
-    }
-    else {
-	&extrametautil::setmetadata($extrametadata, $file, \%exif_metadata);
-	&extrametautil::addmetakey($extrametakeys, $file);
-    }
-    }
+
 }
 
Index: /main/trunk/greenstone2/perllib/plugins/LOMPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/LOMPlugin.pm	(revision 36372)
+++ /main/trunk/greenstone2/perllib/plugins/LOMPlugin.pm	(revision 36373)
@@ -32,5 +32,4 @@
 package LOMPlugin;
 
-use extrametautil;
 use ReadTextFile;
 use MetadataPass;
@@ -177,23 +176,5 @@
     }
     $self->{'lom_srcdoc'} = undef; # reset for next file to be processed
-	# Indexing into the extrameta data structures requires the filename's style of slashes to be in URL format
-	# Then need to convert the filename to a regex, no longer to protect windows directory chars \, but for
-	# protecting special characters like brackets in the filepath such as "C:\Program Files (x86)\Greenstone".
-    if (0) {
-	$file_re = &util::filepath_to_url_format($file_re);
-    $file_re = &util::filename_to_regex($file_re);
-    $self->{'lom_srcdoc'} = undef; # reset for next file to be processed
-
-    &extrametautil::addmetakey($extrametakeys, $file_re);
-    &extrametautil::setmetadata($extrametadata, $file_re, $self->{'saved_metadata'});
-    if (defined $lom_srcdoc) {
-	# copied from oaiplugin
-	if (!defined &extrametautil::getmetafile($extrametafile, $file_re)) {
-		&extrametautil::setmetafile($extrametafile, $file_re, {});
-	}
-	 #maps the file to full path
-	&extrametautil::setmetafile_for_named_file($extrametafile, $file_re, $file, $filename_full_path);
-    }
-    }
+
     return 1;
 }
Index: /main/trunk/greenstone2/perllib/plugins/MetadataCSVPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/MetadataCSVPlugin.pm	(revision 36372)
+++ /main/trunk/greenstone2/perllib/plugins/MetadataCSVPlugin.pm	(revision 36373)
@@ -35,5 +35,4 @@
 no strict 'refs';
 
-use extrametautil;
 use multiread;
 use util;
@@ -271,35 +270,5 @@
  	# Associate the metadata now
 	$self->store_meta_in_extrametadata($csv_line_filename, \%csv_line_metadata, $file, $filename_full_path, $extrametakeys, $extrametadata, $extrametafile);
-	# Indexing into the extrameta data structures requires the filename's style of slashes to be in URL format
-	# Then need to convert the filename to a regex, no longer to protect windows directory chars \, but for
-	# protecting special characters like brackets in the filepath such as "C:\Program Files (x86)\Greenstone".
-
-	if (0) {
-	$csv_line_filename = &util::filepath_to_url_format($csv_line_filename);
-	$csv_line_filename = &util::filename_to_regex($csv_line_filename);
-
-	if (defined &extrametautil::getmetadata($extrametadata, $csv_line_filename)) { # merge with existing meta    
-
-	    my $file_metadata_table = &extrametautil::getmetadata($extrametadata, $csv_line_filename);
-	    
-	    foreach my $metaname (keys %csv_line_metadata) {
-		# will create new entry if one does not already exist
-		push(@{$file_metadata_table->{$metaname}}, @{$csv_line_metadata{$metaname}});	    
-	    }
-	    
-	    # no need to push $file on to $extrametakeys as it is already in the list
-	} else { # add as new meta
-	    
-	    &extrametautil::setmetadata($extrametadata, $csv_line_filename, \%csv_line_metadata);
-	    &extrametautil::addmetakey($extrametakeys, $csv_line_filename);
-	}
-	# record which file the metadata came from 
-	if (!defined &extrametautil::getmetafile($extrametafile, $csv_line_filename)) {
-	    &extrametautil::setmetafile($extrametafile, $csv_line_filename, {});
-	}
-	# maps the file to full path
-	&extrametautil::setmetafile_for_named_file($extrametafile, $csv_line_filename, $file, $filename_full_path);
-	}
-    }
+
 }
 
Index: /main/trunk/greenstone2/perllib/plugins/MetadataRead.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/MetadataRead.pm	(revision 36372)
+++ /main/trunk/greenstone2/perllib/plugins/MetadataRead.pm	(revision 36373)
@@ -111,8 +111,4 @@
     }
 
-    #if ($srcdoc_exists) {	
-#	if (!defined &extrametautil::getmetafile($extrametafile, $filename_for_metadata)) {
-#		&extrametautil::setmetafile($extrametafile, $filename_for_metadata, {});
-#	}
      if (defined $file && defined $filename_for_metadata) {
 	 #maps the file to full path
Index: /main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm	(revision 36372)
+++ /main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm	(revision 36373)
@@ -369,9 +369,4 @@
 	    my $filename = $self->{'metadata-filename'};
 
-#	    if (!defined &extrametautil::getmetafile($self->{'metafileref'}, $target)) {
-#	    	&extrametautil::setmetafile($self->{'metafileref'}, $target, {});
-#	    }
-
-#	    &extrametautil::setmetafile_for_named_file($self->{'metafileref'}, $target, $file, $filename);
 	    &extrametautil::addmetafile($self->{'metafileref'}, $target, $file, $filename);
 	}
Index: /main/trunk/greenstone2/perllib/plugins/OAIMetadataXMLPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/OAIMetadataXMLPlugin.pm	(revision 36372)
+++ /main/trunk/greenstone2/perllib/plugins/OAIMetadataXMLPlugin.pm	(revision 36373)
@@ -126,5 +126,4 @@
   {
     # Don't harvest file sets that don't have dc.Identifier set, "dc.Identifier" is usde as the key between Greenstone and OAI Server!
-	#my $dc_identifier = &extrametautil::getmetadata_for_named_pos($extrametadata, $one_file, "dc.Identifier", 0);
       my $dc_identifier = &extrametautil::getmetadatum_by_index($extrametadata, $one_file, "dc.Identifier", 0);
 	next if (!defined($dc_identifier) || $dc_identifier eq "");
@@ -200,6 +199,4 @@
       }	  
 	  
-      #&extrametautil::setmetadata_for_named_metaname($extrametadata, $one_file, $field_name, []) if (!defined (&extrametautil::getmetadata_for_named_metaname($extrametadata, $one_file, $field_name)));
-      #&extrametautil::addmetadata_for_named_metaname($extrametadata, $one_file, $field_name, $value);
       &extrametautil::addmetadatum($extrametadata, $one_file, $field_name, $value);
     }
Index: /main/trunk/greenstone2/perllib/plugins/OAIPlugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/OAIPlugin.pm	(revision 36372)
+++ /main/trunk/greenstone2/perllib/plugins/OAIPlugin.pm	(revision 36373)
@@ -30,5 +30,4 @@
 #use Devel::Peek;
 use Encode;
-use extrametautil;
 use unicode;
 use util;
@@ -271,39 +270,4 @@
 	$self->store_meta_in_extrametadata($filename_for_metadata, $new_metadata, undef, undef, $extrametakeys, $extrametadata, $extrametafile);
     }
-	# Extrametadata keys should be regular expressions
-	# Indexing into the extrameta data structures requires the filename's style of slashes to be in URL format
-	# Then need to convert the filename to a regex, no longer to protect windows directory chars \, but for
-	# protecting special characters like brackets in the filepath such as "C:\Program Files (x86)\Greenstone".
-
-    if (0) {
-	$filename_for_metadata = &util::filepath_to_url_format($filename_for_metadata);
-    $filename_for_metadata = &util::filename_to_regex($filename_for_metadata);
-
-    # Check that we haven't already got some metadata
-    if (defined &extrametautil::getmetadata($extrametadata, $filename_for_metadata)) {
-	print STDERR "\n****  OAIPlugin: Need to merge new metadata with existing stored metadata: file = $filename_for_metadata\n" if $verbosity > 3;
-
-	my $file_metadata_table = &extrametautil::getmetadata($extrametadata, $filename_for_metadata);
-
-	foreach my $metaname (keys %{$new_metadata}) {
-	    # will create new entry if one does not already exist
-	    push(@{$file_metadata_table->{$metaname}}, @{$new_metadata->{$metaname}});	    
-	}
-
-    } else {
-	&extrametautil::setmetadata($extrametadata, $filename_for_metadata, $new_metadata);
-	&extrametautil::addmetakey($extrametakeys, $filename_for_metadata);
-    }
-
-    if ($srcdoc_exists) {	
-#	if (!defined &extrametautil::getmetafile($extrametafile, $filename_for_metadata)) {
-#		&extrametautil::setmetafile($extrametafile, $filename_for_metadata, {});
-#	}
-	 #maps the file to full path
-#	&extrametautil::setmetafile_for_named_file($extrametafile, $filename_for_metadata, $file, $filename_full_path);
-	&extrametautil::addmetafile($extrametafile, $filename_for_metadata, $file, $filename_full_path);
-	
-    }
-    } # if 0
 
     return 1;
