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).

AddOn Info

AddOn Author(s): TerjeAndersen  
Copyright: © 2014 CERN
License: GPL (Gnu General Public License)
AddOn Version: 27403 (2014-05-20)
Change History: Item7497: Created RunTopicsAddOn
Dependencies: None
AddOn Home: http://twiki.org/cgi-bin/view/Plugins/RunTopicsAddOn
Feedback: http://twiki.org/cgi-bin/view/Plugins/RunTopicsAddOnDev
Appraisal: http://twiki.org/cgi-bin/view/Plugins/RunTopicsAddOnAppraisal

Related Topics: TWikiAddOns, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2014-03-24 - TerjeAndersen
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    TWiki All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.RunTopicsAddOn