Changeset 15697 for gsdl/trunk/perllib/basebuildproc.pm
- Timestamp:
- 2008-05-26T14:00:14+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/basebuildproc.pm
r15696 r15697 394 394 my $dtype = $doc_obj->get_metadata_element ($section, "doctype"); 395 395 if (!defined $dtype || $dtype !~ /\w/) { 396 $section_infodb{"doctype"} = "doc";396 $section_infodb{"doctype"} = [ "doc" ]; 397 397 } 398 398 … … 406 406 # doc_obj derived directly from file 407 407 if ($doc_obj->get_text_length($section) > 0) { 408 $section_infodb{"hastxt"} = "1";408 $section_infodb{"hastxt"} = [ "1" ]; 409 409 } else { 410 $section_infodb{"hastxt"} = "0";410 $section_infodb{"hastxt"} = [ "0" ]; 411 411 } 412 412 } … … 433 433 # special case for URL metadata 434 434 if ($field =~ /^URL$/i) { 435 $self->write_infodb_entry($value, { 'section' => $section_OID});435 $self->write_infodb_entry($value, { 'section' => [ $section_OID ] }); 436 436 } 437 437 438 438 if (!defined $self->{'dontdb'}->{$field}) { 439 $section_infodb{$field} = $value;439 push(@{$section_infodb{$field}}, $value); 440 440 441 441 if ($section eq "") … … 453 453 foreach my $prefix (keys %$doc_mdprefix_fields) 454 454 { 455 $section_infodb{"metadataset"} = $prefix;455 push(@{$section_infodb{"metadataset"}}, $prefix); 456 456 457 457 foreach my $field (keys %{$doc_mdprefix_fields->{$prefix}}) … … 459 459 my $val = $doc_mdprefix_fields->{$prefix}->{$field}; 460 460 461 $section_infodb{"metadatalist-$prefix"} = $field;462 $section_infodb{"metadatafreq-$prefix-$field"} = $val;461 push(@{$section_infodb{"metadatalist-$prefix"}}, $field); 462 push(@{$section_infodb{"metadatafreq-$prefix-$field"}}, $val); 463 463 } 464 464 } … … 472 472 # output archivedir if at top level 473 473 if ($section eq $doc_obj->get_top_section()) { 474 $section_infodb{"archivedir"} = $archivedir;474 $section_infodb{"archivedir"} = [ $archivedir ]; 475 475 } 476 476 } … … 478 478 # output document display type 479 479 if ($first) { 480 $section_infodb{"thistype"} = $thistype;480 $section_infodb{"thistype"} = [ $thistype ]; 481 481 } 482 482 … … 484 484 # doc num is num_docs not num_sections 485 485 # output the matching document number 486 $section_infodb{"docnum"} = $self->{'num_docs'};486 $section_infodb{"docnum"} = [ $self->{'num_docs'} ]; 487 487 } 488 488 else { … … 490 490 my $children = $doc_obj->get_children ($section); 491 491 if (scalar(@$children) > 0) { 492 $section_infodb{"childtype"} = $childtype;492 $section_infodb{"childtype"} = [ $childtype ]; 493 493 my $contains = ""; 494 494 foreach my $child (@$children) … … 503 503 } 504 504 } 505 $section_infodb{"contains"} = $contains;505 $section_infodb{"contains"} = [ $contains ]; 506 506 } 507 507 # output the matching doc number 508 $section_infodb{"docnum"} = $self->{'num_sections'};508 $section_infodb{"docnum"} = [ $self->{'num_sections'} ]; 509 509 } 510 510 … … 513 513 # output a database entry for the document number 514 514 if ($self->{'db_level'} eq "document") { 515 $self->write_infodb_entry($self->{'num_docs'}, { 'section' => $doc_OID});515 $self->write_infodb_entry($self->{'num_docs'}, { 'section' => [ $doc_OID ] }); 516 516 } 517 517 else { 518 $self->write_infodb_entry($self->{'num_sections'}, { 'section' => $section_OID});518 $self->write_infodb_entry($self->{'num_sections'}, { 'section' => [ $section_OID ] }); 519 519 } 520 520 … … 545 545 foreach my $infodb_value_key (keys(%$infodb_map)) 546 546 { 547 print $handle "<$infodb_value_key>" . $infodb_map->{$infodb_value_key} . "\n"; 547 foreach my $infodb_value (@{$infodb_map->{$infodb_value_key}}) 548 { 549 print $handle "<$infodb_value_key>" . $infodb_value . "\n"; 550 } 548 551 } 549 552 print $handle '-' x 70, "\n";
Note:
See TracChangeset
for help on using the changeset viewer.