Index: main/trunk/greenstone2/perllib/ClassifyTreeModel.pm
===================================================================
--- main/trunk/greenstone2/perllib/ClassifyTreeModel.pm	(revision 21657)
+++ main/trunk/greenstone2/perllib/ClassifyTreeModel.pm	(revision 21661)
@@ -104,4 +104,10 @@
   }
 # /** getCollection() **/
+
+sub getInfoDBType()
+{
+  my $self = shift(@_);
+  return $self->{'infodbtype'};
+}
 
 # /** Retrieve a node from this tree based upon its CLID (OID).
Index: main/trunk/greenstone2/perllib/ClassifyTreeNode.pm
===================================================================
--- main/trunk/greenstone2/perllib/ClassifyTreeNode.pm	(revision 21657)
+++ main/trunk/greenstone2/perllib/ClassifyTreeNode.pm	(revision 21661)
@@ -28,16 +28,17 @@
 
     my $collection = $model->getCollection();
+    $self->{'infodbtype'} = $model->getInfoDBType();
 
     my $index_text_directory_path = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection, "index", "text");
-    $self->{'infodb_file_path'} = &dbutil::get_infodb_file_path("gdbm", $collection, $index_text_directory_path);
+    $self->{'infodb_file_path'} = &dbutil::get_infodb_file_path($self->{'infodbtype'}, $collection, $index_text_directory_path);
 
     # Check if this node already exists in the database, and if not insert it
     # now
-    my $text = &dbutil::read_infodb_entry("gdbm", $self->{'infodb_file_path'}, $clid);
+    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     if($text !~ /\w+/ && $force_new)
       {
-	my $infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $self->{'infodb_file_path'}, "append");
-	&dbutil::write_infodb_entry("gdbm", $infodb_file_handle, $clid, &dbutil::convert_infodb_string_to_hash("<doctype>classify\n<hastxt>0\n<childtype>VList\n<Title>\n<numleafdocs>0\n<contains>\n"));
-	&dbutil::close_infodb_write_handle("gdbm", $infodb_file_handle);
+	my $infodb_file_handle = &dbutil::open_infodb_write_handle($self->{'infodbtype'}, $self->{'infodb_file_path'}, "append");
+	&dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_file_handle, $clid, &dbutil::convert_infodb_string_to_hash("<doctype>classify\n<hastxt>0\n<childtype>VList\n<Title>\n<numleafdocs>0\n<contains>\n"));
+	&dbutil::close_infodb_write_handle($self->{'infodbtype'}, $infodb_file_handle);
       }
     # Bless me father for I have sinned
@@ -122,9 +123,9 @@
 
     # Create a new document with the correct CLID
-    my $infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $self->{'infodb_file_path'}, "append");
-    &dbutil::write_infodb_entry("gdbm", $infodb_file_handle, $new_clid, &dbutil::convert_infodb_string_to_hash($text));
+    my $infodb_file_handle = &dbutil::open_infodb_write_handle($self->{'infodbtype'}, $self->{'infodb_file_path'}, "append");
+    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_file_handle, $new_clid, &dbutil::convert_infodb_string_to_hash($text));
     # Remove the old document
-    &dbutil::delete_infodb_entry("gdbm", $infodb_file_handle, $self->{'clid'});
-    &dbutil::close_infodb_write_handle("gdbm", $infodb_file_handle);
+    &dbutil::delete_infodb_entry($self->{'infodbtype'}, $infodb_file_handle, $self->{'clid'});
+    &dbutil::close_infodb_write_handle($self->{'infodbtype'}, $infodb_file_handle);
 
     # Finally, change the clid stored in this document
@@ -240,5 +241,5 @@
 
     # Now determine if this node exists.
-    if (&dbutil::read_infodb_entry("gdbm", $self->{'infodb_file_path'}, $next_clid) =~ /\w+/)
+    if (&dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $next_clid) =~ /\w+/)
       {
         # And if so, create it.
@@ -491,7 +492,7 @@
       }
     # Now remove the node from the database
-    my $infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $self->{'infodb_file_path'}, "append");
-    &dbutil::delete_infodb_entry("gdbm", $infodb_file_handle, $self->{'clid'});
-    &dbutil::close_infodb_write_handle("gdbm", $infodb_file_handle);
+    my $infodb_file_handle = &dbutil::open_infodb_write_handle($self->{'infodbtype'}, $self->{'infodb_file_path'}, "append");
+    &dbutil::delete_infodb_entry($self->{'infodbtype'}, $infodb_file_handle, $self->{'clid'});
+    &dbutil::close_infodb_write_handle($self->{'infodbtype'}, $infodb_file_handle);
 
     # Return the leaf count (so we can adjust the numleafdocs at the root node
@@ -630,5 +631,5 @@
 
     # Load the text of this node
-    my $text = &dbutil::read_infodb_entry("gdbm", $self->{'infodb_file_path'}, $clid);
+    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
 
     # Replace the contains
@@ -637,7 +638,7 @@
     #rint STDERR "After:  $text\n";
     # Store the changed text
-    my $infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $self->{'infodb_file_path'}, "append");
-    &dbutil::write_infodb_entry("gdbm", $infodb_file_handle, $clid, &dbutil::convert_infodb_string_to_hash($text));
-    &dbutil::close_infodb_write_handle("gdbm", $infodb_file_handle);
+    my $infodb_file_handle = &dbutil::open_infodb_write_handle($self->{'infodbtype'}, $self->{'infodb_file_path'}, "append");
+    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_file_handle, $clid, &dbutil::convert_infodb_string_to_hash($text));
+    &dbutil::close_infodb_write_handle($self->{'infodbtype'}, $infodb_file_handle);
   }
 # /** setContains() **/
@@ -658,11 +659,11 @@
 
     # Load the text of this node
-    my $text = &dbutil::read_infodb_entry("gdbm", $self->{'infodb_file_path'}, $clid);
+    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     # Replace the numleafdocs
     $text =~ s/<numleafdocs>\d*?\n+/<numleafdocs>$numleafdocs\n/;
     # Store the changed text
-    my $infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $self->{'infodb_file_path'}, "append");
-    &dbutil::write_infodb_entry("gdbm", $infodb_file_handle, $clid, &dbutil::convert_infodb_string_to_hash($text));
-    &dbutil::close_infodb_write_handle("gdbm", $infodb_file_handle);
+    my $infodb_file_handle = &dbutil::open_infodb_write_handle($self->{'infodbtype'}, $self->{'infodb_file_path'}, "append");
+    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_file_handle, $clid, &dbutil::convert_infodb_string_to_hash($text));
+    &dbutil::close_infodb_write_handle($self->{'infodbtype'}, $infodb_file_handle);
   }
 # /** setNumLeafDocs() **/
@@ -685,11 +686,11 @@
 
     # Load the text of this node
-    my $text = &dbutil::read_infodb_entry("gdbm", $self->{'infodb_file_path'}, $clid);
+    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     # Replace the title
     $text =~ s/<Title>.*?\n+/<Title>$title\n/;
     # Store the changed text
-    my $infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $self->{'infodb_file_path'}, "append");
-    &dbutil::write_infodb_entry("gdbm", $infodb_file_handle, $clid, &dbutil::convert_infodb_string_to_hash($text));
-    &dbutil::close_infodb_write_handle("gdbm", $infodb_file_handle);
+    my $infodb_file_handle = &dbutil::open_infodb_write_handle($self->{'infodbtype'}, $self->{'infodb_file_path'}, "append");
+    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_file_handle, $clid, &dbutil::convert_infodb_string_to_hash($text));
+    &dbutil::close_infodb_write_handle($self->{'infodbtype'}, $infodb_file_handle);
   }
 # /** setValue() **/
@@ -708,5 +709,5 @@
     my $clid = $self->{'clid'};
 
-    my $text = &dbutil::read_infodb_entry("gdbm", $self->{'infodb_file_path'}, $clid);
+    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     return $text;
   }
