The
TWikiTopicUpgradeScript could distinguish between different types of actions to taken on upgrade, depending on the topic.
At work we did something in that direction: We have a TWiki application distributed over several webs. It is a
TWikiForms based database with one master web and participating webs. The master web has all forms, reports and help pages defined, some of which need to be replicated to the participating webs. Some pages need to be copied only once to the participating webs, some topics need to copied over existing topics. Each topic contains a keyword identifying the type of sync action:
- TopicUpdate(copy), or
- TopicUpdate(mirror)
The "(copy)" action indicates that the topic needs to be copied only once; "(mirror)" indicates an overwrite action on sync. The TopicUpdate has a SEARCH that lists all topics with checkboxes and links to see diffs, produced by a Plugin. Accepting default state of checkboxes and pressing the
Update button is all that's needed to synchronize the topics into the participating webs.
Non-working example illustrating this:
Using this idea, all official topics in the TWiki web could contain a TopicUpdate(<action>) keyword and the installer could upgrade an existing installation intelligently based on this information.
Possible types of actions on a topic:
- TopicUpdate(copy) -- copy once only
- TopicUpdate(mirror) -- copy if not exist, else create new top revision with content of package
- TopicUpdate(prefs) -- copy if not exist, else create new top revision with content of package, but retain the "Set" preferences settings (and if possible also user defined settings) of the installation.
Heck, the TWiki.TopicUpdate topic could even be part of the TWiki distribution so that administrators can see the diffs of selected topics compared to the latest TWiki.org version, then update the docs selectively.
Here is a simulated form of the TWiki.TopicUpdate topic, non-functional:
--
PeterThoeny - 13 Jan 2004