We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Plugins Web>ParseTopicTablesPlugin (15 Jan 2007, MikeEggleston)
Tags:
automation1Add my vote for this tag create new tag
, view all tags

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.

Syntax Rules

  • %PARSETOPICTABLES{TOPIC, KEY [, KEY [, KEY...]]}%

Example

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 |

Plugin Settings

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Create a dynamic table based on key/value pairs in TWiki tables

Plugin Installation Instructions

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

Files

  • lib/TWiki/Plugins/ParseTopicTablesPlugin.pm
  • data/TWiki/ParseTopicTablesPlugin.txt

Plugin Info

Plugin Author: TWiki:Main.MikeEggleston
Copyright: © 2006, TWiki:Main.MikeEggleston
License: GPL (GNU General Public License)
Plugin Version: 12 Jan 2007 (V1.000)
Change History:  
12 Jan 2007: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Benchmarks: GoodStyle nn%, FormattedSearch nn%, ParseTopicTablesPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ParseTopicTablesPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ParseTopicTablesPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/ParseTopicTablesPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

-- TWiki:Main.MikeEggleston - 12 Jan 2007

Topic revision: r4 - 15 Jan 2007 - 13:27:30 - MikeEggleston
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback