Changeset 18901

Show
Ignore:
Timestamp:
06.04.2009 15:23:29 (10 years ago)
Author:
kjdon
Message:

small changes to get this to work with qualified dc

Files:
1 modified

Legend:

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

    r18327 r18901  
    405405    "spatial" => "dc.coverage", 
    406406    "temporal" => "dc.coverage", 
    407     "audience" => "dc.any", 
    408     "accrualMethod" => "dc.any", 
    409     "accrualPeriodicity" => "dc.any", 
    410     "accrualPolicy" => "dc.any", 
    411     "instructionalMethod" => "dc.any", 
    412     "provenance" => "dc.any", 
    413     "rightsHolder" => "dc.any", 
    414     "mediator" => "audience", 
    415     "educationLevel" => "audience", 
     407# these are top level elements in our qualified dc metadata set 
     408#   "audience" => "dc.any", 
     409#   "accrualMethod" => "dc.any", 
     410#   "accrualPeriodicity" => "dc.any", 
     411#   "accrualPolicy" => "dc.any", 
     412#   "instructionalMethod" => "dc.any", 
     413#   "provenance" => "dc.any", 
     414#   "rightsHolder" => "dc.any", 
     415    "mediator" => "dc.audience", 
     416    "educationLevel" => "dc.audience", 
    416417    "accessRights" => "dc.rights", 
    417418    "license" => "dc.rights", 
     
    421422    my ($prefix,$name) = ($metaname =~ m/^(.*?)\.(.*?)$/); 
    422423     
    423     if ($prefix eq "dcterms") 
     424    if ($prefix eq "dcterms" || $prefix eq "dc") 
    424425    { 
    425426    if (defined $dcterm_mapping->{$name})  
     
    448449    # locate and remove outermost tag (ignoring any attribute information in top-level tag) 
    449450    my ($wrapper_metadata_xml,$inner_metadata_text) = ($metadata_text =~ m/<([^ >]+).*?>(.*?)<\/\1>/s); 
    450  
    451451    # split tag into namespace and tag name 
    452452    my($namespace,$top_level_prefix) = ($wrapper_metadata_xml =~ m/^(.*?):(.*?)$/); 
    453  
    454453    # sometimes, the dc namespace is not specified as the prefix in each element (like <dc:title>) 
    455454    # but is rather defined in the wrapper element containing the various dc meta elements, 
     
    474473        $inner_metadata_text = $3; 
    475474 
    476         # $metaname =~ s/^(dc:)?(.)/\u$2/; # strip of optional prefix and uppercase first letter 
     475        # $metaname =~ s/^(dc:)?(.)/\u$2/; # strip off optional prefix and uppercase first letter 
    477476        $metaname =~ s/:/\./; 
    478477        if ($metaname !~ m/\./) 
     
    480479        $metaname = "$top_level_prefix.$metaname"; 
    481480        } 
     481 
     482        $metaname = $self->remap_dcterms_metadata($metaname); 
     483 
     484        # uppercase the first char of the name 
    482485        $metaname =~ s/\.(.)/\.\u$1/; 
    483  
    484         $metaname = $self->remap_dcterms_metadata($metaname); 
    485  
    486486        $metavalue =~ s/\[/&#91;/g; 
    487487        $metavalue =~ s/\]/&#93;/g;