Ignore:
Timestamp:
2009-02-03T09:46:33+13:00 (15 years ago)
Author:
davidb
Message:

Addition of 'edit_mode' parameter to classify(). This can be either 'add' 'delete' or 'reindex' (should think about renaming the last one to something more appropriate, e.g. update).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/classify/GenericList.pm

    r17209 r18455  
    194194{
    195195    my $self = shift(@_);
    196     my $doc_obj = shift(@_);
     196    my ($doc_obj,$edit_mode) = @_;
    197197
    198198    # If "-classify_sections" is set, classify every section of the document
     
    200200    my $section = $doc_obj->get_next_section($doc_obj->get_top_section());
    201201    while (defined $section) {
    202         $self->classify_section($doc_obj, $doc_obj->get_OID() . ".$section", $section);
     202        $self->classify_section($doc_obj, $doc_obj->get_OID() . ".$section", $section, $edit_mode);
    203203        $section = $doc_obj->get_next_section($section);
    204204    }
     
    206206    # Otherwise just classify the top document section
    207207    else {
    208     $self->classify_section($doc_obj, $doc_obj->get_OID(), $doc_obj->get_top_section());
     208    $self->classify_section($doc_obj, $doc_obj->get_OID(), $doc_obj->get_top_section(), $edit_mode);
    209209    }
    210210}
     
    214214{
    215215    my $self = shift(@_);
    216     my $doc_obj = shift(@_);
    217     my $section_OID = shift(@_);
    218     my $section = shift(@_);
     216    my ($doc_obj,$section_OID,$section,$edit_mode) = @_;
    219217
    220218    my @metadata_groups = @{$self->{'metadata_groups'}};
     
    235233    return if (!$classify_section);
    236234
     235    if ($edit_mode eq "delete") {
     236    $self->oid_array_delete($section_OID,'OIDs');
     237    return;
     238    }
     239   
    237240    # Otherwise, include this section in the classifier
    238241    push(@{$self->{'OIDs'}}, $section_OID);
Note: See TracChangeset for help on using the changeset viewer.