Parse Topic Tables Plugin
There are times when many simple tables need to be displayed as a single
table with specific columns. This plugin simply parses the given topic,
extracts the given key/value pairs, and creates a new table dynamically.
The first argument is the source topic. The next argument is the primary
key. The dynamic table is sorted on this primary key. The remaining
arguments are parsed and displayed in the dynamic table in the order they
are listed in the command.
-
%PARSETOPICTABLES{TOPIC, KEY [, KEY [, KEY...]]}%
Given tables like:
| hostname | mailhost |
| location | work room |
| user | admin |
| use | sends mail |
| port | 99Z |
| production | yes |
| hostname | loghost |
| location | closet |
| user | admin |
| use | manages server logs |
| port | 99Z |
| production | yes |
- %PARSETOPICTABLES{Systems.HardwareDetails, hostname, location, port, production, use}%
The output is:
| *hostname* | *location* | *port* | *production* | *use* |
| mailhost | workroom | 99Z | yes | sends mail |
| loghost | closet | 99Z | yes | manages server logs |
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Create a dynamic table based on key/value pairs in TWiki tables
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.
Extract
ParseTopicTablesPlugin.zip, edit the ParseTopicTablesPlugin-topic to
your needs and have fun. There is an install script at the top of
the unpacked director that might help with installing this plugin.
Execute this script by:
-
# unzip -v ParseTopicTablePlugin.zip
-
# cd twikiParseTopicTables
-
# ./install.sh /var/www/html/twiki
- change the above path to where your twiki is installed
-
lib/TWiki/Plugins/ParseTopicTablesPlugin.pm
-
data/TWiki/ParseTopicTablesPlugin.txt
Related Topics: TWikiPlugins,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
TWikiPreferences
--
TWiki:Main.MikeEggleston - 12 Jan 2007