Index: /main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm
===================================================================
--- /main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm	(revision 21568)
+++ /main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm	(revision 21569)
@@ -120,7 +120,7 @@
 
     my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
-    my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb");
-
-    my $cmd = "gdbmget $gdbm_db $dbkey";
+    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", "live-$collect_tail", $index_text_directory);
+
+    my $cmd = "gdbmget $infodb_file_path $dbkey";
 
     if (open(GIN,"$cmd |") == 0) {
@@ -180,7 +180,6 @@
 
     my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
-    my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb");
-
-    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid);
+    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collect_tail, $index_text_directory);
+    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $infodb_file_path, $docid);
     my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string);
     foreach my $k (keys %$doc_rec) {
@@ -240,7 +239,7 @@
 
     my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
-    my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb");
-
-    my $cmd = "gdbmset \"$gdbm_db\" \"$dbkey\" \"$metavalue\"";
+    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", "live-$collect_tail", $index_text_directory);
+
+    my $cmd = "gdbmset \"$infodb_file_path\" \"$dbkey\" \"$metavalue\"";
 
     my $status = system($cmd);
@@ -297,7 +296,6 @@
 
     my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
-    my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb");
-
-    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid);
+    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collect_tail, $index_text_directory);
+    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $infodb_file_path, $docid);
     my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string);
     foreach my $k (keys %$doc_rec) {
@@ -336,5 +334,5 @@
     ## print STDERR "**** ser dr\n$serialized_doc_rec\n\n\n";
 
-    my $cmd = "gdbmset \"$gdbm_db\" \"$docid\" \"$serialized_doc_rec\"";
+    my $cmd = "gdbmset \"$infodb_file_path\" \"$docid\" \"$serialized_doc_rec\"";
 
     my $status = system($cmd);
@@ -752,7 +750,7 @@
 
     my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
-    my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb");
-
-    my $cmd = "gdbmdel \"$gdbm_db\" \"$dbkey\"";
+    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", "live-$collect_tail", $index_text_directory);
+
+    my $cmd = "gdbmdel \"$infodb_file_path\" \"$dbkey\"";
 
     my $status = system($cmd);
@@ -808,7 +806,6 @@
 
     my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text");
-    my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb");
-
-    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid);
+    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collect_tail, $index_text_directory);
+    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $infodb_file_path, $docid);
     my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string);
     foreach my $k (keys %$doc_rec) {
@@ -849,5 +846,5 @@
     my $serialized_doc_rec = &dbutil::convert_infodb_hash_to_string($doc_rec);
 
-    my $cmd = "gdbmset \"$gdbm_db\" \"$docid\" \"$serialized_doc_rec\"";
+    my $cmd = "gdbmset \"$infodb_file_path\" \"$docid\" \"$serialized_doc_rec\"";
 
     my $status = system($cmd);
