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/AZCompactList.pm

    r17209 r18455  
    180180{
    181181    my $self = shift (@_);
    182     my ($doc_obj) = @_;
     182    my ($doc_obj,$edit_mode) = @_;
    183183
    184184    my $doc_OID = $doc_obj->get_OID();
     
    211211    my $full_doc_OID
    212212        = ($thissection ne "") ? "$doc_OID.$thissection" : $doc_OID;
     213
     214    if ($edit_mode eq "delete") {
     215        print $outhandle "  Deleting $full_doc_OID\n";
     216        delete $self->{'list'}->{$full_doc_OID};
     217        delete $self->{'listmetavalue'}->{$full_doc_OID};
     218        delete $self->{'list_mvpair'}->{$full_doc_OID};
     219        delete $self->{'reclassify'}->{$full_doc_OID};
     220
     221        next;
     222    }
     223
     224
    213225    if (defined $self->{'list_mvpair'}->{$full_doc_OID})
    214226    {
     
    486498        if ($self->{'doclevel'} =~ m/^top/i) { # toplevel
    487499            $self->{'classifiers'}->{$node_name}->{'classifyobj'}
    488             ->classify($doc_obj, "Section=$section");
     500            ->classify($doc_obj,"add", "Section=$section");
    489501        } else { # section level
    490502            # Thanks to Don Gourley for this...
    491503            # classify can't handle multi-level section
    492504            $self->{'classifiers'}->{$node_name}->{'classifyobj'}
    493             ->classify_section($section, $doc_obj, $sortmeta);
     505            ->classify_section($section, $doc_obj, "add", $sortmeta);
    494506        }
    495507        }
     
    497509        {
    498510        $self->{'classifiers'}->{$node_name}->{'classifyobj'}
    499         ->classify($doc_obj);
     511        ->classify($doc_obj,"add");
    500512        }
    501513    } else { # this key is not in the hash
Note: See TracChangeset for help on using the changeset viewer.