Opened 15 years ago
Closed 14 years ago
#557 closed defect (fixed)
no dmsafe in perl code please
Reported by: | kjdon | Owned by: | kjdon |
---|---|---|---|
Priority: | moderate | Milestone: | 2.84 Release |
Component: | Collection Building | Severity: | major |
Keywords: | Cc: |
Description
Request from Michael
He is using Source metadata and it has been dmsafed (ie underscores escaped). Which means that it is invalid.
This assumes that the receptionist code is going to be serving the collection, which is not necessarily so. eg oaiserver, gs3.
dmsafeing should be done in the receptionist. Michael suggests a [dmsafe:xxx] thing for metadata.
The problem that I see is that we have macros in metadata, and the receptionist needs to be able to distinguish between macros and plain underscores. eg in srclink.
- any reason why srclink is generated at buildtime and not runtime?
- could do it as _httpcollection_/.../[dmsafe:Source]
- If we can get rid of most of macros from metadata then things will work better in gs3.
- what other macros are used in metadata?
- this applies to text as well. how to get around that?
Change History (3)
comment:1 by , 14 years ago
Milestone: | Greenstone 2 wishlist → 2.84 Release |
---|
comment:2 by , 14 years ago
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
- Removed call to ghtml::dmsafe() from BasePlugin::filename_to_utf8_metadata(). This shouldn't be done in the build time code because it is a runtime issue -- if you aren't using the Greenstone 2 receptionist (e.g OAI server, Greenstone 3) then escaping underscores just creates problems.
- Removed dmsafe() function from ghtml.pm, to prevent people from being tempted to use it in the future.
- Added new "dmsafe:" format statement modifier.
- Changed vlistbrowserclass.cpp and demo/etc/collect.cfg to use the new "dmsafe:" format statement modifier on Source metadata, now that underscores will no longer be escaped at build time.
- Removed some old (commented out) "[srclink]" code from a bunch of plugins. Katherine removed [srclink] in March -- it is now dynamically generated.
- Changed MediainfoOGVPlugin.pm to add "srclink_file" metadata instead of the deprecated "srclink" and "/srclink" values.
- Changed "srcicon" values in ImageConverter.pm and ImagePlugin.pm to use "[srclink_file]", for consistency.
- Changed "srclink_file" metadata to always contain the filename, instead of referencing another metadata element, in a bunch of plugins. This is so the C++ code can escape underscores in the filename values correctly.
- Added code to formattools.cpp to always apply dm_safe() to [srclink_file] metadata values, because these should be filenames only (that shouldn't contain macros), and we need to escape underscores in the filenames to avoid confusing the macro system.
- Added code to set optionsassocfilepath so [srclink] works in DocumentText format statements.
Note:
See TracTickets
for help on using tickets.
Has this gone away now that we have Source and SourceFile??