RunTopicsAddOn
TWiki tool to run \'view\' on a given set of topics in a given set of webs.
Motivation
In some cases, TWikiVariables like %SEARCH{...}% (
VarSEARCH) and %TREEVIEW{...}% (
TreePlugin) can be very resource heavy.
The
VarCachePlugin allows us to cache these variables so that they don't need to be rendered every time.
But each time the cache is out of date, the next user who visits the page will have to wait for the cache to be rebuilt.
This AddOn were made to refresh topics like that by a system actor (a scheduled server job).
When we have many of these topics spanning across several webs, the AddOn can help automating the process.
Usage
RunTopicsAddOn runs 'view' on given topics in given webs, creating a topic if a template is given.
The invoking user is 'admin', so access controls are bypassed. The 'all' keyword works on webs, which selects all webs.
This is handy when your TWiki has several topics using
VarCachePlugin to cache resource-heavy TWiki variables.
The add-on iterates over the topics, visits them, and creates them if a template topic is set.
Examples
Run 'view' on the TreeView topic in all webs, creating it with by cloning Main.TreeViewTemplateTopic if it does not exist:
cd /my/twiki/path/bin/
perl ../runtopics webs=all topics=TreeView Main.TreeViewTemplateTopic
On a fresh TWiki install, this would produce the following output:
Creating Main.TreeView from template Main.TreeViewTemplateTopic ...DONE !
Running 'perl -T view -topic Main.TreeView -user admin ...' DONE! (1.264172)
Creating Sandbox.TreeView from template Main.TreeViewTemplateTopic ...DONE !
Running 'perl -T view -topic Sandbox.TreeView -user admin ...' DONE! (1.235088)
Creating TWiki.TreeView from template Main.TreeViewTemplateTopic ...DONE !
Running 'perl -T view -topic TWiki.TreeView -user admin ...' DONE! (1.624523)
Creating Trash.TreeView from template Main.TreeViewTemplateTopic ...DONE !
Running 'perl -T view -topic Trash.TreeView -user admin ...' DONE! (1.208486)
Creating _default.TreeView from template Main.TreeViewTemplateTopic ...DONE !
Running 'perl -T view -topic _default.TreeView -user admin ...' DONE! (1.240197)
Creating _empty.TreeView from template Main.TreeViewTemplateTopic ...DONE !
Running 'perl -T view -topic _empty.TreeView -user admin ...' DONE! (1.207983)
Run 'view' on the TestTopic topic on WebA and WebB webs. If WebA.TestTopic or WebB.TestTopic does not exist, skip running view on it.
cd /my/twiki/path/bin/
perl ../runtopics webs=WebA, Web,B topics=TestTopic
Installation Instructions
- For an automated installation, run the configure script and follow "Find More Extensions" in the in the Extensions section.
- Or, follow these manual installation steps:
- Download the ZIP file from the extension home on twiki.org (see below).
- Unzip
RunTopicsAddOn.zip
in your twiki installation directory.
- Set the ownership of the extracted directories and files to the webserver user.
- Install the dependencies (if any).
Related Topics: TWikiAddOns,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
TWikiPreferences