Changeset 23121
- Timestamp:
- 2010-10-12T14:05:25+13:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/basebuildproc.pm
r22843 r23121 416 416 } 417 417 418 if (($edit_mode eq "add") ) {#|| ($edit_mode eq "update")) {418 if (($edit_mode eq "add") || ($edit_mode eq "update")) { 419 419 #add this document to the browse structure 420 420 push(@{$self->{'doclist'}},$doc_obj->get_OID()) 421 421 unless ($doctype eq "classification"); 422 } 423 # elsif ($edit_mode eq "update") { 424 # don't do anything. this assumes it will keep the same id. 425 # } 422 if ($edit_mode eq "update") { 423 $self->{'dont_reconstruct'}->{$doc_obj->get_OID()} = 1; 424 } 425 &classify::classify_doc ($self->{'classifiers'}, $doc_obj); 426 $self->{'num_docs'} += 1 unless ($doctype eq "classification"); 427 } 426 428 elsif ($edit_mode eq "delete") { 427 # delete => remove this doc from browse structure429 # record this doc so we don't process the reconstructed doc later 428 430 my $del_doc_oid = $doc_obj->get_OID(); 429 430 my @filtered_doc_list = (); 431 foreach my $oid (@{$self->{'doclist'}}) { 432 push(@filtered_doc_list,$oid) if ($oid ne $del_doc_oid); 433 } 434 $self->{'doclist'} = \@filtered_doc_list; 435 } 436 437 438 # classify this document 439 &classify::classify_doc ($self->{'classifiers'}, $doc_obj, $edit_mode); 440 441 if (($edit_mode eq "add")) {# || ($edit_mode eq "update")) { 442 # this is another document 443 $self->{'num_docs'} += 1 unless ($doctype eq "classification"); 444 } 445 elsif ($edit_mode eq "delete") { 446 # delete 431 $self->{'dont_reconstruct'}->{$del_doc_oid} = 1; 432 # do we need this??? where did num_docs come from, from reconstruction?? 447 433 $self->{'num_docs'} -= 1 unless ($doctype eq "classification"); 448 434 }
Note:
See TracChangeset
for help on using the changeset viewer.