Overview

The default store engines store topics in plain-text files on disk, in a simple and obvious directory structure. The big advantage of this approach is that it makes it very easy to manipulate topics from outside Foswiki, and it is also very robust; there are no complex binary indexes to maintain, and moving a topic from one installation to another is as simple as copying a couple of text files.

To keep everything together in one place, meta-data (Foswiki-generated or from forms) is embedded directly in topics, using special macros. These macros are easy to spot, as they all start with the reserved META: prefix.

META: data includes information such as file attachments, topic movement history, and form field values. For efficiency reasons, the topic history is not stored in this meta-data, but is expected to be implemented elsewhere by the store engine.

Meta data syntax

Format is the same as for any other macrosexcept that each meta-data macro must be on a line on its own.

%META:<type>{key1="value1" key2="value2" ...}%

The characters %"\r\n{} are encoded in argument values, using the standard URL encoding.

Meta-data is divided into core meta-data, described below, and extension meta-data, which shares the same syntax but is used by extensions.

Dates are stored as "epoch times" i.e. the integer number of seconds since 1st January 1970.

Core meta-data

The following meta-data macros are supported by the Foswiki core. Other macros may be used by extensions; see the extension documentation for more details. The core will read and write these extension macros, but will otherwise ignore them.

Some fields are required by macros, while others are optional. Required fields are marked with a ® symbol. The ® character is not part of the attribute name.

META:TOPICINFO

This macro caches some of the information that would normally be derived from the underlying store engine. It does this for efficiency reasons.

Canonical user identifier of last user to change the topic. The exact format of this depends on the user mapping manager.

version

Topic version; a plain integer.

date

epoch time

format

Format of this topic, will be used for automatic format conversion

reprev

Set when a revision is overwritten by the same author within the {ReplaceIfEditedAgainWithin} window (set in configure). If reprev is the same as version, it prevents Foswiki from attempting to do a 3-way merge when merging overlapping edits by two different users.

Note that the version and date fields are advisory only and cannot be trusted. This is because processes outside of Foswiki's control may write topic files without maintaining these fields.

META:TOPICMOVED

This only exists if the topic has been moved. If a topic is moved more than once, only the most recent META:TOPICMOVED meta datum exists in the topic. Older ones can to be found in the topic history.

META:PREFERENCE

Recommended sequence

There is no absolute need for meta-data macros to be listed in a specific order within a topic, but it makes sense to do so, because form fields are displayed in the order they are defined when the topic is viewed.