Changeset 17015 for gsdl/trunk/perllib


Ignore:
Timestamp:
2008-08-26T19:49:25+12:00 (16 years ago)
Author:
ak19
Message:

Handles URL-encoded filenames now (since the xlink_href urls referring to these already URL-encoded filenames must be doubly-encoded).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugouts/FedoraMETSPlugout.pm

    r16462 r17015  
    634634       $all_text .= "  <mets:fileGrp ID=\"$id_root\">\n";
    635635       
    636        my $assfilePath = ($assoc_dir eq "") ? $assoc_file : "$assoc_dir/$assoc_file";
     636       # The assoc_file's name may be url-encoded, so the xlink_href in the <mets:FLocat>
     637       # element must be the url to this (possibly url-encoded) filename
     638       my $assocfile_url = &unicode::filename_to_url($assoc_file);
     639       my $assfilePath = ($assoc_dir eq "") ? $assocfile_url : "$assoc_dir/$assocfile_url";
    637640       ++$fileID;
    638641       
     
    675678           
    676679           my $fdomain = "http://$fserver:$fport";
    677            $xlink_href  = "xlink:href=\"$fdomain$gsdl_href\"";
     680           $xlink_href = "xlink:href=\"$fdomain$gsdl_href\"";
    678681       }
    679682       
    680683       my $top_section = $doc_obj->get_top_section();
    681684       my $id = $doc_obj->get_metadata_element($top_section,"Identifier");
    682 
     685       
    683686       $all_text .= "    <mets:file $mime_attr $id_attr $opt_owner_id >\n";
    684687       $all_text .= "      <mets:FLocat LOCTYPE=\"URL\" $xlink_href $xlink_title />\n";
    685        
     688
    686689       $all_text .= "    </mets:file>\n";
    687690       
Note: See TracChangeset for help on using the changeset viewer.