Changeset 15699
- Timestamp:
- 2008-05-26T15:49:58+12:00 (16 years ago)
- Location:
- gsdl/trunk/perllib
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/basebuildproc.pm
r15698 r15699 32 32 33 33 use classify; 34 use dbutil; 34 35 use doc; 35 36 use docproc; … … 374 375 my $doc_OID = $doc_obj->get_OID(); 375 376 my $first = 1; 377 my $infodb_handle = $self->{'output_handle'}; 376 378 377 379 $self->{'doc_mdprefix_fields'} = {}; … … 427 429 # special case for URL metadata 428 430 if ($field =~ /^URL$/i) { 429 $self->write_infodb_entry($value, { 'section' => [ $section_OID ] });431 &dbutil::write_infodb_entry($infodb_handle, $value, { 'section' => [ $section_OID ] }); 430 432 } 431 433 … … 504 506 } 505 507 506 $self->write_infodb_entry($section_OID, \%section_infodb);508 &dbutil::write_infodb_entry($infodb_handle, $section_OID, \%section_infodb); 507 509 508 510 # output a database entry for the document number 509 511 if ($self->{'db_level'} eq "document") { 510 $self->write_infodb_entry($self->{'num_docs'}, { 'section' => [ $doc_OID ] });512 &dbutil::write_infodb_entry($infodb_handle, $self->{'num_docs'}, { 'section' => [ $doc_OID ] }); 511 513 } 512 514 else { 513 $self->write_infodb_entry($self->{'num_sections'}, { 'section' => [ $section_OID ] });515 &dbutil::write_infodb_entry($infodb_handle, $self->{'num_sections'}, { 'section' => [ $section_OID ] }); 514 516 } 515 517 … … 518 520 last if ($self->{'db_level'} eq "document"); # if no sections wanted, only add the docs 519 521 } 520 }521 522 523 sub write_infodb_entry524 {525 my $self = shift(@_);526 527 $self->write_infodb_entry_gdbm(@_);528 }529 530 531 sub write_infodb_entry_gdbm532 {533 my $self = shift(@_);534 my $infodb_key = shift(@_);535 my $infodb_map = shift(@_);536 537 my $handle = $self->{'output_handle'};538 539 print $handle "[$infodb_key]\n";540 foreach my $infodb_value_key (keys(%$infodb_map))541 {542 foreach my $infodb_value (@{$infodb_map->{$infodb_value_key}})543 {544 if ($infodb_value =~ /-{70,}/)545 {546 # if value contains 70 or more hyphens in a row we need to escape them547 # to prevent txt2db from treating them as a separator548 $infodb_value =~ s/-/&\#045;/gi;549 }550 print $handle "<$infodb_value_key>" . $infodb_value . "\n";551 }552 }553 print $handle '-' x 70, "\n";554 522 } 555 523
Note:
See TracChangeset
for help on using the changeset viewer.