key Log In or Register to edit

HistoryPlugin

This plugin shows a complete or partial history of a document. The output can arbitrarily be formatted. An example for a Wikimedia-like history is included.

Syntax Rules

  • %HISTORY%
  • %HISTORY{parameters}
    Supported parameters:
    Parameter Description Default
    "format" or format="format" Format of one line, may include any variable which is supported by %REVINFO% "r1.$rev - $date - $wikiusername"
    topic="topic" Topic name Current topic
    web="web" Web name Current web
    nrev="nrev" Number of revisions to show. Ignored, if both rev1 and rev2 are specified Plugin preference variable NREV
    rev2="rev2" Newest revision to show rev1+nrev, if rev1 is specified, latest revision otherwise
    rev1="rev1" Oldest revision to show rev2-nrev
    reverse="on/off" Show newest revisions first, if on "on"
    header="text" Text to print before the list. May contain the variables $next and $previous (see below) "$next"
    footer="text" Text to print after the list. May contain the variables $next and $previous (see below) "$previous"

The parameters header and footer may contain the variables $next and $previous, which will only be evaluated, if there are newer or older revisions available for the topic which are not listed according to rev1, rev2, nrev. These variables take the syntax $next{'text' url='url'} (analog for $previous). text is the text which should be printed, url is the url for a corresponding link. The variables $rev1, $rev2, $nrev in text or url will be replaced by appropriate values for the next or previous block of revisions. See the attached oopshistory.tmpl for an example of how to use this.

The following variables are replaced only, if there is a corresponding %HISTORY% on the page. If more than one %HISTORY% is used on the same page, the values from the last one will be used.

  • %HISTORY_REV1%: Oldest revision from the printed history
  • %HISTORY_REV2%: Latest revision from the printed history
  • %HISTORY_NREV%: Number of the printed revisions
  • %HISTORY_MAXREV%: Latest available revision of the document

Examples

The call %HISTORY% shows a simple list of available revisions like

r1.3 - 17 Feb 2005 - 09:56 - AnUser
r1.2 - 31 Dec 2004 - 10:22 - AnotherUser
r1.1 - 15 Nov 2003 - 01:23 - YetAnotherUser

For a more complex example see the attached oopshistory.tmpl which also allows the comparison of two selected revisions.

Example screenshot from oopshistory.tmpl:
screenshot.png

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %INTERWIKIPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the Text Formatting Rules topic:
    • Set SHORTDESCRIPTION = Shows a complete history of a document

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

  • Default number of printed revisions:
    • Set NREV = 10

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 server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip HistoryPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/HistoryPlugin.txt Plugin topic
    data/TWiki/HistoryPlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/HistoryPlugin.pm Plugin Perl module
    templates/oopshistory.tmpl Template for history page
    pub/TWiki/HistoryPlugin/screenshot.png Example screen shot
  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.
  • Test if the installation was successful:

Plugin Info

Plugin Author: TWiki:Main/JChristophFuchs
Plugin Version: 17 Feb 2005 (V1.000)
Change History:  
9 Apr 2006: Updated for new PatternSkin in TWikiRelease04x00x02
17 Feb 2005: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.024
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: Good Style 100%, Formatted Search 99%, History Plugin 97%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/HistoryPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/HistoryPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/HistoryPluginAppraisal

Related Topics: T Wiki Preferences, T Wiki Plugins

-- TWiki:Main/JChristophFuchs - 17 Feb 2005

 
Ad Sponsor
Back to Redbourn
Copyright © We make no guarantee of the correctness of the content of this site. All material on this collaboration platform is the property of Martin Cleaver and the contributing authors.