Ignore:
Timestamp:
2012-01-24T16:19:58+13:00 (12 years ago)
Author:
ak19
Message:
  1. Introduced the util::filepath_to_url_format subroutine which will be used to convert filenames to URL style filenames to match the slashes used in the filename regex-es in extrameta keys used to index into extrameta data structures. 2. Fixed bug on windows where metadata.xml specifies filenames as regex with backslash in front of the file extension's period mark: DirectoryPlugin needed to unregex the filepath before calling fileparse on it, else the escaping backslash would interfere with perl's fileparse routine (only on windows, since backslash also represents a dirsep here). 3. Updated all those perl plugins where the new util::filepath_to_url_format needs to be called so that they use URL style filenames (thereafter regexed) to index into the extrameta data structures.
File:
1 edited

Legend:

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

    r24951 r24971  
    3636use extrametautil;
    3737use multiread;
     38use util;
    3839
    3940use Encode;
     
    205206
    206207    # Associate the metadata now
     208    # Indexing into the extrameta data structures requires the filename's style of slashes to be in URL format
     209    # Then need to convert the filename to a regex, no longer to protect windows directory chars \, but for
     210    # protecting special characters like brackets in the filepath such as "C:\Program Files (x86)\Greenstone".
     211    $csv_line_filename = &util::filepath_to_url_format($csv_line_filename);
    207212    $csv_line_filename = &util::filename_to_regex($csv_line_filename);
    208213
Note: See TracChangeset for help on using the changeset viewer.