Ignore:
Timestamp:
2012-01-16T17:47:14+13:00 (12 years ago)
Author:
ak19
Message:

All perlcode that accesses extrametakeys, extrametadata, extrametafile data structures has been moved into a new perl module called extrametautil.pm. The next step will be to ensure that the file_regexes used to index into these data structures are consistent (using consistent slashes, like URL style slashes).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/OAIMetadataXMLPlugin.pm

    r23212 r24951  
    3333no strict 'refs';
    3434
     35use extrametautil;
    3536use MetadataXMLPlugin;
    3637
     
    125126  {
    126127    # Don't harvest file sets that don't have dc.Identifier set, "dc.Identifier" is usde as the key between Greenstone and OAI Server!
    127     next if (!defined($extrametadata->{$one_file}->{"dc.Identifier"}->[0]) || $extrametadata->{$one_file}->{"dc.Identifier"}->[0] eq "");
     128    my $dc_identifier = &extrametautil::getmetadata_for_named_pos($extrametadata, $one_file, "dc.Identifier", 0);
     129    next if (!defined($dc_identifier) || $dc_identifier eq "");
    128130
    129131    #======================================================================#
     
    131133    #======================================================================#
    132134    # The dc.Identifier has to be the same as the OAI record identifier
    133     my $oai_identifier = $extrametadata->{$one_file}->{"dc.Identifier"}->[0];
     135    my $oai_identifier = $dc_identifier;
    134136   
    135137    # Now, let's get the OAI metadata
     
    195197        # This might need change over once they update the Koha OAI server
    196198        $value =~ s/\/opac\/opac\-detail\.pl\?bib\=/\/catalogue\/detail\.pl\?biblionumber\=/;
    197       }
    198       $extrametadata->{$one_file}->{$field_name} = [] if (!defined($extrametadata->{$one_file}->{$field_name}));
    199       push(@{$extrametadata->{$one_file}->{$field_name}}, $value);
     199      }   
     200     
     201      &extrametautil::setmetadata_for_named_metaname($extrametadata, $one_file, $field_name, []) if (!defined (&extrametautil::getmetadata_for_named_metaname($extrametadata, $one_file, $field_name)));
     202      &extrametautil::addmetadata_for_named_metaname($extrametadata, $one_file, $field_name, $value);
    200203    }
    201204    #======================================================================#
Note: See TracChangeset for help on using the changeset viewer.