Index: /gsdl/trunk/perllib/basebuilder.pm
===================================================================
--- /gsdl/trunk/perllib/basebuilder.pm	(revision 15724)
+++ /gsdl/trunk/perllib/basebuilder.pm	(revision 15725)
@@ -99,5 +99,8 @@
 	$self->{'collect_cfg_preserve'} = &colcfg::read_collection_cfg_xml ($colcfgname);
     }
-    
+
+    # get the database type for this collection from the collect.cfg file (may be undefined)
+    $self->{'infodbtype'} = $self->{'collect_cfg'}->{'infodbtype'} || "";
+
     # get the list of plugins for this collection
     my $plugins = [];
@@ -321,5 +324,5 @@
 
     # Get info database file path
-    my $infodb_file_path = &dbutil::get_infodb_file_path($self->{'collection'}, $textdir);
+    my $infodb_file_path = &dbutil::get_infodb_file_path($self->{'infodbtype'}, $self->{'collection'}, $textdir);
 
     print $outhandle "\n*** creating the info database and processing associated files\n" 
@@ -333,5 +336,5 @@
     if ($self->{'keepold'}) {
 	# reconstruct doc_obj metadata from database for all docs
-	$reconstructed_docs = &classify::reconstruct_doc_objs_metadata($infodb_file_path);
+	$reconstructed_docs = &classify::reconstruct_doc_objs_metadata($self->{'infodbtype'}, $infodb_file_path);
     }
     
@@ -342,5 +345,6 @@
     }
     else {
-	$infodb_handle = &dbutil::open_infodb_write_handle($infodb_file_path);
+	print STDERR "Infodbtype: " . $self->{'infodbtype'} . "\n";
+	$infodb_handle = &dbutil::open_infodb_write_handle($self->{'infodbtype'}, $infodb_file_path);
 	if (!defined($infodb_handle))
 	{
@@ -349,5 +353,6 @@
 	}
     }
-    
+
+    $self->{'buildproc'}->set_infodbtype ($self->{'infodbtype'});
     $self->{'buildproc'}->set_output_handle ($infodb_handle);
     $self->{'buildproc'}->set_mode ('infodb');
@@ -382,5 +387,5 @@
     
     # output classification information
-    &classify::output_classify_info ($self->{'classifiers'}, $infodb_handle,
+    &classify::output_classify_info ($self->{'classifiers'}, $self->{'infodbtype'}, $infodb_handle,
 				     $self->{'remove_empty_classifications'}, 
 				     $self->{'gli'});
@@ -391,9 +396,11 @@
     # output doclist
     my @doc_list = $self->{'buildproc'}->get_doc_list();
-    &dbutil::write_infodb_entry($infodb_handle, "browselist", { 'hastxt' => [ "0" ],
-							        'childtype' => [ "VList" ],
-							        'numleafdocs' => [ scalar(@doc_list) ],
-							        'thistype' => [ "Invisible" ],
-							        'contains' => [ join(";", @doc_list) ] });
+    my $browselist_infodb = { 'hastxt' => [ "0" ],
+			      'childtype' => [ "VList" ],
+			      'numleafdocs' => [ scalar(@doc_list) ],
+			      'thistype' => [ "Invisible" ],
+			      'contains' => [ join(";", @doc_list) ] };
+    print STDERR "Infodbtype: " . $self->{'infodbtype'} . "\n";
+    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_handle, "browselist", $browselist_infodb);
 
     close ($infodb_handle) if !$self->{'debug'};
@@ -587,5 +594,5 @@
     my %collection_infodb = ();
     $self->get_collection_meta_sets(\%collection_infodb);
-    &dbutil::write_infodb_entry($infodb_handle, "collection", \%collection_infodb);
+    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_handle, "collection", \%collection_infodb);
 }
 
Index: /gsdl/trunk/perllib/basebuildproc.pm
===================================================================
--- /gsdl/trunk/perllib/basebuildproc.pm	(revision 15724)
+++ /gsdl/trunk/perllib/basebuildproc.pm	(revision 15725)
@@ -225,4 +225,11 @@
 }
 
+sub set_infodbtype
+{
+    my $self = shift(@_);
+    my $infodbtype = shift(@_);
+    $self->{'infodbtype'} = $infodbtype;
+}
+
 sub set_index {
     my $self = shift (@_);
@@ -429,5 +436,5 @@
 		# special case for URL metadata
 		if ($field =~ /^URL$/i) {
-		    &dbutil::write_infodb_entry($infodb_handle, $value, { 'section' => [ $section_OID ] });
+		    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_handle, $value, { 'section' => [ $section_OID ] });
 		}
 
@@ -506,12 +513,12 @@
 	} 
 	
-	&dbutil::write_infodb_entry($infodb_handle, $section_OID, \%section_infodb);
+	&dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_handle, $section_OID, \%section_infodb);
 	
 	# output a database entry for the document number
 	if ($self->{'db_level'} eq "document") {
-	    &dbutil::write_infodb_entry($infodb_handle, $self->{'num_docs'}, { 'section' => [ $doc_OID ] });
+	    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_handle, $self->{'num_docs'}, { 'section' => [ $doc_OID ] });
 	}
 	else {
-	    &dbutil::write_infodb_entry($infodb_handle, $self->{'num_sections'}, { 'section' => [ $section_OID ] });
+	    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_handle, $self->{'num_sections'}, { 'section' => [ $section_OID ] });
 	}
 
Index: /gsdl/trunk/perllib/classify.pm
===================================================================
--- /gsdl/trunk/perllib/classify.pm	(revision 15724)
+++ /gsdl/trunk/perllib/classify.pm	(revision 15725)
@@ -233,8 +233,9 @@
 sub reconstruct_doc_objs_metadata
 {
-    my ($infodb_file_path) = @_;
+    my $infodb_type = shift(@_);
+    my $infodb_file_path = shift(@_);
 
     my %database_recs;
-    &dbutil::read_infodb_file($infodb_file_path, \%database_recs);
+    &dbutil::read_infodb_file($infodb_type, $infodb_file_path, \%database_recs);
 
     # dig out top level doc sections
@@ -293,5 +294,5 @@
 sub output_classify_info
 {
-    my ($classifiers, $infodb_handle, $remove_empty_classifications, $gli) = @_;
+    my ($classifiers, $infodb_type, $infodb_handle, $remove_empty_classifications, $gli) = @_;
 
     $gli = 0 unless defined $gli;
@@ -313,5 +314,5 @@
     }
 
-    &print_classify_info ($infodb_handle, $classifyinfo, "", $remove_empty_classifications);
+    &print_classify_info($infodb_type, $infodb_handle, $classifyinfo, "", $remove_empty_classifications);
 }
 
@@ -319,5 +320,5 @@
 sub print_classify_info
 {
-    my ($infodb_handle, $classifyinfo, $OID, $remove_empty_classifications) = @_;
+    my ($infodb_type, $infodb_handle, $classifyinfo, $OID, $remove_empty_classifications) = @_;
 
     $OID =~ s/^\.+//; # just for good luck
@@ -381,5 +382,5 @@
             #rint STDERR "Result: \"" . join(";", @{$clids}) . "\"\n";
             
-	    &print_classify_info ($infodb_handle, $tempinfo, $tempinfo->{'classifyOID'},
+	    &print_classify_info ($infodb_type, $infodb_handle, $tempinfo, $tempinfo->{'classifyOID'},
 				  $remove_empty_classifications);
 	} elsif (defined ($tempinfo->{'OID'})) {
@@ -426,5 +427,5 @@
                 #rint STDERR "Result: \"" . join(";", @{$clids}) . "\"\n";
 		
-		&print_classify_info ($infodb_handle, $tempinfo, "$OID.$next_subOID",
+		&print_classify_info ($infodb_type, $infodb_handle, $tempinfo, "$OID.$next_subOID",
 				      $remove_empty_classifications);
 		$next_subOID++;
@@ -438,5 +439,5 @@
 	if ($mdoffset_text !~ m/^;+$/);
     
-    &dbutil::write_infodb_entry($infodb_handle, $OID, \%classify_infodb);
+    &dbutil::write_infodb_entry($infodb_type, $infodb_handle, $OID, \%classify_infodb);
 }
 
Index: /gsdl/trunk/perllib/dbutil.pm
===================================================================
--- /gsdl/trunk/perllib/dbutil.pm	(revision 15724)
+++ /gsdl/trunk/perllib/dbutil.pm	(revision 15725)
@@ -31,7 +31,14 @@
 sub get_infodb_file_path
 {
+    my $infodb_type = shift(@_);
     my $collection_name = shift(@_);
     my $infodb_directory_path = shift(@_);
 
+    if ($infodb_type eq "sqlite")
+    {
+	return &get_infodb_file_path_sqlite($collection_name, $infodb_directory_path);
+    }
+
+    # Use GDBM if the infodb type is empty or not one of the values above
     return &get_infodb_file_path_gdbm($collection_name, $infodb_directory_path);
 }
@@ -40,6 +47,13 @@
 sub open_infodb_write_handle
 {
-    my $infodb_file_path = shift(@_);
-
+    my $infodb_type = shift(@_);
+    my $infodb_file_path = shift(@_);
+
+    if ($infodb_type eq "sqlite")
+    {
+	return &open_infodb_write_handle_sqlite($infodb_file_path);
+    }
+
+    # Use GDBM if the infodb type is empty or not one of the values above
     return &open_infodb_write_handle_gdbm($infodb_file_path);
 }
@@ -48,4 +62,5 @@
 sub read_infodb_file
 {
+    my $infodb_type = shift(@_);
     my $infodb_file_path = shift(@_);
     my $infodb_map = shift(@_);
@@ -57,9 +72,16 @@
 sub write_infodb_entry
 {
+    my $infodb_type = shift(@_);
     my $infodb_handle = shift(@_);
     my $infodb_key = shift(@_);
     my $infodb_map = shift(@_);
 
-    &write_infodb_entry_gdbm($infodb_handle, $infodb_key, $infodb_map);
+    if ($infodb_type eq "sqlite")
+    {
+	return &write_infodb_entry_sqlite($infodb_handle, $infodb_key, $infodb_map);
+    }
+
+    # Use GDBM if the infodb type is empty or not one of the values above
+    return &write_infodb_entry_gdbm($infodb_handle, $infodb_key, $infodb_map);
 }
 
Index: /gsdl/trunk/perllib/lucenebuilder.pm
===================================================================
--- /gsdl/trunk/perllib/lucenebuilder.pm	(revision 15724)
+++ /gsdl/trunk/perllib/lucenebuilder.pm	(revision 15725)
@@ -364,5 +364,5 @@
     # Get info database file path
     my $text_directory_path = &util::filename_cat($self->{'build_dir'}, "text");
-    my $infodb_file_path = &dbutil::get_infodb_file_path($self->{'collection'}, $text_directory_path);
+    my $infodb_file_path = &dbutil::get_infodb_file_path($self->{'infodbtype'}, $self->{'collection'}, $text_directory_path);
 
     # If we aren't doing an incremental addition, then we just call the super-
Index: /gsdl/trunk/perllib/mgppbuilder.pm
===================================================================
--- /gsdl/trunk/perllib/mgppbuilder.pm	(revision 15724)
+++ /gsdl/trunk/perllib/mgppbuilder.pm	(revision 15725)
@@ -708,5 +708,5 @@
     $self->get_collection_meta_sets(\%collection_infodb);
     $self->get_collection_meta_indexes(\%collection_infodb);
-    &dbutil::write_infodb_entry($infodb_handle, "collection", \%collection_infodb);
+    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_handle, "collection", \%collection_infodb);
 }
 
