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/LOMPlugin.pm

    r24951 r24971  
    3636use MetadataPass;
    3737use MetadataRead;
     38use util;
    3839use XMLParser;
    3940use Cwd;
     
    166167    $file_re = $tail;
    167168    }
     169   
     170    # Indexing into the extrameta data structures requires the filename's style of slashes to be in URL format
     171    # Then need to convert the filename to a regex, no longer to protect windows directory chars \, but for
     172    # protecting special characters like brackets in the filepath such as "C:\Program Files (x86)\Greenstone".
     173    $file_re = &util::filepath_to_url_format($file_re);
    168174    $file_re = &util::filename_to_regex($file_re);
    169175    $self->{'lom_srcdoc'} = undef; # reset for next file to be processed
Note: See TracChangeset for help on using the changeset viewer.