Skip to content

Commit

Permalink
Item1254: Port GuagePlugin to Foswiki; Update docs; Added NO_PREFS_IN…
Browse files Browse the repository at this point in the history
…_TOPIC; run tidy

git-svn-id: http://svn.foswiki.org/trunk/GaugePlugin@3178 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
AndrewJones authored and AndrewJones committed Mar 18, 2009
1 parent 2e212fd commit e099881
Show file tree
Hide file tree
Showing 14 changed files with 347 additions and 313 deletions.
104 changes: 49 additions & 55 deletions data/TWiki/GaugePlugin.txt → data/System/GaugePlugin.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
%META:TOPICINFO{author="PeterThoeny" date="1051855680" format="1.0" version="1.7"}%
---+ Gauge Plugin
%META:TOPICINFO{author="ProjectContributor" date="1051855680" format="1.0" version="1.7"}%
---+!! !GaugePlugin
<!--
One line description, required for extensions repository catalog.
* Set SHORTDESCRIPTION = Build dashboards that contain graphical images of gauges defined with =%<nop>GAUGE{}%= variables.
-->
%SHORTDESCRIPTION%

%TOC%

---++ Description

This plugin can be used to build dashboards that contain graphical images of gauges like %ATTACHURL%/tambar1.gif (target measure gauge) and %ATTACHURL%/trendup.gif (trend icons).

Expand All @@ -15,29 +24,25 @@ The upper value region (the thick bar) has two colors, a dark color used for act

The =%<nop>GAUGE{...}%= variable gets expanded to an image representing the gauge. Parameters and global settings determine the type of gauge, dimensions, scale and values.

---++ <nop>%TOPIC% Global Settings
---++ Plugin Settings

Plugin settings are stored as preferences variables. To reference
a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, for example, ==%<nop>INTERWIKIPLUGIN_SHORTDESCRIPTION%==

* One line description, shown in the %SYSTEMWEB%.TextFormattingRules topic:
* Set SHORTDESCRIPTION = Build dashboards that contain graphical images of gauges defined with =%<nop>GAUGE{}%= variables.
Plugin settings are stored as preferences values. To change the setting you need to overwrite them in %WIKIPREFSTOPIC%. Changing them here will have no effect! This allows you to upgrade the plugin without having worry about loosing your settings.

* Set DEBUG to 1 to get debug messages in =data/debug.txt=. Default: =0=
* Set DEBUG = 0
* Set GAUGEPLUGIN_DEBUG = 0

* Default gauge used: =tambar=, =trend=. Default: =tambar=
* Set TYPE = tambar
* Set GAUGEPLUGIN_TYPE = tambar

* Default dimensions, scale and colors for Target Measure Bar. See details in the syntax rules.
* Set TAMBAR_WIDTH = 60
* Set TAMBAR_HEIGHT = 16
* Set TAMBAR_SCALE = 0, 33, 67, 100
* Set TAMBAR_COLORS = #FF0000, #FFCCCC, #FFFF00, #FFFFCC, #00FF00, #CCFFCC
* Set GAUGEPLUGIN_TAMBAR_WIDTH = 60
* Set GAUGEPLUGIN_TAMBAR_HEIGHT = 16
* Set GAUGEPLUGIN_TAMBAR_SCALE = 0, 33, 67, 100
* Set GAUGEPLUGIN_TAMBAR_COLORS = #FF0000, #FFCCCC, #FFFF00, #FFFFCC, #00FF00, #CCFFCC

* Default dimensions for Trend Icon
* Set TREND_WIDTH = 16
* Set TREND_HEIGHT = 16
* Set GAUGEPLUGIN_TREND_WIDTH = 16
* Set GAUGEPLUGIN_TREND_HEIGHT = 16

---++ Syntax Rules

Expand Down Expand Up @@ -70,49 +75,38 @@ The "if installed" column shows images instead of variables in case the plugin i

If the required parameters are not defined, then an error message is returned or an &lt;img ... /&gt; image tag is returned pointing to a graphic containing the error message.

---++ Plugin Installation Instructions

__Note:__ You do not need to install anything on your 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 ==%TOPIC%.zip== in your twiki installation directory. Content:
| *File:* | *Description:* |
| ==lib/Foswiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
| ==data/System/%TOPIC%.txt== | Plugin topic |
| ==data/System/%TOPIC%.txt,v== | Plugin topic repository |
| ==data/TWiki/GaugePluginTests.txt== | Test page containing many examples of the <nop>GaugePlugin in action. Also shows various error conditions |
| ==data/TWiki/GaugePluginTests.txt,v== | RCS file for above |
| ==pub/TWiki/GaugePlugin/tambar1.gif== | Sample =tambar= image |
| ==pub/TWiki/GaugePlugin/trenddn.gif== | =trend= down arrow |
| ==pub/TWiki/GaugePlugin/trendeq.gif== | =trend= no change arrow |
| ==pub/TWiki/GaugePlugin/trendup.gif== | =trend= up arrow |
| ==pub/TWiki/GaugePlugin/trendnd.gif== | =trend= error message if =value= is not specified |
* (Dakar) Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section.
* Test if the plugin is correctly installed:
* Check above examples if the "if installed" column shows images instead of variables.
* Check GaugePluginTests for some more test
---++ Installation Instructions

%$INSTALL_INSTRUCTIONS%

---++ Plugin Files

| *File:* | *Description:* |
%$MANIFEST%

---++ Plugin Info

| Plugin Author: | %SYSTEMWEB%.PeterThoeny, TWiki:Main/TaitCyrus |
| Plugin Version: | 01 May 2003 |
| Change History: | <!-- specify latest version first -->&nbsp; |
| 01 May 2003: | Added time stamp to image to prevent browser from caching images; ignore non-numerical chars in value parameter; fixed warnings (V1.002) |
| 08 Sep 2002: | Added missing binmode (for Windows); pass parameters also to error image (V1.001) |
| 23 May 2002: | Initial version (V1.0) |
| 16 May 2002: | Initial spec (V1.0) |
| CPAN Dependencies: | GD from http://stein.cshl.org/WWW/software/GD |
| Other Dependencies: | gd library from http://www.boutell.com/gd (Tested with 1.8.4)<br /> PNG graphics library from http://www.libpng.org/pub/png |
| Perl Version: | 5.005 |
| Plugin Author(s): | Foswiki:Main.AndrewJones |
| Previous Author(s): | TWiki:Main.PeterThoeny, TWiki:Main.TaitCyrus |
| Copyright: | &copy; 2009, Andrew Jones, &copy; 2002 - 2006, Peter Thoeny |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Plugin Release: | %$RELEASE% |
| Plugin Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 18 Mar 2009 | Foswiki:Tasks.Item1254 - New 1.0 release for Foswiki - Foswiki:Main.AndrewJones |
| 01 May 2003: | Added time stamp to image to prevent browser from caching images; ignore non-numerical chars in value parameter; fixed warnings |
| 08 Sep 2002: | Added missing binmode (for Windows); pass parameters also to error image |
| 23 May 2002: | Initial version |
| 16 May 2002: | Initial spec |
| Dependencies: | %$DEPENDENCIES% |
| Plugin Home: | http://foswiki.org/Extensions/%TOPIC% |
| Feedback: | http://foswiki.org/Extensions/%TOPIC%Dev |
| Support: | http://foswiki.org/Support/%TOPIC% |


__Related Topics:__ %SYSTEMWEB%.DefaultPreferences, %USERSWEB%.SitePreferences, [[%SYSTEMWEB%.Plugins][Plugins]]

-- TWiki:Main/TaitCyrus - 23 May 2002 <br />
-- %SYSTEMWEB%.PeterThoeny - 01 May 2003
%META:FILEATTACHMENT{name="tambar1.gif" attr="h" comment="Target Measure Bar, 60x16 example" date="1021945424" path="C:\Data\MyTWiki\Plugins\GaugePlugin\pub\Plugins\GaugePlugin\tambar1.gif" size="932" user="PeterThoeny" version="1.1"}%
%META:FILEATTACHMENT{name="trendup.gif" attr="h" comment="Trend Up Icon 16x16" date="1021945466" path="C:\Data\MyTWiki\Plugins\GaugePlugin\pub\Plugins\GaugePlugin\trendup.gif" size="877" user="PeterThoeny" version="1.1"}%
%META:FILEATTACHMENT{name="trenddn.gif" attr="h" comment="Trend Down Icon 16x16" date="1021945479" path="C:\Data\MyTWiki\Plugins\GaugePlugin\pub\Plugins\GaugePlugin\trenddn.gif" size="875" user="PeterThoeny" version="1.1"}%
%META:FILEATTACHMENT{name="trendeq.gif" attr="h" comment="Trend Equal Icon 16x16" date="1021945497" path="C:\Data\MyTWiki\Plugins\GaugePlugin\pub\Plugins\GaugePlugin\trendeq.gif" size="869" user="PeterThoeny" version="1.1"}%
%META:FILEATTACHMENT{name="trendnd.gif" attr="h" comment="Trend No Data Icon 16x16" date="1021945521" path="C:\Data\MyTWiki\Plugins\GaugePlugin\pub\Plugins\GaugePlugin\trendnd.gif" size="875" user="PeterThoeny" version="1.1"}%
%META:FILEATTACHMENT{name="tambar1.gif" attr="h" comment="Target Measure Bar, 60x16 example" date="1021945424" path="tambar1.gif" size="932" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="trendup.gif" attr="h" comment="Trend Up Icon 16x16" date="1021945466" path="trendup.gif" size="877" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="trenddn.gif" attr="h" comment="Trend Down Icon 16x16" date="1021945479" path="trenddn.gif" size="875" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="trendeq.gif" attr="h" comment="Trend Equal Icon 16x16" date="1021945497" path="trendeq.gif" size="869" user="ProjectContributor" version="1.1"}%
%META:FILEATTACHMENT{name="trendnd.gif" attr="h" comment="Trend No Data Icon 16x16" date="1021945521" path="trendnd.gif" size="875" user="ProjectContributor" version="1.1"}%
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="PeterThoeny" date="1022193900" format="1.0" version="1.2"}%
%META:TOPICINFO{author="ProjectContributor" date="1022193900" format="1.0" version="1.2"}%
%META:TOPICPARENT{name="GaugePlugin"}%
*Tests for GaugePlugin*

Expand Down Expand Up @@ -138,6 +138,3 @@
%TABLE{ sort="off" tableborder="1" cellpadding="1" cellspacing="1" headerbg="#99CCCC" databg="#C8CB8F,#DBDDB5" }%
| *Try an invalid =type= gauge* ||
| %GAUGE{ type="bad" value="1" }% | type="bad" value="1" |

-- Main.TaitCyrus - 20 May 2002 <br />
-- Main.PeterThoeny - 20 May 2002
Loading

0 comments on commit e099881

Please sign in to comment.