Feature Proposal: TWiki::Func functions for multiple disk support
Motivation
Plug-ins and add-ons may need to do things concerning
UsingMultipleDisks.
Description and Documentation
TWiki::Func will have the following functions
-
getDiskList() -> @diskIDs
Returns IDs of disks used by TWiki. An disk ID is "" (a null string) or a decimal number without leading 0.
-
getDiskInfo($web, $siteName) -> ($dataDir, $pubDir, $diskID)
Returns the relevant paths and the disk ID of the specified web on the specified site.
-
trashWebName(web => $web) -> $trashWebName
Returns the name of the trash web to which topics of the $web web are moved. Each disk (file system) TWiki uses needs to have a trash web since a topic deletion may entail an attachment directory move, which is possible only within the same disk/file system.
-
trashWebName(disk => $diskID) -> $trashWebName
Same as above but specifies a disk ID instead of a web name.
All the corresponding functions already exist in TWiki.pm.
Examples
Let's say you do Trash rotation - Trash10 is deleted, Trash9 is renamed to Trash10, Trash8 is renamed to Trash9, ... Trash is renamed to Trash1, Trash is created from the template.
If you are
UsingMultipleDisks, you have a Trash for each disk - Trashx1x, Trashx2x, ... Trashx1x is rotated to Trashx1x1, Trashx1x2, TWikix1x3, ...
For that, you need
getDiskList(),
trashWebName(),
getDiskInfo().
In most cases, plug-ins and add-ons don't have to worry about on which disk a web resides.
Impact
Implementation
--
Contributors: HideyoImazu - 2012-12-05
Discussion