Show
Ignore:
Timestamp:
24.01.2012 16:19:58 (8 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.

Files:
1 modified

Legend:

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

    r24951 r24971  
    3030use BasePlugin; 
    3131use extrametautil; 
     32use util; 
    3233 
    3334use Encode; 
     
    325326    } 
    326327 
    327     # Protect windows directory chars \ 
    328     $file = &util::filename_to_regex($file); ####  
     328    # Indexing into the extrameta data structures requires the filename's style of slashes to be in URL format 
     329    # Then need to convert the filename to a regex, no longer to protect windows directory chars \, but for 
     330    # protecting special characters like brackets in the filepath such as "C:\Program Files (x86)\Greenstone". 
     331    $file = &util::filepath_to_url_format($file); 
     332    $file = &util::filename_to_regex($file);  
    329333     
    330334    # Associate the metadata now