The ProgressBarPlugin creates a graphical representation of a percentage number. Setting the percentage to "X" will create a bar with the left X% of its width draw in green and the remaining (1 - X)% in red. The bar is implemented as two "img" entries aligned inside a table cell, with the same height, and with the width calculated based on the "width" and "percentage" parameters.

The typical usage is to indicate how close to completion a given task is in a project management situation; other uses include representing the number of testcases succesfully executed, the percentage of code covered by unit tests, and so on.

This plugin is a very simple extension of the [Image] plugin created by JanneJalkanen. Most of the parameters are the same. For simplicity I am also using the same package name as the other standard JSPWiki plugins.


;__percentage__ = '' 'Percentage' '': The percentage number that the bar should reflect[1].
;__src_left__ = '' 'Image source(left)' '': This can either be a full URL (http://...) or a [WikiAttachment] name.  If not provided, "images/green.png" will be used. Copy the attached file to the "images" directory under you wiki installation.
;__src_right__ = '' 'Image source(right)' '': This can either be a full URL (http://...) or a [WikiAttachment] name.  If not provided, "images/red.png" will be used. See above.
;__align__ = '' 'left|right|center' '': The image alignment.
;__height__ = '' 'integer' '': The height of the image. If not provided a default value will be used.
;__width__ = '' 'integer' '': The combined width of the bar. If not provided a default value will be used[1]. 
;__caption__ = '' 'caption text' '': The text that should be shown as a caption under the image.
;__link__ = '' 'hyperlink' '': A hyperlink (http://...).
;__border__ = '' 'integer' '': Size of the image border.
;__style__ = '' 'style info' '': Any style markup you would like to apply to the table surrounding the image.
;__class__ = '' 'class name' '': Redefine the default class for this image, which is "imageplugin".

The ''alt text'' of the image is always set to reflect the percentage number.

[{ProgressBar percentage=30 }]

Shows a progress bar reflecting a 30% completion rate.


;__{{.imageplugin}}__: The table that encompasses the image.  It consists of two subcategories:
;:__{{img}}__ = IMG tag that gets embedded.
;:__{{caption}}__ = caption that is embedded.

[#1] Use only an integer number; in particular, do not attach a '%' character.

I recompiled against 2.4 and changed the package from com.ecyrd.jspwiki to something else ot fix the problem with it not being signed and JSPWiki being signed.  See more [here|http://blog.jspwiki.org/wiki/Main_blogentry_260106_1}.  The new uploaded Jar should now work in both versions.

Joseph Schmigel - 15.09.06