Insert Version Plugin#

See also VersionLabel

Normally, all links on a wiki page point to the latest version of a page. The purpose of this plugin is to inject, after each link, a version link which points to a specific version of that page based on some criteria.
--DF, July 05

The plugin supports following criteria :

  • Link to the most recent page version referring another page (refersTo criteria)
  • Link to the most recent page version containing some metadata (see WikiVariables, HowToAssignAVariable) I.o.w., the page contains something like [{SET aParam='someValue' }]

This allows you to baseline a set of pages and easily go back in time and reconstruct a consistent set of those pages. For example: pages could have a certain status info like draft, review, approved, stable. This plugin would allow you to look at all stable pages.

Usage#

The InsertVersionPlugin is similar to the InsertPage Plugin : it inserts the contents of another page and injects version links to page versions matching the criteria parameters of the plugin.


[{brushed.jspwiki.versionplugin.InsertVersion page="UseCaseIndex" status="Approved" }]
[{InsertVersion page="UseCaseIndex" refersTo="Approved" }]
[{InsertVersion page="UseCaseIndex" status="Approved" }]

[{InsertVersion page="UseCaseIndex" status="Approved" 
linkStyle='background:yellow; font-size:83%; vertical-align:super;' }]

Parameters#

  • page : Name of the page. Mandatory
  • refersTo : Match agains page versions which refer to this page name. Optional (*)
  • <metadata> : Metadata (name='value') to match against the page version. Any name different from the other parameters will do. Optional (*)
  • linkClass : CSS class name to format the inserted links. The class definition should appear in your jspwiki.jss. Optional, default is insertVersionLink
  • linkStyle : CSS style to format the inserted links. Optional.

(*) Either refersTo or <metadata> have to be present. Otherwise the plugin will raise an exception.

Warning: this plugin will take some time since it has to walk through ALL versions of all referred pages. Especially if the criteria is not matched earlier. Since JSPWiki makes a new version on every edit, this could be quite some work. Be patient.

The injected version link

  • links to the matched version of the page: Wiki.jsp?page=<name>&version=<nn>.
  • shows the relative offset versus the latest version inside square brackets (eg. [-4] )
  • has a tooltip with the matched criteria: copy of the refersTo link or the metadata
  • is not visible when none of the versions matches the plugin criteria

Example output (with example formatting)#

  • some link to a page which has no versions matching the plugin criteria
  • some other link [=] to a page of which the latest version matches the plugin criteria
  • some more link [-3] to a page of which the 3rd last version matches the plugin criteria.

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
jar
InsertVersion.jar 3.9 kB 1 12-Jul-2005 22:04 DirkFrederickx
« This page (revision-3) was last changed on 31-Jul-2005 14:06 by JanneJalkanen