Changeset 9494 for trunk/gsdl


Ignore:
Timestamp:
2005-03-23T16:03:20+12:00 (19 years ago)
Author:
mdewsnip
Message:

A couple more fixes for the metadata_read stuff.

Location:
trunk/gsdl/perllib/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/MARCPlug.pm

    r9493 r9494  
    189189    my ($filename, $encoding, $language, $textref) = @_;
    190190
    191     $self->{'readfile_encoding'} = $encoding;
     191    $self->{'readfile_encoding'}->{$filename} = $encoding;
    192192
    193193    my @marc_entries = ();
     
    218218    my $self = shift (@_);
    219219    my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_;
     220
    220221    my $outhandle = $self->{'outhandle'};
     222    my $filename = &util::filename_cat($base_dir, $file);
    221223
    222224    if (! defined($self->{'mm_file'}))
     
    235237    $doc_obj->add_metadata($cursection, "FileFormat", "MARC");
    236238   
    237     my $filename = &util::filename_cat($base_dir, $file);
    238239    my $marc_entries = $self->{'marc_entries'}->{$filename};
    239240    my $marc = shift(@$marc_entries);
    240241
    241     $self->extract_metadata ($marc, $metadata, $doc_obj, $cursection);
     242    my $encoding = $self->{'readfile_encoding'}->{$filename};
     243    $self->extract_metadata ($marc, $metadata, $encoding, $doc_obj, $cursection);
    242244
    243245    # add spaces after the sub-field markers, for word boundaries
     
    248250    $$textref =~ s/>/>/g;
    249251
    250     my $encoding = $self->{'readfile_encoding'};
    251252    $$textref = $self->to_utf8($encoding,$$textref);
    252253
     
    296297{
    297298    my $self = shift (@_);
    298     my ($marc, $metadata, $doc_obj, $section) = @_;
     299    my ($marc, $metadata, $encoding, $doc_obj, $section) = @_;
    299300    my $outhandle = $self->{'outhandle'};
    300 
    301     my $encoding = $self->{'readfile_encoding'};
    302301
    303302    my $metadata_mapping = $self->{'metadata_mapping'};
  • trunk/gsdl/perllib/plugins/ProCitePlug.pm

    r8121 r9494  
    9191
    9292
    93 my %workform_definitions;
    9493my %crazy_workform_mapping =
    9594    ( "A", "Book, Long Form",
     
    120119    my ($filename, $encoding, $language, $textref) = @_;
    121120
    122     # Reset the workform definitions from previous files
    123     %workform_definitions = ();
     121    # Store the workform definitions for this file
     122    my %workform_definitions = ();
    124123
    125124    # Read the contents of the file into $textref
     
    151150    $workform_definitions{$workform_name} = \@workform_values;
    152151    }
     152
     153    $self->{'workform_definitions'}->{$filename} = \%workform_definitions;
    153154}
    154155
     
    160161
    161162    my $outhandle = $self->{'outhandle'};
     163    my $filename = &util::filename_cat($base_dir, $file);
    162164
    163165    # Report that we're processing the file
     
    180182
    181183    # Check we know about the workform of this record
     184    my %workform_definitions = %{$self->{'workform_definitions'}->{$filename}};
    182185    if (!$workform_definitions{$workform_indicator}) {
    183186    print STDERR "Unknown workform!\n";
Note: See TracChangeset for help on using the changeset viewer.