Changeset 16919


Ignore:
Timestamp:
2008-08-20T17:34:52+12:00 (16 years ago)
Author:
ak19
Message:

set_Source_metadata modified to also set SourceFile metadata which represents the URL-encoded version of the original sourcefile. In case the original sourcefile is already url-encoded, SourceFile metadata will escape percent signs with percent 25.

File:
1 edited

Legend:

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

    r16852 r16919  
    719719    # UTF-8 version of filename
    720720    my $filemeta = $self->filename_to_utf8_metadata($filename_no_path, $file_encoding);
    721     $doc_obj->set_utf8_metadata_element($top_section, "Source", $filemeta);
     721
     722    # Source is the UTF8 display name - not necessarily the name of the file on the system
     723    $doc_obj->set_utf8_metadata_element($top_section, "Source", $filemeta);
     724
     725    # SourceFile is the url-reference to url-encoded filemeta:
     726    # it's a url that refers to the actual file on the system
     727    $filemeta = &unicode::url_encode($filemeta);
     728    $filemeta = &unicode::filename_to_url($filemeta);
     729    $doc_obj->set_utf8_metadata_element($top_section, "SourceFile", $filemeta);
    722730}
    723731     
    724732sub add_OID {
    725 
    726733    my $self = shift (@_); 
    727734    my ($doc_obj) = @_;
Note: See TracChangeset for help on using the changeset viewer.