Changeset 22222

Show
Ignore:
Timestamp:
02.06.2010 15:59:57 (9 years ago)
Author:
kjdon
Message:

half way through the process of tidying up incremental stuff. When doing an update, don't want to increment doc count, or add OID to the doc list as its already there.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/basebuildproc.pm

    r20420 r22222  
    415415    } 
    416416 
    417     if (($edit_mode eq "add") || ($edit_mode eq "update")) { 
     417    if (($edit_mode eq "add")) {# || ($edit_mode eq "update")) { 
    418418    #add this document to the browse structure 
    419419    push(@{$self->{'doclist'}},$doc_obj->get_OID())  
    420420        unless ($doctype eq "classification"); 
    421421    } 
    422     else { 
     422#    elsif ($edit_mode eq "update") { 
     423    # don't do anything. this assumes it will keep the same id. 
     424#    } 
     425    elsif ($edit_mode eq "delete") { 
    423426    # delete => remove this doc from browse structure 
    424427    my $del_doc_oid = $doc_obj->get_OID(); 
     
    435438    &classify::classify_doc ($self->{'classifiers'}, $doc_obj, $edit_mode); 
    436439 
    437     if (($edit_mode eq "add") || ($edit_mode eq "update")) { 
     440    if (($edit_mode eq "add")) {# || ($edit_mode eq "update")) { 
    438441    # this is another document 
    439442    $self->{'num_docs'} += 1 unless ($doctype eq "classification"); 
    440443    } 
    441     else { 
     444    elsif ($edit_mode eq "delete") { 
    442445    # delete 
    443446    $self->{'num_docs'} -= 1 unless ($doctype eq "classification"); 
     
    463466    my %section_infodb = (); 
    464467 
    465     # update a few statistics 
    466     if (($edit_mode eq "add") || ($edit_mode eq "update")) { 
     468    # update a few statistics - how do we do update???? 
     469    if (($edit_mode eq "add")) {# || ($edit_mode eq "update")) { 
    467470 
    468471        $self->{'num_bytes'} += $doc_obj->get_text_length ($section); 
    469472        $self->{'num_sections'} += 1 unless ($doctype eq "classification"); 
    470473    } 
    471     else { 
     474    elsif ($edit_mode eq "delete") { 
    472475        # delete 
    473476        $self->{'num_bytes'} -= $doc_obj->get_text_length ($section); 
     
    599602     
    600603    if (($edit_mode eq "add") || ($edit_mode eq "update")) { 
    601  
     604        # in case of update, this will overwrite old entry?? 
    602605        &dbutil::write_infodb_entry($self->{'infodbtype'}, $infodb_handle, $section_OID, \%section_infodb); 
    603606    }