Changeset 23116 for main/trunk/greenstone2/perllib/classify/List.pm
- Timestamp:
- 2010-10-12T13:55:07+13:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/classify/List.pm
r22667 r23116 290 290 { 291 291 my $self = shift(@_); 292 my ($doc_obj ,$edit_mode) = @_;292 my ($doc_obj) = @_; 293 293 294 294 # If "-classify_sections" is set, classify every section of the document … … 296 296 my $section = $doc_obj->get_next_section($doc_obj->get_top_section()); 297 297 while (defined $section) { 298 $self->classify_section($doc_obj, $doc_obj->get_OID() . ".$section", $section , $edit_mode);298 $self->classify_section($doc_obj, $doc_obj->get_OID() . ".$section", $section); 299 299 $section = $doc_obj->get_next_section($section); 300 300 } … … 302 302 # Otherwise just classify the top document section 303 303 else { 304 $self->classify_section($doc_obj, $doc_obj->get_OID(), $doc_obj->get_top_section() , $edit_mode);304 $self->classify_section($doc_obj, $doc_obj->get_OID(), $doc_obj->get_top_section()); 305 305 } 306 306 } … … 310 310 { 311 311 my $self = shift(@_); 312 my ($doc_obj,$section_OID,$section ,$edit_mode) = @_;312 my ($doc_obj,$section_OID,$section) = @_; 313 313 314 314 my @metadata_groups = @{$self->{'metadata_groups'}}; … … 342 342 # We're not classifying this section because it doesn't have the required metadata 343 343 return if (!$classify_section); 344 345 if (($edit_mode eq "delete") || ($edit_mode eq "update")) {346 $self->oid_array_delete($section_OID,'OIDs');347 if ($edit_mode eq "delete") {348 return;349 }350 }351 344 352 345 # Otherwise, include this section in the classifier … … 358 351 # Take care not to do a metadata group more than once 359 352 unless ($metadata_groups_done{$metadata_group}) { 360 if ($edit_mode eq "update") {361 # if we are updating, we delete all the old values before362 # adding the new ones, otherwise, the section will end up in363 # the classifier twice.364 delete $self->{$metadata_group . ".list"}->{$section_OID};365 }366 367 353 my $remove_prefix_expr = $self->{$metadata_group . ".remove_prefix_expr"}; 368 354 my $remove_suffix_expr = $self->{$metadata_group . ".remove_suffix_expr"};
Note:
See TracChangeset
for help on using the changeset viewer.