Changeset 15700

Show
Ignore:
Timestamp:
26.05.2008 16:03:38 (11 years ago)
Author:
mdewsnip
Message:

(Adding new DB support) Now outputs the "browselist" node using dbutil::write_infodb_entry().

Files:
1 modified

Legend:

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

    r15688 r15700  
    345345     
    346346    # set up the document processor 
    347     my ($handle); 
     347    my ($infodb_handle); 
    348348    if ($self->{'debug'}) { 
    349     $handle = *STDOUT; 
     349    $infodb_handle = *STDOUT; 
    350350    } else { 
    351351    if (!-e "$txt2db_exe" || !open (PIPEOUT, "| txt2db$exe \"$fulldbname\"")) { 
     
    353353        die "builder::make_infodatabase - couldn't run $txt2db_exe\n"; 
    354354    } 
    355     $handle = *PIPEOUT; 
    356     } 
    357      
    358     $self->{'buildproc'}->set_output_handle ($handle); 
     355    $infodb_handle = *PIPEOUT; 
     356    } 
     357     
     358    $self->{'buildproc'}->set_output_handle ($infodb_handle); 
    359359    $self->{'buildproc'}->set_mode ('infodb'); 
    360360    $self->{'buildproc'}->set_assocdir ($assocdir); 
     
    385385    # this has changed to only output collection meta if its  
    386386    # not in the config file 
    387     $self->output_collection_meta($handle); 
     387    $self->output_collection_meta($infodb_handle); 
    388388     
    389389    # output classification information 
    390     &classify::output_classify_info ($self->{'classifiers'}, $handle, 
     390    &classify::output_classify_info ($self->{'classifiers'}, $infodb_handle, 
    391391                     $self->{'remove_empty_classifications'},  
    392392                     $self->{'gli'}); 
    393393 
    394394    # Output classifier reverse lookup, used in incremental deletion 
    395     #&classify::print_reverse_lookup($handle); 
    396  
    397     #output doclist 
    398     my @doclist = $self->{'buildproc'}->get_doc_list(); 
    399     my $docs = join (";",@doclist); 
    400     print $handle "[browselist]\n"; 
    401     print $handle "<hastxt>0\n"; 
    402     print $handle "<childtype>VList\n"; 
    403     print $handle "<numleafdocs>" . ($#doclist+1) . "\n"; 
    404     print $handle "<thistype>Invisible\n"; 
    405     print $handle "<contains>$docs"; 
    406     print $handle "\n" . ('-' x 70) . "\n"; 
    407  
    408     close ($handle) if !$self->{'debug'}; 
     395    #&classify::print_reverse_lookup($infodb_handle); 
     396 
     397    # output doclist 
     398    my @doc_list = $self->{'buildproc'}->get_doc_list(); 
     399    &dbutil::write_infodb_entry($infodb_handle, "browselist", { 'hastxt' => [ "0" ], 
     400                                    'childtype' => [ "VList" ], 
     401                                    'numleafdocs' => [ scalar(@doc_list) ], 
     402                                    'thistype' => [ "Invisible" ], 
     403                                    'contains' => [ join(";", @doc_list) ] }); 
     404 
     405    close ($infodb_handle) if !$self->{'debug'}; 
    409406 
    410407    print STDERR "</Stage>\n" if $self->{'gli'};