Opened 12 years ago
Last modified 12 years ago
#807 new defect
extrameta data structures in its own pm file
Reported by: | ak19 | Owned by: | nobody |
---|---|---|---|
Priority: | moderate | Milestone: | Possible 2.88 Release |
Component: | Collection Building | Severity: | major |
Keywords: | Cc: |
Description
Diego noticed how the metadata in a toplevel metadata.xml, which specifies metadata for files in import's subfolders, does not get attached to the files on Windows, while this works on Linux. It had to do with the difference between the file slashes used on the OS versus the URL-type fileslashes used in the metadata.xml Diego had constructed. This has now been fixed and Dr Bainbridge came up with a tidier solution of a new method in util.pm that would handle the details.
perllib/plugins/DirectoryPlugin.pm
trunk/greenstone2/perllib/util.pm
- All perlcode that accesses extrametakeys, extrametadata, extrametafile data structures has been moved into a new perl module called extrametautil.pm. The next step will be to ensure that the file_regexes used to index into these data structures are consistent (using consistent slashes, like URL style slashes).
http://trac.greenstone.org/changeset/24951
and http://trac.greenstone.org/changeset/24952
extrametautil.pm
plugins/DSpacePlugin.pm (3 diffs)
plugins/DirectoryPlugin.pm (5 diffs)
plugins/EmbeddedMetadataPlugin.pm (3 diffs)
plugins/LOMPlugin.pm (2 diffs)
plugins/MetadataCSVPlugin.pm (2 diffs)
plugins/MetadataXMLPlugin.pm (3 diffs)
plugins/OAIMetadataXMLPlugin.pm (4 diffs)
plugins/OAIPlugin.pm (2 diffs)
and
bin/script/explode_metadata_database.pl (2 diffs)
Change History (3)
comment:1 by , 12 years ago
Summary: | extrameta data structures accessed → extrameta data structures in its own pm file |
---|
comment:2 by , 12 years ago
Commit revision: 24971. 3 (related) changes commit at once.
- 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.
- 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).
- 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.
Changes to 8 files:
- perllib\util.pm
- perllib\plugins: DSpacePlugin.pm, DirectoryPlugin.pm, EmbeddedMetadataPlugin.pm, LOMPlugin.pm, MetadataCSVPlugin.pm, MetadataXMLPlugin.pm, OAIPlugin.pm
The idea is that the extrameta data structures (extrametakeys, extrametadata, extrametafile) which are indexed using a filename as regex, will make sure that file-system dependent clashes are taken care of. This still needs to be done and will be part of the next commits, and will probably use URL style slashes.