As Crawford said in
TWikiWhatWillYouBeWhenYouGrowUpDiscussion, I propose that the Meta file attachment stuff needs review:
CC said:
- META:FILEATTACHMENT - why oh why is this in the topic? The most the topic should need to know about attachments is
%ATTACHURL%
I propose that:
- Storage of META data should be queryable separately. As we use grep, and grep is file based, this leads it to mean it should be in a separate file else we incur false hits when searching thus need to do post processing to make it accurate.
- This file should not be authoritative for file attachments, instead it should be a cache for speed, refreshed on cache-invalidate. This invalidate would occur when the attachment subsystem notifies, e.g. if the file is missing, older than the attachment dir, or is seen to be invalid.
--
MartinCleaver - 09 Feb 2004
Martin, this is close to the implementation in
FormQueryPlugin - the authoratitive form fields are those in the %META of the topic, but an on-demand cache - implemented using Storable - is used to accelerate this.
--
CrawfordCurrie - 10 Feb 2004
There are good reason for file attachment data being stored as meta data in the topic:
- version control - a topic version knows which version of an attachment goes with it. So look at an old topic and you are linked to the relevant attachments.
- other data is stored here e.g. the comment on the attachment. This could in principle be stored in RCS with the attachment, but as things stand, the comment updates with topic version rather than attachment version. Advantages include including in searching.
Of course, it doesn't have to be done this way, but it is simple and effective to include in this way. With talking about caches and TWiki a lot - I'm still concerned that caches always add complexity and problems. I'd still like to see an option of storing all meta data in a database, but TWiki has always been just fast enough without this for me ...
--
JohnTalintyre - 10 Feb 2004