Tags:
create new tag
, view all tags
An install of mine lost a page when it ran out of diskspace. It saved the page empty. On restoring the page from the history the user took the topic text but was not aware of the hidden meta data: i.e. the restore was done from the raw rather than debug view.

The biggest consequence of losing the meta data is that the attachments are now inaccessible. I propose that files that are do not exist in the attachment table should be automatically inserted into it when the topic is saved.

This could be written as a plugin or in the core, but generally:

on topic save (or indeed, topic view):

pseudo code:

foreach file in pub/%WEB%/%TOPIC%,
  $meta = get meta data for topic
  unless file already in attachment table {
      my ($fileName, $filePath, $fileSize, $fileDate) = stat file
      my ($fileUser, $fileComment, $attr) = ('','','') 
      my @attrs = (
      "name"    => $fileName,
      "version" => "",
      "path"    => $filePath,
      "size"    => $fileSize,
      "date"    => $fileDate,
      "user"    => $fileUser,
      "comment" => $fileComment,
      "attr"    => ""
    );
      $meta->put( "FILEATTACHMENT", @attrs );
 }

Questions:

  1. Useful?
  2. Core or Plugin?
  3. Anyone want to take the credit and code it?

-- MartinCleaver - 28 Sep 2004

An alternative approach is to dispense with the attachment table in the topic altogether. Since attachments are under revision control, most of the fields stored in the META tag are duplicates of the RCS information anyway.

-- CrawfordCurrie - 28 Sep 2004

ok, so how useful are comment and attributes? are there others too? to keep them do we just store files alongside the attachments ?

-- MartinCleaver - 28 Sep 2004

Comments can be stored as the "descriptive text" of RCS files (-t option). Note that we can use the log message (-m option) of RCS to provide comments on revisions. attributes most logical places would be as keywords in the descriptive text (-h at start for hidden?)

-- ColasNahaboo - 28 Sep 2004

Table data in RCS file only: The same could be said for the topic text. The reason for the duplication is:

  • Easy search on top revision only
  • Get at data fast, without a system call to RCS

Discover files in attachment dir: Could be done. One issue to solve is what to do with files that are created by Plugins and stored in the topics attachment dir as suggested in the Recommended Storage of Plugin Data section in TWikiPlugins topic. Those files are not supposed to be visible to the user. The discover algorithm could exclude files starting with underscore.

-- PeterThoeny - 29 Sep 2004

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2004-09-29 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.