Ignore:
Timestamp:
2008-05-27T15:02:16+12:00 (16 years ago)
Author:
mdewsnip
Message:

(Adding new DB support) Added $infodb_type as first argument to all the dbutil functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/basebuilder.pm

    r15711 r15725  
    9999    $self->{'collect_cfg_preserve'} = &colcfg::read_collection_cfg_xml ($colcfgname);
    100100    }
    101    
     101
     102    # get the database type for this collection from the collect.cfg file (may be undefined)
     103    $self->{'infodbtype'} = $self->{'collect_cfg'}->{'infodbtype'} || "";
     104
    102105    # get the list of plugins for this collection
    103106    my $plugins = [];
     
    321324
    322325    # Get info database file path
    323     my $infodb_file_path = &dbutil::get_infodb_file_path($self->{'collection'}, $textdir);
     326    my $infodb_file_path = &dbutil::get_infodb_file_path($self->{'infodbtype'}, $self->{'collection'}, $textdir);
    324327
    325328    print $outhandle "\n*** creating the info database and processing associated files\n"
     
    333336    if ($self->{'keepold'}) {
    334337    # reconstruct doc_obj metadata from database for all docs
    335     $reconstructed_docs = &classify::reconstruct_doc_objs_metadata($infodb_file_path);
     338    $reconstructed_docs = &classify::reconstruct_doc_objs_metadata($self->{'infodbtype'}, $infodb_file_path);
    336339    }
    337340   
     
    342345    }
    343346    else {
    344     $infodb_handle = &dbutil::open_infodb_write_handle($infodb_file_path);
     347    print STDERR "Infodbtype: " . $self->{'infodbtype'} . "\n";
     348    $infodb_handle = &dbutil::open_infodb_write_handle($self->{'infodbtype'}, $infodb_file_path);
    345349    if (!defined($infodb_handle))
    346350    {
     
    349353    }
    350354    }
    351    
     355
     356    $self->{'buildproc'}->set_infodbtype ($self->{'infodbtype'});
    352357    $self->{'buildproc'}->set_output_handle ($infodb_handle);
    353358    $self->{'buildproc'}->set_mode ('infodb');
     
    382387   
    383388    # output classification information
    384     &classify::output_classify_info ($self->{'classifiers'}, $infodb_handle,
     389    &classify::output_classify_info ($self->{'classifiers'}, $self->{'infodbtype'}, $infodb_handle,
    385390                     $self->{'remove_empty_classifications'},
    386391                     $self->{'gli'});
     
    391396    # output doclist
    392397    my @doc_list = $self->{'buildproc'}->get_doc_list();
    393     &dbutil::write_infodb_entry($infodb_handle, "browselist", { 'hastxt' => [ "0" ],
    394                                     'childtype' => [ "VList" ],
    395                                     'numleafdocs' => [ scalar(@doc_list) ],
    396                                     'thistype' => [ "Invisible" ],
    397                                     'contains' => [ join(";", @doc_list) ] });
     398    my $browselist_infodb = { 'hastxt' => [ "0" ],
     399                  'childtype' => [ "VList" ],
     400                  'numleafdocs' => [ scalar(@doc_list) ],
     401                  'thistype' => [ "Invisible" ],
     402                  'contains' => [ join(";", @doc_list) ] };
     403    print STDERR "Infodbtype: " . $self->{'infodbtype'} . "\n";
     404    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_handle, "browselist", $browselist_infodb);
    398405
    399406    close ($infodb_handle) if !$self->{'debug'};
     
    587594    my %collection_infodb = ();
    588595    $self->get_collection_meta_sets(\%collection_infodb);
    589     &dbutil::write_infodb_entry($infodb_handle, "collection", \%collection_infodb);
     596    &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_handle, "collection", \%collection_infodb);
    590597}
    591598
Note: See TracChangeset for help on using the changeset viewer.