Welcome, Registration, and other StartingPoints; TWiki history & Wiki style; All the docs...
View   r32  >  r31  >  r30  >  r29  >  r28  >  r27  ...
TWikiPlugins 32 - 06 Jan 2007 - Main.TWikiContributor
Line: 1 to 1
 

TWiki Plugins

Line: 17 to 17
 TWiki Plugins are developed and contributed by interested members of the community. Plugins are provided on an 'as is' basis; they are not a part of TWiki, but are independently developed and maintained.
Changed:
<
<
TIP Tip: TWiki:TWiki.TWikiPluginsSupplement on TWiki.org has supplemental documentation on TWiki Plugins.
>
>
Relevant links on TWiki.org:

See other types of extensions: TWikiAddOns, TWikiContribs, TWikiSkins

 

Installing Plugins

Line: 39 to 46
 The performance of the system depends to some extent on the number of Plugins installed and on the Plugin implementation. Some Plugins impose no measurable performance decrease, some do. For example, a Plugin might use many Perl libraries that need to be initialized with each page view (unless you run mod_perl). You can only really tell the performance impact by installing the Plugin and by measuring the performance with and without the new Plugin. Use the TWiki:Plugins.PluginBenchmarkAddOn, or test manually with the Apache ab utility. Example on Unix:
time wget -qO /dev/null /twiki/bin/view/TWiki/AbcPlugin
Changed:
<
<
TIP If you need to install an "expensive" Plugin, and you need its functionality only in one web, you can place the Plugin topic into that web. TWiki will initialize the Plugin only if the Plugin topic is found (which won't be the case for other webs.)
>
>
TIP If you need to install an "expensive" Plugin, but you only need its functionality only in a subset of your data, you can disable it elsewhere by defining the %DISABLEDPLUGINS% TWiki variable.

Define DISABLEDPLUGINS to be a comma-separated list of names of plugins to disable. Define it in Main.TWikiPreferences to disable those plugins everywhere, in the WebPreferences topic to disable them in an individual web, or in a topic to disable them in that topic. For example,

   * Set DISABLEDPLUGINS = SpreadSheetPlugin, EditTablePlugin
 

Managing Installed Plugins

Line: 56 to 68
 

Plugin-Specific Settings

Changed:
<
<
Plugin-specific settings are done in individual Plugin topics. Two settings are standard for each Plugin:
  1. One line description, used to form the bullets describing the Plugins in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Create dynamic foo bar reports
  2. Debug Plugin, output can be seen in data/debug.txt. Set to 0=off or 1=on:
    • Set DEBUG = 0
  • The settings can be retrieved as Preferences variables like %<pluginname>_<var>%. For example, %DEFAULTPLUGIN_SHORTDESCRIPTION% shows the description of the DefaultPlugin.
>
>
Plugins are usually configured by variables accessible though the configure interface, but in some cases (usually older plugins) TWiki preferences are used. If a TWiki variable is defined in a Plugin topic e.g:
  • Set SETTING = Create dynamic foo bar reports
Then these settings can be retrieved as preferences variables like %<pluginname>_<var>%. For example, %RUBBERPLUGIN_SETTING% shows the value of SETTING in the RubberPlugin topic.
 

Listing Active Plugins

Line: 240 to 249
 

Web Accessible Data

Changed:
<
<
Topic-specific data such as generated images can be stored in the topics attachment area, which is web accessible. Use the TWiki::Func::saveAttachment() function to store the data.
>
>
Topic-specific data such as generated images can be stored in the topic's attachment area, which is web accessible. Use the TWiki::Func::saveAttachment() function to store the data.
 Recommendation for file name:
  • Prefix the filename with an underscore (the leading underscore avoids a nameclash with files attached to the same topic)

TWikiPlugins 31 - 27 Mar 2005 - Main.TWikiContributor
Line: 1 to 1
 

TWiki Plugins

Line: 33 to 33
 The recommended approach to testing new Plugins before making them public is to create a second local TWiki installation, and test the Plugin there. You can allow selected users access to the test area. Once you are satisifed that it won't compromise your main installation, you can install it there as well.
Changed:
<
<
InstalledPlugins shows which Plugins are: 1) installed, 2) loading properly, and 3) what TWiki:Codev.PluginHandlers they invoke. Any failures are shown in the Errors section. The %FAILEDPLUGINS% variable can be used to debug failures. You may also want to check your webserver error log and the various TWiki log files.
>
>
InstalledPlugins shows which Plugins are: 1) installed, 2) loading properly, and 3) what TWiki:Codev.PluginHandlers they invoke. Any failures are shown in the Errors section. The %FAILEDPLUGINS% variable can be used to debug failures. You may also want to check your webserver error log and the various TWiki log files.
 

Some Notes on Plugin Performance

Line: 115 to 115
 
    • The Plugin initialization code does not register a Plugin that returns FALSE (or that has no initPlugin handler).

  • $TWiki::Plugins::VERSION in the TWiki::Plugins module contains the TWiki Plugin API version, currently 1.11.
Changed:
<
<
    • You can also use the %PLUGINVERSION{}% variable to query the Plugin API version or the version of installed Plugins.
>
>
    • You can also use the %PLUGINVERSION{}% variable to query the Plugin API version or the version of installed Plugins.
 

Security


TWikiPlugins 30 - 27 Mar 2005 - Main.TWikiContributor
Line: 1 to 1
 

TWiki Plugins

Changed:
<
<
Plug-in enhanced feature add-ons, with a Plugin API for developers
>
>
Add functionality to TWiki with readily available Plugins; create Plugins based on APIs
 

Overview

Changed:
<
<
You can add Plugins to extend TWiki's functionality, without altering the core program code. A plug-in approach lets you:
>
>
You can add Plugins to extend TWiki functionality, without altering the core code. A plug-in approach lets you:
 
  • add virtually unlimited features while keeping the main TWiki code compact and efficient;
  • heavily customize an installation and still do clean updates to new versions of TWiki;
Line: 15 to 15
 Everything to do with TWiki Plugins - demos, new releases, downloads, development, general discussion - is available at TWiki.org, in the TWiki:Plugins web.
Changed:
<
<

Preinstalled Plugins

>
>
TWiki Plugins are developed and contributed by interested members of the community. Plugins are provided on an 'as is' basis; they are not a part of TWiki, but are independently developed and maintained.
 
Changed:
<
<
TWiki comes with a set of Plugins as part of the standard installation.

  • DefaultPlugin? : Optionally handles some legacy variables from older versions of TWiki. You can control this option from TWikiPreferences. (Perl programmers can also add rules for simple custom processing.)
  • EmptyPlugin: Is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development
  • CommentPlugin: Allows users to quickly post comments to a page without an edit/preview/save cycle.
  • InterwikiPlugin: Use it for shorthand linking to remote sites, ex: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can edit the predefined set of of Wiki-related sites, and add your own
  • EditTablePlugin: Edit TWiki tables using edit fields, date pickers and drop down boxes
  • RenderListPlugin: Render bullet lists in a variety of formats
  • SlideShowPlugin: Create web based presentations based on topics with headings.
  • SmiliesPlugin: Render smilies as icons, like smile for  :-) or eek! for  :eek:
  • SpreadSheetPlugin: Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables and other topic text
  • TablePlugin: Control attributes of tables and sorting of table columns
>
>
TIP Tip: TWiki:TWiki.TWikiPluginsSupplement on TWiki.org has supplemental documentation on TWiki Plugins.
 

Installing Plugins

Changed:
<
<
Each TWikiPlugin comes with full documentation: step-by-step installation instructions, a detailed description of any special requirements, version details, and a working example for testing.
>
>
Each TWiki Plugin comes with its own documentation: step-by-step installation instructions, a detailed description of any special requirements, version details, and a working example for testing. Many Plugins have an install script that automates these steps for you.

Special Requirements: Some Plugins need certain Perl modules to be preinstalled on the host system. Plugins may also use other resources, like graphics, other modules, applications, and templates. You should be able to find detailed instructions in the Plugin's documentation.

 
Changed:
<
<
Most Plugins can be installed in three easy steps, with no programming skills required:
  1. Download the zip file containing the Plugin, documentation, and any other required files, from TWiki:Plugins.
  2. Distribute the files to their proper locations - unzip the zip archive in your TWiki installation directory - if have a standard TWiki installation, this will distribute automatically. Otherwise, place the files according to the directory paths listed on the Plugin top in TWiki:Plugins.
  3. Check the demo example on the Plugin topic: if it's working, the installation was fine!

Special Requests: Some Plugins need certain Perl modules to be preinstalled on the host system. Plugins may also use other resources, like graphics, other modules, applications, templates. In these cases, detailed instructions are in the Plugin documentation.

Each Plugin has a standard release page, located in the TWiki:Plugins web at TWiki.org. In addition to the documentation topic (SomePlugin), there's a separate development page.

  • Doc page: Read all available info about the Plugin; download the attached distribution files.
  • Dev page: Post feature requests, bug reports and general dev comments; topic title ends in Dev (SomePluginDev).
  • User support: Post installation, how to use type questions (and answers, if you have them) in the TWiki:Support web.
>
>
Each Plugin has a standard release topic, located in the TWiki:Plugins web at TWiki.org. There's usually a number of other related topics, such as a developers page, and an appraisal page.
 

On-Site Pretesting

Changed:
<
<
To test new Plugins on your installation before making them public, you may want to use one of these two approaches:

  • Method 1: Safely test on-the-fly by creating separate Production and Test branches in your live TWiki installation.
    • Duplicate the twiki/bin and twiki/lib directories for the Test version, and adjust the paths in the new lib/TWiki.cfg. The following directories are shared: twiki/data, twiki/templates and twiki/pub.
    • Test Plugins and other new features in the Test installation until you're satisfied.
      • ALERT! If you modify topics using the new features, live users will likely see unfamiliar new META tags showing up on their pages - to avoid this, create and edit test-only topics to try out new features.
    • Copy the modified files to the Production installation. You can update a TWiki installation live and users won't even notice.
>
>
The recommended approach to testing new Plugins before making them public is to create a second local TWiki installation, and test the Plugin there. You can allow selected users access to the test area. Once you are satisifed that it won't compromise your main installation, you can install it there as well.
 
Changed:
<
<
  • Method 2: List the Plugin being tested in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Sandbox web and do the testing there.
>
>
InstalledPlugins shows which Plugins are: 1) installed, 2) loading properly, and 3) what TWiki:Codev.PluginHandlers they invoke. Any failures are shown in the Errors section. The %FAILEDPLUGINS% variable can be used to debug failures. You may also want to check your webserver error log and the various TWiki log files.
 
Changed:
<
<

Checking that Plugins are Working on a Live Server

>
>

Some Notes on Plugin Performance

 
Changed:
<
<
InstalledPlugins shows which Plugins are: 1) installed, 2) loading properly and 3) what TWiki:Codev.PluginHandlers they invoke. Any failures are shown in the Errors section.
>
>
The performance of the system depends to some extent on the number of Plugins installed and on the Plugin implementation. Some Plugins impose no measurable performance decrease, some do. For example, a Plugin might use many Perl libraries that need to be initialized with each page view (unless you run mod_perl). You can only really tell the performance impact by installing the Plugin and by measuring the performance with and without the new Plugin. Use the TWiki:Plugins.PluginBenchmarkAddOn, or test manually with the Apache ab utility. Example on Unix:
time wget -qO /dev/null /twiki/bin/view/TWiki/AbcPlugin
 
Changed:
<
<

A Note on Plugin Performance

>
>
TIP If you need to install an "expensive" Plugin, and you need its functionality only in one web, you can place the Plugin topic into that web. TWiki will initialize the Plugin only if the Plugin topic is found (which won't be the case for other webs.)
 
Changed:
<
<
The performance of the system depends on the number of Plugins installed and on the Plugin implementation. Some Plugins impose no measurable performance decrease, some do. For example, outsidePREHandler is an expensive callback function, or a Plugin might use many Perl libraries that need to be initialized with each page view (unless you run mod_perl). It is recommended to measure the performance with and without a new Plugin. Example for Unix:
time wget -qO /dev/null http://moglen.law.columbia.edu/twiki/bin/view/TWiki/AbcPlugin
>
>

Managing Installed Plugins

 
Changed:
<
<
In case you need to install an "expensive" Plugin and you need its functionality only in one web you can place the Plugin topic into that web. TWiki will initialize the Plugin only if the Plugin topic is found (which won't be the case for other webs.)
>
>
Some Plugins require additional settings or offer extra options that you have to select. Also, you may want to make a Plugin available only in certain webs, or temporarily disable it. And may want to list all available Plugins in certain topics. You can handle all of these management tasks with simple procedures:
 
Changed:
<
<

Managing Plugins

>
>

Enabling Plugins

 
Changed:
<
<
When you finish installing a Plugin, you should be able to read the user instructions and go. In fact, some Plugins require additional settings or offer extra options that you have to select. Also, you may want to make a Plugin available only in certain webs, or temporarily disable it. And may want to list all available Plugins in certain topics. You can handle all of these management tasks with simple procedures.
>
>
Plugins can be enabled and disabled with the configure script. An installed Plugin needs to be enabled before it can be used.
 
Changed:
<
<

Setting Preferences

>
>

Plugin Evaluation Order

 
Changed:
<
<
Installed Plugins can be toggled on or off, site-wide or by web, through TWikiPreferences and individual WebPreferences:
>
>
By default, TWiki executes Plugins in alphabetical order on Plugin name. It is possible to change the order, for example to evaluate database variables before the speadsheet CALCs. This can be done with {PluginsOrder} in the Plugins section of configure.
 
Changed:
<
<
  • All Plugin modules present in the lib/TWiki/Plugins directory are activated automatically unless disabled by the DISABLEDPLUGINS Preferences variable in TWikiPreferences. You can optionally list the installed Plugins in the INSTALLEDPLUGINS Preferences variable. This is useful to define the sequence of Plugin execution, or to specify other webs than the TWiki web for the Plugin topics. Settings in TWikiPreferences are:
    • Set INSTALLEDPLUGINS = DefaultPlugin, ...
    • Set DISABLEDPLUGINS = EmptyPlugin, ...
>
>

Plugin-Specific Settings

 
Changed:
<
<
Plugin execution order in TWiki is determined by searching Plugin topics in a specific sequence: First, full web.topicname name, if specified in INSTALLEDPLUGINS; next, the TWiki web is searched; and finally, the current web.

Plugin-specific settings are done in individual Plugin topics. Two settings are standard for each Plugin:

>
>
Plugin-specific settings are done in individual Plugin topics. Two settings are standard for each Plugin:
 
  1. One line description, used to form the bullets describing the Plugins in the TextFormattingRules topic:
Changed:
<
<
    • Set SHORTDESCRIPTION = Blah blah woof woof.
>
>
    • Set SHORTDESCRIPTION = Create dynamic foo bar reports
 
  1. Debug Plugin, output can be seen in data/debug.txt. Set to 0=off or 1=on:
    • Set DEBUG = 0
Changed:
<
<
  • The settings can be retrieved as Preferences variables like %<pluginname>_<var>%, ex: %DEFAULTPLUGIN_SHORTDESCRIPTION% shows the description of the DefaultPlugin.
>
>
  • The settings can be retrieved as Preferences variables like %<pluginname>_<var>%. For example, %DEFAULTPLUGIN_SHORTDESCRIPTION% shows the description of the DefaultPlugin.
 

Listing Active Plugins

Changed:
<
<
Plugin status variables let you list all active Plugins wherever needed. There are two list formats:
  • The %ACTIVATEDPLUGINS% variable lists activated Plugins by name. (This variable is displayed in TWikiPreferences for debugging use.)
  • The %PLUGINDESCRIPTIONS% variable displays a bullet list with a one-line description of each active Plugins. This variable is based on the %<plugin>_SHORTDESCRIPTION% Preferences variables of individual topics and is shown in TextFormattingRules.
>
>
Plugin status variables let you list all active Plugins wherever needed.
 
Changed:
<
<
DEMO: Automatically List Active Plugins Using Variables
>
>

%ACTIVATEDPLUGINS%

On this TWiki site, the enabled Plugins are: SpreadSheetPlugin, ActionTrackerPlugin, AttachmentListPlugin, BreadCrumbsPlugin, CalendarPlugin, CommentPlugin, CompareRevisionsAddonPlugin, EditTablePlugin, FilterPlugin, FlexWebListPlugin, FootNotePlugin, GluePlugin, IfDefinedPlugin, InterwikiPlugin, JQueryPlugin, NatSkinPlugin, PreferencesPlugin, RedDotPlugin, RenderListPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TreeBrowserPlugin, TreePlugin, TwistyPlugin, VotePlugin, WysiwygPlugin.
 
Changed:
<
<
Using %ACTIVATEDPLUGINS%:
On this TWiki site, the active Plugins are: SpreadSheetPlugin, ActionTrackerPlugin, AttachmentListPlugin, BreadCrumbsPlugin, CalendarPlugin, CommentPlugin, CompareRevisionsAddonPlugin, EditTablePlugin, FilterPlugin, FlexWebListPlugin, FootNotePlugin, GluePlugin, IfDefinedPlugin, InterwikiPlugin, JQueryPlugin, NatSkinPlugin, PreferencesPlugin, RedDotPlugin, RenderListPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TreeBrowserPlugin, TreePlugin, TwistyPlugin, VotePlugin, WysiwygPlugin.

Using %PLUGINDESCRIPTIONS%:
You can use any of these active TWiki Plugins:

>
>

%PLUGINDESCRIPTIONS%

 
  • SpreadSheetPlugin (any TWiki, 10197): Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables and other topic text
  • ActionTrackerPlugin (21 May 2007, $Rev: 14969 (20 Sep 2007) $): Adds support for action tags in topics, and automatic notification of action statuses
  • AttachmentListPlugin (1.0.1, $Rev: 15921 (07 Dec 2007) $): Displays a formattable list of topic attachments, anywhere in a topic.
  • BreadCrumbsPlugin (v1.00, $Rev: 13657 (08 May 2007) $): A flexible way to display breadcrumbs navigation
  • CalendarPlugin (Dakar, 9113): Show a monthly calendar with highlighted events
  • CommentPlugin (Dakar, 11359): Allows users to quickly post comments to a page without an edit/preview/save cycle
  • CompareRevisionsAddonPlugin (Dakar, $Rev: 9808$):
  • EditTablePlugin (any TWiki, 11646): Edit TWiki tables using edit fields, date pickers and drop down boxes
  • FilterPlugin (1.40, $Rev: 15932 (07 Dec 2007) $): Substitute and extract information from content by using regular expressions
  • FlexWebListPlugin (v1.21, $Rev: 16132 (03 Jan 2008) $): Flexible way to display hierarchical weblists
  • FootNotePlugin (2.006): Footnotes are notes placed at the end of a topic.
  • GluePlugin (2.00, $Rev: 15708 (23 Nov 2007) $): Enable markup to span multiple lines
  • IfDefinedPlugin (v1.01, $Rev: 15157 (05 Oct 2007) $): Render content conditionally
  • InterwikiPlugin (Dakar, $Rev: 11935$): Link ExternalSite:Page text to external sites based on aliases defined in a rules topic
  • JQueryPlugin (v0.4, $Rev: 15608 (15 Nov 2007) $): jQuery JavaScript library for TWiki
  • NatSkinPlugin (3.00-pre17, $Rev: 15581 (13 Nov 2007) $): Supplements the bare bones NatSkin theme for TWiki
  • PreferencesPlugin (Dakar, 9839): Allows editing of preferences using fields predefined in a form
  • RedDotPlugin (1.40, $Rev: 16137 (03 Jan 2008) $): Renders edit-links as little red dots
  • RenderListPlugin (any TWiki, 1.034): Render bullet lists in a variety of formats
  • SlideShowPlugin (Any TWiki, $Rev: 12847$): Create web based presentations based on topics with headings.
  • SmiliesPlugin (Dakar, 8154): Render smilies as icons, like smile for  :-) or eek! for = :eek:=
  • TablePlugin (1.020, 12339): Control attributes of tables and sorting of table columns
  • TreeBrowserPlugin (v1.8): Renders a list as a collapsable/expandable tree.
  • TreePlugin (1.7): Dynamic generation of TWiki topic trees
  • TwistyPlugin (1.2.0, $Rev: 12154$): Twisty section JavaScript library to open/close content dynamically
  • VotePlugin (1.33, $Rev: 14312 (01 Jul 2007) $): Simple way to count votes
  • WysiwygPlugin (Dakar, 12422): Translator framework for Wysiwyg editors
Changed:
<
<
>
>

%FAILEDPLUGINS%

PluginErrors
SpreadSheetPlugin none
ActionTrackerPlugin none
AttachmentListPlugin none
BreadCrumbsPlugin none
CalendarPlugin none
CommentPlugin none
CompareRevisionsAddonPlugin none
EditTablePlugin none
FilterPlugin none
FlexWebListPlugin none
FootNotePlugin none
GluePlugin none
IfDefinedPlugin none
InterwikiPlugin none
JQueryPlugin none
NatSkinPlugin none
PreferencesPlugin none
RedDotPlugin none
RenderListPlugin none
SlideShowPlugin none
SmiliesPlugin none
TablePlugin none
TreeBrowserPlugin none
TreePlugin none
TwistyPlugin none
VotePlugin none
WysiwygPlugin none
HandlerPlugins
afterEditHandlerActionTrackerPlugin
afterSaveHandlerTreePlugin
beforeCommonTagsHandlerPreferencesPlugin
TwistyPlugin
WysiwygPlugin
beforeEditHandlerActionTrackerPlugin
WysiwygPlugin
beforeSaveHandlerActionTrackerPlugin
CommentPlugin
WysiwygPlugin
commonTagsHandlerSpreadSheetPlugin
ActionTrackerPlugin
CalendarPlugin
CommentPlugin
CompareRevisionsAddonPlugin
EditTablePlugin
FilterPlugin
FootNotePlugin
GluePlugin
IfDefinedPlugin
JQueryPlugin
NatSkinPlugin
RedDotPlugin
SlideShowPlugin
SmiliesPlugin
initPluginSpreadSheetPlugin
ActionTrackerPlugin
AttachmentListPlugin
BreadCrumbsPlugin
CalendarPlugin
CommentPlugin
CompareRevisionsAddonPlugin
EditTablePlugin
FilterPlugin
FlexWebListPlugin
FootNotePlugin
GluePlugin
IfDefinedPlugin
InterwikiPlugin
JQueryPlugin
NatSkinPlugin
PreferencesPlugin
RedDotPlugin
RenderListPlugin
SlideShowPlugin
SmiliesPlugin
TablePlugin
TreeBrowserPlugin
TreePlugin
TwistyPlugin
VotePlugin
WysiwygPlugin
modifyHeaderHandlerWysiwygPlugin
postRenderingHandlerEditTablePlugin
FootNotePlugin
NatSkinPlugin
PreferencesPlugin
RedDotPlugin
TwistyPlugin
WysiwygPlugin
preRenderingHandlerInterwikiPlugin
SmiliesPlugin
TablePlugin
TreeBrowserPlugin
redirectCgiQueryHandlerRedDotPlugin
startRenderingHandlerRenderListPlugin
This handler is deprecated - please check for updated versions of the plugins that use it!
27 plugins
 

The TWiki Plugin API

Changed:
<
<
The Application Programming Interface (API) for TWikiPlugins provides the specifications for hooking into the core TWiki code from your external Perl Plugin module. The Plugin API is new to the Production version of TWiki with the 01-Sep-2001 release.
>
>
The Application Programming Interface (API) for TWiki Plugins provides the specifications for hooking into the core TWiki code from your external Perl Plugin module.
 

Available Core Functions

Changed:
<
<
The TWikiFuncModule? (lib/TWiki/Func.pm) implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.
>
>
The TWikiFuncDotPm module (lib/TWiki/Func.pm) describes all the interfaces available to Plugins. Plugins should only use the interfaces described in this module.
 
Changed:
<
<
ALERT! If you use functions not in Func.pm, you run the risk of creating security holes. Also, your Plugin will likely break and require updating when you upgrade to a new version of TWiki.
>
>
ALERT! Note: If you use other core functions not described in Func.pm, you run the risk of creating security holes. Also, your Plugin will likely break and require updating when you upgrade to a new version of TWiki.
 

Predefined Hooks

Changed:
<
<
In addition to TWiki core functions, Plugins can use predefined hooks, or call backs, listed in the lib/TWiki/Plugins/EmptyPlugin.pm module.
>
>
In addition to TWiki core functions, Plugins can use predefined hooks, or callbacks, as described in the lib/TWiki/Plugins/EmptyPlugin.pm module.
 
  • All but the initPlugin are disabled. To enable a call back, remove DISABLE_ from the function name.
Deleted:
<
<
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.

Most Plugins use either the commonTagsHandler or startRenderingHandler for rendering tasks:

  • commonTagsHandler: Use it to expand %XYZPLUGIN% and %XYZPLUGIN{...}% variables
  • startRenderingHandler: Use it for your own rendering rules or to overload TWiki's internal rendering like [[links]]
 TWiki:Codev/StepByStepRenderingOrder helps you decide which rendering handler to use.
Added:
>
>
 

Hints on Writing Fast Plugins

Changed:
<
<
  • Delay the Plugin initialization to the actual function which is handling the tag. This way all the expensive initialization is done only when needed.
  • For example, use an eval block like:
>
>
  • Delay initialization as late as possible. For example, if your Plugin is a simple syntax processor, you might delay loading extra Perl modules until you actually see the syntax in the text.
  • For example, use an eval block like this:
  eval { require IPC::Run }
return "<font color=\"red\">SamplePlugin: Can't load required modules ($@)</font>" if $@;
Deleted:
<
<
  • You could return errors as strings to show what happened
 
  • You can use a flag to avoid running the initialization twice
Added:
>
>
 

Plugin Version Detection

Line: 151 to 115
 
    • The Plugin initialization code does not register a Plugin that returns FALSE (or that has no initPlugin handler).

  • $TWiki::Plugins::VERSION in the TWiki::Plugins module contains the TWiki Plugin API version, currently 1.11.
Changed:
<
<
    • You can also use the %PLUGINVERSION{}% variable to query the Plugin API version or the version of installed Plugins.
>
>
    • You can also use the %PLUGINVERSION{}% variable to query the Plugin API version or the version of installed Plugins.

Security

  • Badly written Plugins can open huge security holes in TWiki. This is especially true if care isn't taken to prevent execution of arbitrary commands on the server.
  • Don't allow sensitive configuration data to be edited by users. it is better to add sensitive configuration options to the %TWiki::cfg hash than adding it as preferences in the Plugin topic
  • Always use the TWiki::Sandbox to execute commands.
  • Always audit the Plugins you install, and make sure you are happy with the level of security provided. While every effort is made to monitor Plugin authors activities, at the end of the day they are uncontrolled user contributions.
 

Creating Plugins

With a reasonable knowledge of the Perl scripting language, you can create new Plugins or modify and extend existing ones. Basic plug-in architecture uses an Application Programming Interface (API), a set of software instructions that allow external code to interact with the main program. The TWiki Plugin API Plugins by providing a programming interface for TWiki.

Deleted:
<
<

The DefaultPlugin Alternative

  • DefaultPlugin can handle some outdated TWiki variables, found, for example, in sites recently updated from an old version. Settings are in DefaultPlugin? topic. You can also add your own simple custom processing rules here, though in all but very simple cases, writing a new Plugin is preferable.
 

Anatomy of a Plugin

A basic TWiki Plugin consists of two elements:

Line: 185 to 153
  $var = MyFirstPlugin? ::Attrs->new();
Added:
>
>

Measuring and Improving the Plugin Performance

A high quality Plugin performs well. You can use the TWiki:Plugins.PluginBenchmarkAddOn to measure your TWiki:Plugins.PluginBenchmarks. The data is needed as part of the Documentation Topic.

See also Hints on Writing Fast Plugins.

 

Writing the Documentation Topic

Line: 198 to 173
 
    • go back to your site to the TWiki web
    • In the GoBox enter your Plugin name, for example MyFirstPlugin, press enter and create the new topic
    • paste & save new Plugin topic on your site
Changed:
<
<
  1. Customize your Plugin topic.
    • In case you plan to publish your Plugin at TWiki.org, use Interwiki names for author names, like TWiki:Main/TWikiGuest.
  2. Save your topic, for use in packaging and publishing your Plugin.
>
>
  1. Customize your Plugin topic.
    • Important: In case you plan to publish your Plugin on TWiki.org, use Interwiki names for author names and links to TWiki.org topics, such as TWiki:Main/TWikiGuest. This is important because links should work properly in a Plugin topic installed on any TWiki, not just on TWiki.org.
  2. Document the performance data you gathered while measuring the performance
  3. Save your topic, for use in packaging and publishing your Plugin.
 
OUTLINE: Doc Topic Contents
Line: 223 to 199
 

Packaging for Distribution

Changed:
<
<
A minimum Plugin release consists of a Perl module with a WikiName that ends in Plugin, ex: MyFirstPlugin.pm, and a documentation page with the same name(MyFirstPlugin.txt).
>
>
The TWiki:Plugins.BuildContrib is a powerful build environment that is used by the TWiki project to build TWiki itself, as well as many of the Plugins. You don't have to use it, but it is highly recommended!

If you don't want (or can't) use the BuildContrib, then a minimum Plugin release consists of a Perl module with a WikiName that ends in Plugin, ex: MyFirstPlugin.pm, and a documentation page with the same name(MyFirstPlugin.txt).

 
Changed:
<
<
  1. Distribute the Plugin files in a directory structure that mirrors TWiki. If your Plugin uses additional files, include them ALL:
>
>
  1. Distribute the Plugin files in a directory structure that mirrors TWiki. If your Plugin uses additional files, include them all:
 
    • lib/TWiki/Plugins/MyFirstPlugin.pm
    • data/TWiki/MyFirstPlugin.txt
    • pub/TWiki/MyFirstPlugin/uparrow.gif [a required graphic]
Line: 237 to 215
 

Publishing for Public Use

Changed:
<
<
You can release your tested, packaged Plugin to the TWiki community through the TWiki:Plugins web. All Plugins submitted to TWiki.org are available for download and further development in TWiki:Plugins/PluginPackage. Publish your Plugin in these steps:
>
>
You can release your tested, packaged Plugin to the TWiki community through the TWiki:Plugins web. All Plugins submitted to TWiki.org are available for download and further development in TWiki:Plugins/PluginPackage.
 
Added:
>
>
Publish your Plugin by following these steps:
 
  1. Post the Plugin documentation topic in the TWiki:Plugins/PluginPackage:
    • enter the Plugin name in the "How to Create a Plugin" section, for example MyFirstPlugin
Changed:
<
<
>
>
 
  1. Attach the distribution zip file to the topic, ex: MyFirstPlugin.zip
  2. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: MyFirstPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)
Changed:
<
<
  1. Put the Plugin into the CVS repository, see TWiki:Plugins/ReadmeFirst (optional)
>
>
  1. Put the Plugin into the SVN repository, see TWiki:Plugins/ReadmeFirst (optional)

NEW Once you have done the above steps once, you can use the BuildContrib to upload updates to your Plugin.

 Thank you very much for sharing your Plugin with the TWiki community smile

Changed:
<
<

Recommended Storage of Plugin Data

>
>

Recommended Storage of Plugin Specific Data

Plugins sometimes need to store data. This can be Plugin internal data such as cache data, or data generated for browser consumption such as images. Plugins should store data using TWikiFuncDotPm functions that support saving and loading of topics and attachments.

Plugin Internal Data

You can create a Plugin "work area" using the TWiki::Func::getWorkArea() function, which gives you a persistant directory where you can store data files. By default they will not be web accessible. The directory is guaranteed to exist, and to be writable by the webserver user. For convenience, TWiki::Func::storeFile() and TWiki::Func::readFile() are provided to persistently store and retrieve simple data in this area.

Web Accessible Data

Topic-specific data such as generated images can be stored in the topics attachment area, which is web accessible. Use the TWiki::Func::saveAttachment() function to store the data.

Recommendation for file name:

  • Prefix the filename with an underscore (the leading underscore avoids a nameclash with files attached to the same topic)
  • Identify where the attachment originated from, typically by including the Plugin name in the file name
  • Use only alphanumeric characters, underscores, dashes and periods to avoid platform dependency issues and URL issues
  • Example: _FooBarPlugin_img123.gif

Web specific data can be stored in the Plugin's attachment area, which is web accessible. Use the TWiki::Func::saveAttachment() function to store the data.

Recommendation for file names in Plugin attachment area:

  • Prefix the filename with an underscore
  • Include the name of the web in the filename
  • Use only alphanumeric characters, underscores, dashes and periods to avoid platform dependency issues and URL issues
  • Example: _Main_roundedge-ul.gif

Maintaining Plugins

Discussions and Feedback on Plugins

Each published Plugin has a Plugin development topic on TWiki.org. Plugin development topics are named after your Plugin and end in Dev, such as MyFirstPluginDev. The Plugin development topic is a great resource to discuss feature enhancements and to get feedback from the TWiki community.

Maintaining Compatibility with Earlier TWiki Versions

The Plugin interface (TWikiFuncDotPm functions and handlers) evolve over time. TWiki 4.0 introduced new API functions to address the needs of Plugin authors. It also deprecated some functions. Some Plugins written for earlier TWiki releases using unofficial TWiki internal functions no longer work on the TWiki 4.0 codebase. All this means that some Plugins need to be updated to work on the TWiki 4.0 codebase.

Organizations typically do not upgrade to the latest TWiki for many months. However, many administrators still would like to install the latest versions of a Plugin on their older TWiki installation. This need is fullfilled if Plugins are maintained in a compatible manner.

TIP Tip: Plugins can be written to be compatible with older and newer TWiki releases. This can be done also for Plugins using unofficial TWiki internal functions of an earlier release that no longer work on the latest TWiki codebase. TWiki:TWiki.TWikiPluginsSupplement#MaintainPlugins has more.

Handling deprecated functions

 
Changed:
<
<
Plugins sometimes need to store data. This can be Plugin internal data like cache data, or generated data for the browser like images. The following is a recommendation where to store the data.
>
>
From time-to-time, the TWiki developers will add new functions to the interface (either to TWikiFuncDotPm, or new handlers). Sometimes these improvements mean that old functions have to be deprecated to keep the code manageable. When this happens, the deprecated functions will be supported in the interface for at least one more TWiki release, and probably longer, though this cannot be guaranteed.
 
Changed:
<
<

Where to store Plugin Internal Data

>
>
When a plugin defines deprecated handlers, a warning will be shown in the list generated by %FAILEDPLUGINS%. Admins who see these warnings should check TWiki.org and if necessary, contact the plugin author, for an updated version of the plugin.
 
Changed:
<
<
In case the Plugin generates data just for internal use, or data which is not specific to a topic, store it in the Plugin's attachment directory.
>
>
Updated plugins may still need to define deprecated handlers for compatibility with old TWiki versions. In this case, the plugin package that defines old handlers can suppress the warnings in %FAILEDPLUGINS%.
 
Changed:
<
<
  • The Plugin's attachment directory is pubdir/Installweb/FooBarPlugin
    • Installweb refers to the name of the web where the Plugin is installed
  • The Plugin's attachment URL is %PUBURL%/Installweb/FooBarPlugin
  • The filename should start with an underscore, followed by an identifier, e.g. _any_name.ext
    • The leading underscore avoids a nameclash with files attached to the Plugin topic
    • Use only alphanumeric characters, underscores and periods to avoid platform dependency issues and URL issues
    • Do not use subdirectories (rename and delete would fail)
  • Use Plugin API functions documented in TWikiFuncModule? to ensure portability:
    • Use getPubDir() to get the attachment root directory
    • Use getUrlHost() and getPubUrlPath() to build the URL in case you create content for the browser
    • Use $installWeb to get the name of the web where the Plugin is installed
    • Create the web directory and topic attachment directory if needed
  • Hint: Package the Plugin at least with one file attachment. This ensures that the attachment directory already exists

Where to Store Data for Topics using the Plugin

In case the Plugin generates data which is specific to a topic, store it in the topic's attachment directory.

  • The topic's attachment directory is pubdir/Webname/TopicName
  • The topic's attachment URL is %PUBURL%/Webname/TopicName
  • The filename should start with an underscore, followed by the Plugin name, an underscore and an identifier, e.g. _FooBarPlugin_any_name.ext
    • The leading underscore avoids a nameclash with files attached to the same topic
    • Use only alphanumeric characters, underscores and periods to avoid platform dependency issues and URL issues
    • Do not use subdirectories (rename and delete would fail)
  • Use Plugin API functions documented in TWikiFuncModule? to ensure portability:
    • Use getPubDir() to get the attachment root directory
    • Use getUrlHost() and getPubUrlPath() to build the URL in case you create content for the browser
>
>
This is done by defining a map from the handler name to the TWiki::Plugins version in which the handler was first deprecated. For example, if we need to define the endRenderingHandler for compatibility with TWiki::Plugins versions before 1.1, we would add this to the plugin:
 
Deleted:
<
<
Example code to build the file name:
 
Changed:
<
<
sub _make_filename { my ( $web, $topic, $name ) = @_;

# Create web directory "pub/$web" if needed my $dir = TWiki::Func::getPubDir() . "/$web"; unless( -e "$dir" ) { umask( 002 ); mkdir( $dir, 0775 ); } # Create topic directory "pub/$web/$topic" if needed $dir .= "/$topic"; unless( -e "$dir" ) { umask( 002 ); mkdir( $dir, 0775 ); } return "$dir/_FooBarPlugin_$name"; }

>
>
package TWiki::Plugins::SinkPlugin; use vars qw( %TWikiCompatibility ); $TWikiCompatibility{endRenderingHandler} = 1.1;
 
Added:
>
>
If the currently-running TWiki version is 1.1 or later, then the handler will not be called and the warning will not be issued. TWiki with versions of TWiki::Plugins before 1.1 will still call the handler as required.
 
Changed:
<
<
-- TWiki:Main/PeterThoeny - 14 Aug 2004
-- TWiki:Main/AndreaSterbini - 29 May 2001
-- TWiki:Main/MikeMannix - 03 Dec 2001
>
>
Related Topics: DeveloperDocumentationCategory, AdminDocumentationCategory, TWiki:TWiki.TWikiPluginsSupplement
 
Added:
>
>
-- Contributors: TWiki:Main.PeterThoeny, TWiki:Main.AndreaSterbini, TWiki:MainMikeMannix, TWiki:CrawfordCurrie

TWikiPlugins 29 - 14 Aug 2004 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 143 to 143
 

Plugin Version Detection

Changed:
<
<
To eliminate the incompatibility problems bound to arise from active open Plugin development, a Plugin versioning system and an API GetVersion detection routine are provided for automatic compatibility checking.
>
>
To eliminate the incompatibility problems bound to arise from active open Plugin development, a Plugin versioning system is provided for automatic compatibility checking.
 
  • All modules require a $VERSION='0.000' variable, beginning at 1.000.

  • The initPlugin handler should check all dependencies and return TRUE if the initialization is OK or FALSE if something went wrong.
    • The Plugin initialization code does not register a Plugin that returns FALSE (or that has no initPlugin handler).
Changed:
<
<
  • $VERSION='1.000' is the current setting in TWiki::Plugins.pm and in the preinstalled system Plugins (DefaultPlugin? , EmptyPlugin, InterwikiPlugin).
>
>
  • $TWiki::Plugins::VERSION in the TWiki::Plugins module contains the TWiki Plugin API version, currently 1.11.
    • You can also use the %PLUGINVERSION{}% variable to query the Plugin API version or the version of installed Plugins.
 

Creating Plugins

Line: 306 to 307
 }
Changed:
<
<
-- TWiki:Main/PeterThoeny - 18 May 2004
>
>
-- TWiki:Main/PeterThoeny - 14 Aug 2004
 -- TWiki:Main/AndreaSterbini - 29 May 2001
-- TWiki:Main/MikeMannix - 03 Dec 2001

TWikiPlugins 28 - 08 Aug 2004 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 20 to 20
 TWiki comes with a set of Plugins as part of the standard installation.

  • DefaultPlugin? : Optionally handles some legacy variables from older versions of TWiki. You can control this option from TWikiPreferences. (Perl programmers can also add rules for simple custom processing.)
Changed:
<
<
  • EmptyPlugin: Is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development.
  • InterwikiPlugin: Use it for shorthand linking to remote sites, ex: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can edit the predefined set of of Wiki-related sites, and add your own.
>
>
  • EmptyPlugin: Is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development
  • CommentPlugin: Allows users to quickly post comments to a page without an edit/preview/save cycle.
  • InterwikiPlugin: Use it for shorthand linking to remote sites, ex: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can edit the predefined set of of Wiki-related sites, and add your own
 

TWikiPlugins 27 - 18 May 2004 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 59 to 59
 
  • Method 2: List the Plugin being tested in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Sandbox web and do the testing there.
Added:
>
>

Checking that Plugins are Working on a Live Server

InstalledPlugins shows which Plugins are: 1) installed, 2) loading properly and 3) what TWiki:Codev.PluginHandlers they invoke. Any failures are shown in the Errors section.

 

A Note on Plugin Performance

The performance of the system depends on the number of Plugins installed and on the Plugin implementation. Some Plugins impose no measurable performance decrease, some do. For example, outsidePREHandler is an expensive callback function, or a Plugin might use many Perl libraries that need to be initialized with each page view (unless you run mod_perl). It is recommended to measure the performance with and without a new Plugin. Example for Unix:
time wget -qO /dev/null http://moglen.law.columbia.edu/twiki/bin/view/TWiki/AbcPlugin

Line: 301 to 305
 }
Changed:
<
<
-- TWiki:Main/PeterThoeny - 11 Dec 2003
-- TWiki:Main/AndreaSterbini - 29 May 2001
>
>
-- TWiki:Main/PeterThoeny - 18 May 2004
-- TWiki:Main/AndreaSterbini - 29 May 2001
 -- TWiki:Main/MikeMannix - 03 Dec 2001
Added:
>
>

TWikiPlugins 26 - 15 Dec 2003 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 204 to 204
 Example: <Include an example of the Plugin in action. Possibly include a static HTML version of the example to compare if the installation was a success!>"
Changed:
<
<
Plugin Global Settings: <Description and settings for custom Plugin %VARIABLES%, and those required by TWiki.>"
>
>
Plugin Settings: <Description and settings for custom Plugin %VARIABLES%, and those required by TWiki.>"
 
  • Plugins Preferences <If user settings are needed, explain... Entering values works exactly like TWikiPreferences and WebPreferences: six (6) spaces and then:>"
    • Set <EXAMPLE = value added>
Line: 231 to 231
 

Publishing for Public Use

Changed:
<
<
You can release your tested, packaged Plugin to the TWiki community through the TWiki:Plugins web. All Plugins submitted to TWiki.org are available for download and further development in TWiki:Plugins. Publish your Plugin in three steps:
>
>
You can release your tested, packaged Plugin to the TWiki community through the TWiki:Plugins web. All Plugins submitted to TWiki.org are available for download and further development in TWiki:Plugins/PluginPackage. Publish your Plugin in these steps:
 
Changed:
<
<
  1. Post the Plugin documentation topic in the TWiki:Plugins web:
    • create a new topic using the Plugin name, ex: MyFirstPlugin.txt
>
>
  1. Post the Plugin documentation topic in the TWiki:Plugins/PluginPackage:
    • enter the Plugin name in the "How to Create a Plugin" section, for example MyFirstPlugin
 
  1. Attach the distribution zip file to the topic, ex: MyFirstPlugin.zip
  2. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: MyFirstPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)
Added:
>
>
  1. Put the Plugin into the CVS repository, see TWiki:Plugins/ReadmeFirst (optional)
 
Changed:
<
<
-- AndreaSterbini? - 29 May 2001
-- PeterThoeny - 11 Dec 2003
-- MikeMannix? - 03 Dec 2001
>
>
Thank you very much for sharing your Plugin with the TWiki community smile

Recommended Storage of Plugin Data

Plugins sometimes need to store data. This can be Plugin internal data like cache data, or generated data for the browser like images. The following is a recommendation where to store the data.

Where to store Plugin Internal Data

In case the Plugin generates data just for internal use, or data which is not specific to a topic, store it in the Plugin's attachment directory.

  • The Plugin's attachment directory is pubdir/Installweb/FooBarPlugin
    • Installweb refers to the name of the web where the Plugin is installed
  • The Plugin's attachment URL is %PUBURL%/Installweb/FooBarPlugin
  • The filename should start with an underscore, followed by an identifier, e.g. _any_name.ext
    • The leading underscore avoids a nameclash with files attached to the Plugin topic
    • Use only alphanumeric characters, underscores and periods to avoid platform dependency issues and URL issues
    • Do not use subdirectories (rename and delete would fail)
  • Use Plugin API functions documented in TWikiFuncModule? to ensure portability:
    • Use getPubDir() to get the attachment root directory
    • Use getUrlHost() and getPubUrlPath() to build the URL in case you create content for the browser
    • Use $installWeb to get the name of the web where the Plugin is installed
    • Create the web directory and topic attachment directory if needed
  • Hint: Package the Plugin at least with one file attachment. This ensures that the attachment directory already exists

Where to Store Data for Topics using the Plugin

In case the Plugin generates data which is specific to a topic, store it in the topic's attachment directory.

  • The topic's attachment directory is pubdir/Webname/TopicName
  • The topic's attachment URL is %PUBURL%/Webname/TopicName
  • The filename should start with an underscore, followed by the Plugin name, an underscore and an identifier, e.g. _FooBarPlugin_any_name.ext
    • The leading underscore avoids a nameclash with files attached to the same topic
    • Use only alphanumeric characters, underscores and periods to avoid platform dependency issues and URL issues
    • Do not use subdirectories (rename and delete would fail)
  • Use Plugin API functions documented in TWikiFuncModule? to ensure portability:
    • Use getPubDir() to get the attachment root directory
    • Use getUrlHost() and getPubUrlPath() to build the URL in case you create content for the browser

Example code to build the file name:

sub _make_filename
{
    my ( $web, $topic, $name ) = @_;

    # Create web directory "pub/$web" if needed
    my $dir = TWiki::Func::getPubDir() . "/$web";
    unless( -e "$dir" ) {
        umask( 002 );
        mkdir( $dir, 0775 );
    }
    # Create topic directory "pub/$web/$topic" if needed
    $dir .= "/$topic";
    unless( -e "$dir" ) {
        umask( 002 );
        mkdir( $dir, 0775 );
    }
    return "$dir/_FooBarPlugin_$name";
}

-- TWiki:Main/PeterThoeny - 11 Dec 2003
-- TWiki:Main/AndreaSterbini - 29 May 2001
-- TWiki:Main/MikeMannix - 03 Dec 2001


TWikiPlugins 25 - 12 Dec 2003 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 17 to 17
 

Preinstalled Plugins

Changed:
<
<
TWiki comes with three Plugins as part of the standard installation.
>
>
TWiki comes with a set of Plugins as part of the standard installation.
 
Changed:
<
<
  • DefaultPlugin? optionally handles some legacy variables from older versions of TWiki. You can control this option from TWikiPreferences. (Perl programmers can also add rules for simple custom processing.)

  • EmptyPlugin is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development.

  • InterwikiPlugin is preinstalled but can be disabled or removed. Use it for shorthand linking to remote sites, ex: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can edit the predefined set of of Wiki-related sites, and add your own.
>
>
  • DefaultPlugin? : Optionally handles some legacy variables from older versions of TWiki. You can control this option from TWikiPreferences. (Perl programmers can also add rules for simple custom processing.)
  • EmptyPlugin: Is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development.
  • InterwikiPlugin: Use it for shorthand linking to remote sites, ex: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can edit the predefined set of of Wiki-related sites, and add your own.
  • EditTablePlugin: Edit TWiki tables using edit fields, date pickers and drop down boxes
  • RenderListPlugin: Render bullet lists in a variety of formats
  • SlideShowPlugin: Create web based presentations based on topics with headings.
  • SmiliesPlugin: Render smilies as icons, like smile for  :-) or eek! for  :eek:
  • SpreadSheetPlugin: Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables and other topic text
  • TablePlugin: Control attributes of tables and sorting of table columns
 

Installing Plugins

Line: 55 to 59
 
  • Method 2: List the Plugin being tested in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Sandbox web and do the testing there.
Changed:
<
<

A Note on Performance

>
>

A Note on Plugin Performance

 
Changed:
<
<
The performance of the system depends on the number of Plugins installed and on the Plugin implementation. Some Plugins impose no measurable performance decrease, some do. For example, outsidePREHandler is an expensive callback function, or a Plugin might use many Perl libraries that needs to be initialized with each page view (unless you run mod_perl). It is recommended to measure the performance with and without a new Plugin. Example for Unix:
time wget -qO /dev/null http://moglen.law.columbia.edu/twiki/bin/view/TWiki/AbcPlugin
>
>
The performance of the system depends on the number of Plugins installed and on the Plugin implementation. Some Plugins impose no measurable performance decrease, some do. For example, outsidePREHandler is an expensive callback function, or a Plugin might use many Perl libraries that need to be initialized with each page view (unless you run mod_perl). It is recommended to measure the performance with and without a new Plugin. Example for Unix:
time wget -qO /dev/null http://moglen.law.columbia.edu/twiki/bin/view/TWiki/AbcPlugin
 In case you need to install an "expensive" Plugin and you need its functionality only in one web you can place the Plugin topic into that web. TWiki will initialize the Plugin only if the Plugin topic is found (which won't be the case for other webs.)
Line: 117 to 121
 
  • All but the initPlugin are disabled. To enable a call back, remove DISABLE_ from the function name.
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
Added:
>
>
Most Plugins use either the commonTagsHandler or startRenderingHandler for rendering tasks:
  • commonTagsHandler: Use it to expand %XYZPLUGIN% and %XYZPLUGIN{...}% variables
  • startRenderingHandler: Use it for your own rendering rules or to overload TWiki's internal rendering like [[links]]

TWiki:Codev/StepByStepRenderingOrder helps you decide which rendering handler to use.

Hints on Writing Fast Plugins

  • Delay the Plugin initialization to the actual function which is handling the tag. This way all the expensive initialization is done only when needed.
  • For example, use an eval block like:
    eval { require IPC::Run }
    return "<font color=\"red\">SamplePlugin: Can't load required modules ($@)</font>" if $@;
  • You could return errors as strings to show what happened
  • You can use a flag to avoid running the initialization twice
 

Plugin Version Detection

To eliminate the incompatibility problems bound to arise from active open Plugin development, a Plugin versioning system and an API GetVersion detection routine are provided for automatic compatibility checking.

Line: 221 to 240
 
  1. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: MyFirstPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)

-- AndreaSterbini? - 29 May 2001

Changed:
<
<
-- PeterThoeny - 29 Jan 2003
>
>
-- PeterThoeny - 11 Dec 2003
 -- MikeMannix? - 03 Dec 2001

TWikiPlugins 24 - 01 Aug 2003 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 57 to 57
 

A Note on Performance

Changed:
<
<
The performance of the system depends on the number of Plugins installed and on the Plugin implementation. Some Plugins impose no measurable performance decrease, some do. For example, outsidePREHandler is an expensive callback function, or a Plugin might use many Perl libraries that needs to be initialized with each page view (unless you run mod_perl). It is recommended to measure the performance with and without a new Plugin.
>
>
The performance of the system depends on the number of Plugins installed and on the Plugin implementation. Some Plugins impose no measurable performance decrease, some do. For example, outsidePREHandler is an expensive callback function, or a Plugin might use many Perl libraries that needs to be initialized with each page view (unless you run mod_perl). It is recommended to measure the performance with and without a new Plugin. Example for Unix:
time wget -qO /dev/null http://moglen.law.columbia.edu/twiki/bin/view/TWiki/AbcPlugin
 In case you need to install an "expensive" Plugin and you need its functionality only in one web you can place the Plugin topic into that web. TWiki will initialize the Plugin only if the Plugin topic is found (which won't be the case for other webs.)

TWikiPlugins 23 - 01 Aug 2003 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 55 to 55
 
  • Method 2: List the Plugin being tested in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Sandbox web and do the testing there.
Added:
>
>

A Note on Performance

The performance of the system depends on the number of Plugins installed and on the Plugin implementation. Some Plugins impose no measurable performance decrease, some do. For example, outsidePREHandler is an expensive callback function, or a Plugin might use many Perl libraries that needs to be initialized with each page view (unless you run mod_perl). It is recommended to measure the performance with and without a new Plugin.

In case you need to install an "expensive" Plugin and you need its functionality only in one web you can place the Plugin topic into that web. TWiki will initialize the Plugin only if the Plugin topic is found (which won't be the case for other webs.)

 

Managing Plugins

When you finish installing a Plugin, you should be able to read the user instructions and go. In fact, some Plugins require additional settings or offer extra options that you have to select. Also, you may want to make a Plugin available only in certain webs, or temporarily disable it. And may want to list all available Plugins in certain topics. You can handle all of these management tasks with simple procedures.


TWikiPlugins 22 - 28 Feb 2003 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 48 to 48
 To test new Plugins on your installation before making them public, you may want to use one of these two approaches:

  • Method 1: Safely test on-the-fly by creating separate Production and Test branches in your live TWiki installation.
Changed:
<
<
    • Duplicate the twiki/bin and twiki/lib directories for the Test version, adjusting the paths in the new lib/TWiki.cfg, the twiki/data; the twiki/templates and twiki/pub directories are shared.
>
>
    • Duplicate the twiki/bin and twiki/lib directories for the Test version, and adjust the paths in the new lib/TWiki.cfg. The following directories are shared: twiki/data, twiki/templates and twiki/pub.
 
    • Test Plugins and other new features in the Test installation until you're satisfied.
      • ALERT! If you modify topics using the new features, live users will likely see unfamiliar new META tags showing up on their pages - to avoid this, create and edit test-only topics to try out new features.
    • Copy the modified files to the Production installation. You can update a TWiki installation live and users won't even notice.

TWikiPlugins 21 - 29 Jan 2003 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 108 to 108
 In addition to TWiki core functions, Plugins can use predefined hooks, or call backs, listed in the lib/TWiki/Plugins/EmptyPlugin.pm module.
Deleted:
<
<
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
 
  • All but the initPlugin are disabled. To enable a call back, remove DISABLE_ from the function name.
Added:
>
>
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
 

Plugin Version Detection

Line: 146 to 146
 

Creating the Perl Module

Changed:
<
<
Copy file lib/TWiki/Plugins/EmptyPlugin.pm to <name>Plugin.pm. EmptyPlugin.pm contains no executable code, so it does nothing, but it's ready to be used. Customize it. Refer to the Plugin API specs for more information.
>
>
Copy file lib/TWiki/Plugins/EmptyPlugin.pm to <name>Plugin.pm. The EmptyPlugin.pm module contains mostly empty functions, so it does nothing, but it's ready to be used. Customize it. Refer to the Plugin API specs for more information.

If your Plugin uses its own modules and objects, you must include the name of the Plugin in the package name. For example, write Package MyFirstPlugin::Attrs; instead of just Package Attrs;. Then call it using:

  use TWiki::Plugins::MyFirstPlugin::Attrs;
  $var = MyFirstPlugin::Attrs->new();
 

Writing the Documentation Topic

The Plugin documentation topic contains usage instructions and version details. It serves the Plugin files as FileAttachments for downloading. (The doc topic is also included in the distribution package.) To create a documentation topic:

Changed:
<
<
  1. Copy the Plugin topic template from EmptyPlugin. To copy the text, go to the page and:
    • click Edit
    • select all in the Edit box & copy
>
>
  1. Copy the Plugin topic template from TWiki.org. To copy the text, go to TWiki:Plugins/PluginPackage and:
    • enter the Plugin name in the "How to Create a Plugin" section
    • click Create
    • select all in the Edit box & copy
 
    • Cancel the edit
Changed:
<
<
    • paste & save as a text file or new topic on your site
  1. Customize the template for your Plugin; you'll probably want to post a working version on your local TWiki site.
  2. Save your topic as a text file, for use in packaging and publishing your Plugin.
>
>
    • go back to your site to the TWiki web
    • In the GoBox enter your Plugin name, for example MyFirstPlugin, press enter and create the new topic
    • paste & save new Plugin topic on your site
  1. Customize your Plugin topic.
    • In case you plan to publish your Plugin at TWiki.org, use Interwiki names for author names, like TWiki:Main/TWikiGuest.
  2. Save your topic, for use in packaging and publishing your Plugin.
 
OUTLINE: Doc Topic Contents
Changed:
<
<
Check EmptyPlugin on TWiki.org for the latest Plugin doc topic template. Here's a quick overview of what's covered:
>
>
Check the Plugins web on TWiki.org for the latest Plugin doc topic template. Here's a quick overview of what's covered:
 Syntax Rules: <Describe any special text formatting that will be rendered.>"
Changed:
<
<
MyFirstPlugin Settings: <Description and settings for custom Plugin %VARIABLES%, and those required by TWiki.>"
>
>
Example: <Include an example of the Plugin in action. Possibly include a static HTML version of the example to compare if the installation was a success!>"
 
Changed:
<
<
  • Plugins Preferences <If user settings are needed, explain... Entering valuse works exactly like TWikiPreferences and WebPreferences: six (6) spaces and then:>"
    • Set <EXAMPLE = value added>
>
>
Plugin Global Settings: <Description and settings for custom Plugin %VARIABLES%, and those required by TWiki.>"
 
Changed:
<
<
How-to Instructions: <Step-by-step set-up guide, user help, whatever it takes to install and run, goes here.>"
>
>
  • Plugins Preferences <If user settings are needed, explain... Entering values works exactly like TWikiPreferences and WebPreferences: six (6) spaces and then:>"
    • Set <EXAMPLE = value added>
 
Changed:
<
<
Test Example: <Include an example of the Plugin in action: if it works, the installation was a success!>"
>
>
Plugin Installation Instructions: <Step-by-step set-up guide, user help, whatever it takes to install and run, goes here.>"
 Plugin Info: <Version, credits, history, requirements - entered in a form, displayed as a table. Both are automatically generated when you create or edit a page in the TWiki:Plugins web.>"
Line: 205 to 215
 
  1. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: MyFirstPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)

-- AndreaSterbini? - 29 May 2001

Changed:
<
<
-- PeterThoeny - 14 Sep 2001
>
>
-- PeterThoeny - 29 Jan 2003
 -- MikeMannix? - 03 Dec 2001

TWikiPlugins 20 - 08 Dec 2002 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 100 to 100
 

Available Core Functions

Changed:
<
<
The lib/TWiki/Func.pm implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.
>
>
The TWikiFuncModule? (lib/TWiki/Func.pm) implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.
 ALERT! If you use functions not in Func.pm, you run the risk of creating security holes. Also, your Plugin will likely break and require updating when you upgrade to a new version of TWiki.
Deleted:
<
<
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
 

Predefined Hooks

In addition to TWiki core functions, Plugins can use predefined hooks, or call backs, listed in the lib/TWiki/Plugins/EmptyPlugin.pm module.

Added:
>
>
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
 
  • All but the initPlugin are disabled. To enable a call back, remove DISABLE_ from the function name.

Plugin Version Detection


TWikiPlugins 19 - 18 Jul 2002 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 53 to 53
 
      • ALERT! If you modify topics using the new features, live users will likely see unfamiliar new META tags showing up on their pages - to avoid this, create and edit test-only topics to try out new features.
    • Copy the modified files to the Production installation. You can update a TWiki installation live and users won't even notice.
Changed:
<
<
  • Method 2: List the Plugin under Test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Test web and do the testing there.
>
>
  • Method 2: List the Plugin being tested in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Sandbox web and do the testing there.
 

Managing Plugins


TWikiPlugins 18 - 03 Dec 2001 - Main.MikeMannix
Line: 1 to 1
 

TWiki Plugins

Line: 170 to 170
 MyFirstPlugin Settings: <Description and settings for custom Plugin %VARIABLES%, and those required by TWiki.>"
Changed:
<
<
Plugins Preferences <If user settings are needed, explain... Entering valuse works exactly like TWikiPreferences and WebPreferences: six (6) spaces and then:>"
>
>
  • Plugins Preferences <If user settings are needed, explain... Entering valuse works exactly like TWikiPreferences and WebPreferences: six (6) spaces and then:>"
 
    • Set <EXAMPLE = value added>

How-to Instructions: <Step-by-step set-up guide, user help, whatever it takes to install and run, goes here.>"

Line: 206 to 206
 
  1. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: MyFirstPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)

-- AndreaSterbini? - 29 May 2001

Deleted:
<
<
-- MikeMannix? - 01 Sep 2001
 -- PeterThoeny - 14 Sep 2001
Added:
>
>
-- MikeMannix? - 03 Dec 2001

TWikiPlugins 17 - 28 Sep 2001 - Main.MikeMannix
Line: 1 to 1
 

TWiki Plugins

Line: 42 to 42
 
  • Dev page: Post feature requests, bug reports and general dev comments; topic title ends in Dev (SomePluginDev).
  • User support: Post installation, how to use type questions (and answers, if you have them) in the TWiki:Support web.
Added:
>
>
 

On-Site Pretesting

To test new Plugins on your installation before making them public, you may want to use one of these two approaches:

Changed:
<
<
  • Method 1: Create Production and a Test installation of TWiki.
    • Duplicate the twiki/bin and twiki/lib directories for the Test version, adjusting the paths in the new lib/TWiki.cfg, the twiki/data; the twiki/templates and twiki/pub directories are shared.
    • Test Plugins and other new features in the Test installation until you're satisfied.
    • Copy the modified files to the Production installation. You can update a live TWiki installation and users won't even notice.
>
>
  • Method 1: Safely test on-the-fly by creating separate Production and Test branches in your live TWiki installation.
    • Duplicate the twiki/bin and twiki/lib directories for the Test version, adjusting the paths in the new lib/TWiki.cfg, the twiki/data; the twiki/templates and twiki/pub directories are shared.
    • Test Plugins and other new features in the Test installation until you're satisfied.
      • ALERT! If you modify topics using the new features, live users will likely see unfamiliar new META tags showing up on their pages - to avoid this, create and edit test-only topics to try out new features.
    • Copy the modified files to the Production installation. You can update a TWiki installation live and users won't even notice.
 
  • Method 2: List the Plugin under Test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Test web and do the testing there.
Line: 100 to 102
 The lib/TWiki/Func.pm implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.
Changed:
<
<
DevALERT: If you use functions not in Func.pm, you run the risk of creating security holes. Also, your Plugin will likely break and require updating when you upgrade to a new version of TWiki.
>
>
ALERT! If you use functions not in Func.pm, you run the risk of creating security holes. Also, your Plugin will likely break and require updating when you upgrade to a new version of TWiki.
 
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.

TWikiPlugins 16 - 18 Sep 2001 - Main.MikeMannix
Line: 1 to 1
 

TWiki Plugins

Line: 7 to 7
 

Overview

Changed:
<
<
You can add Plugins to extend TWiki's functionality, without altering the core program code. With a plug-in approach, you can:
>
>
You can add Plugins to extend TWiki's functionality, without altering the core program code. A plug-in approach lets you:
 
  • add virtually unlimited features while keeping the main TWiki code compact and efficient;
  • heavily customize an installation and still do clean updates to new versions of TWiki;
  • rapidly develop new TWiki functions in Perl using the Plugin API.
Changed:
<
<
Everything to do with TWiki Plugins - demos, new releases, downloads, development, general discussion - is available at TWiki.org, in the TWiki:Plugins web.
>
>
Everything to do with TWiki Plugins - demos, new releases, downloads, development, general discussion - is available at TWiki.org, in the TWiki:Plugins web.
 

Preinstalled Plugins

TWiki comes with three Plugins as part of the standard installation.

Changed:
<
<
  • DefaultPlugin handles some legacy TWiki variables that may be present in long-established sites. This option can be controlled from TWikiPreferences. (Perl programmers can also add rules for simple custom processing.)
>
>
  • DefaultPlugin? optionally handles some legacy variables from older versions of TWiki. You can control this option from TWikiPreferences. (Perl programmers can also add rules for simple custom processing.)
 
Changed:
<
<
  • EmptyPlugin is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development.
>
>
  • EmptyPlugin is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development.
 
Changed:
<
<
  • InterwikiPlugin is preinstalled but can be disabled or removed. Use it for quick linking to to remote sites: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can add your own shortcuts and URLs to the existing directory of Wiki-related and other probably useful sites.
>
>
  • InterwikiPlugin is preinstalled but can be disabled or removed. Use it for shorthand linking to remote sites, ex: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can edit the predefined set of of Wiki-related sites, and add your own.
 

Installing Plugins

Line: 51 to 51
 
    • Test Plugins and other new features in the Test installation until you're satisfied.
    • Copy the modified files to the Production installation. You can update a live TWiki installation and users won't even notice.
Changed:
<
<
  • Method 2: List the Plugin under Test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Test web and do the testing there.
>
>
  • Method 2: List the Plugin under Test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Test web and do the testing there.
 

Managing Plugins

Changed:
<
<
Ideally, after you've installed a Plugin, just read the instructions and you're set. In fact, some Plugins require additional settings or offer extra options that you can modify on Preferences pages. You may want to make a Plugin available only in certain webs, or temporarily disable it. And having to list all available Plugins will probably come up. You can handle all of these with simple procedures.
>
>
When you finish installing a Plugin, you should be able to read the user instructions and go. In fact, some Plugins require additional settings or offer extra options that you have to select. Also, you may want to make a Plugin available only in certain webs, or temporarily disable it. And may want to list all available Plugins in certain topics. You can handle all of these management tasks with simple procedures.
 

Setting Preferences

Line: 81 to 81
 
  • The %PLUGINDESCRIPTIONS% variable displays a bullet list with a one-line description of each active Plugins. This variable is based on the %<plugin>_SHORTDESCRIPTION% Preferences variables of individual topics and is shown in TextFormattingRules.

Changed:
<
<
DEMO: Active Plugin Variables
>
>
DEMO: Automatically List Active Plugins Using Variables
 
Changed:
<
<
%ACTIVATEDPLUGINS%
>
>
Using %ACTIVATEDPLUGINS%:
 On this TWiki site, the active Plugins are: SpreadSheetPlugin, ActionTrackerPlugin, AttachmentListPlugin, BreadCrumbsPlugin, CalendarPlugin, CommentPlugin, CompareRevisionsAddonPlugin, EditTablePlugin, FilterPlugin, FlexWebListPlugin, FootNotePlugin, GluePlugin, IfDefinedPlugin, InterwikiPlugin, JQueryPlugin, NatSkinPlugin, PreferencesPlugin, RedDotPlugin, RenderListPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TreeBrowserPlugin, TreePlugin, TwistyPlugin, VotePlugin, WysiwygPlugin.
Changed:
<
<
%PLUGINDESCRIPTIONS%
>
>
Using %PLUGINDESCRIPTIONS%:
 You can use any of these active TWiki Plugins:
  • SpreadSheetPlugin (any TWiki, 10197): Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables and other topic text
  • ActionTrackerPlugin (21 May 2007, $Rev: 14969 (20 Sep 2007) $): Adds support for action tags in topics, and automatic notification of action statuses
  • AttachmentListPlugin (1.0.1, $Rev: 15921 (07 Dec 2007) $): Displays a formattable list of topic attachments, anywhere in a topic.
  • BreadCrumbsPlugin (v1.00, $Rev: 13657 (08 May 2007) $): A flexible way to display breadcrumbs navigation
  • CalendarPlugin (Dakar, 9113): Show a monthly calendar with highlighted events
  • CommentPlugin (Dakar, 11359): Allows users to quickly post comments to a page without an edit/preview/save cycle
  • CompareRevisionsAddonPlugin (Dakar, $Rev: 9808$):
  • EditTablePlugin (any TWiki, 11646): Edit TWiki tables using edit fields, date pickers and drop down boxes
  • FilterPlugin (1.40, $Rev: 15932 (07 Dec 2007) $): Substitute and extract information from content by using regular expressions
  • FlexWebListPlugin (v1.21, $Rev: 16132 (03 Jan 2008) $): Flexible way to display hierarchical weblists
  • FootNotePlugin (2.006): Footnotes are notes placed at the end of a topic.
  • GluePlugin (2.00, $Rev: 15708 (23 Nov 2007) $): Enable markup to span multiple lines
  • IfDefinedPlugin (v1.01, $Rev: 15157 (05 Oct 2007) $): Render content conditionally
  • InterwikiPlugin (Dakar, $Rev: 11935$): Link ExternalSite:Page text to external sites based on aliases defined in a rules topic
  • JQueryPlugin (v0.4, $Rev: 15608 (15 Nov 2007) $): jQuery JavaScript library for TWiki
  • NatSkinPlugin (3.00-pre17, $Rev: 15581 (13 Nov 2007) $): Supplements the bare bones NatSkin theme for TWiki
  • PreferencesPlugin (Dakar, 9839): Allows editing of preferences using fields predefined in a form
  • RedDotPlugin (1.40, $Rev: 16137 (03 Jan 2008) $): Renders edit-links as little red dots
  • RenderListPlugin (any TWiki, 1.034): Render bullet lists in a variety of formats
  • SlideShowPlugin (Any TWiki, $Rev: 12847$): Create web based presentations based on topics with headings.
  • SmiliesPlugin (Dakar, 8154): Render smilies as icons, like smile for  :-) or eek! for = :eek:=
  • TablePlugin (1.020, 12339): Control attributes of tables and sorting of table columns
  • TreeBrowserPlugin (v1.8): Renders a list as a collapsable/expandable tree.
  • TreePlugin (1.7): Dynamic generation of TWiki topic trees
  • TwistyPlugin (1.2.0, $Rev: 12154$): Twisty section JavaScript library to open/close content dynamically
  • VotePlugin (1.33, $Rev: 14312 (01 Jul 2007) $): Simple way to count votes
  • WysiwygPlugin (Dakar, 12422): Translator framework for Wysiwyg editors
Line: 126 to 126
 With a reasonable knowledge of the Perl scripting language, you can create new Plugins or modify and extend existing ones. Basic plug-in architecture uses an Application Programming Interface (API), a set of software instructions that allow external code to interact with the main program. The TWiki Plugin API Plugins by providing a programming interface for TWiki.
Added:
>
>
 

The DefaultPlugin Alternative

  • DefaultPlugin can handle some outdated TWiki variables, found, for example, in sites recently updated from an old version. Settings are in DefaultPlugin? topic. You can also add your own simple custom processing rules here, though in all but very simple cases, writing a new Plugin is preferable.
Line: 163 to 164
 OUTLINE: Doc Topic Contents
Check EmptyPlugin on TWiki.org for the latest Plugin doc topic template. Here's a quick overview of what's covered:
Changed:
<
<
Syntax Rules: Describe any special text formatting that will be rendered.
>
>
Syntax Rules: <Describe any special text formatting that will be rendered.>"
 
Changed:
<
<
MyFirstPlugin Settings: Description and settings for custom Plugin %VARIABLES%, and those required by TWiki.
>
>
MyFirstPlugin Settings: <Description and settings for custom Plugin %VARIABLES%, and those required by TWiki.>"
 
Changed:
<
<
Plugins Preferences work exactly like TWikiPreferences and WebPreferences: six (6) spaces and then:
    • Set EXAMPLE = got it!
>
>
Plugins Preferences <If user settings are needed, explain... Entering valuse works exactly like TWikiPreferences and WebPreferences: six (6) spaces and then:>"
    • Set <EXAMPLE = value added>
 
Changed:
<
<
How-to Instructions: Step-by-step set-up guide, user help, whatever it takes to install and run, goes here.
>
>
How-to Instructions: <Step-by-step set-up guide, user help, whatever it takes to install and run, goes here.>"
 
Changed:
<
<
Test Example: Include an example of the Plugin in action: if it works, the installation was a success!
>
>
Test Example: <Include an example of the Plugin in action: if it works, the installation was a success!>"
 
Changed:
<
<
Plugin Info: Version, credits, history, requirements - entered in a form, displayed as a table. Both are automatically generated when you create or edit a page in the TWiki:Plugins web.
>
>
Plugin Info: <Version, credits, history, requirements - entered in a form, displayed as a table. Both are automatically generated when you create or edit a page in the TWiki:Plugins web.>"
 


TWikiPlugins 15 - 16 Sep 2001 - Main.MikeMannix
Line: 1 to 1
 

TWiki Plugins

Line: 80 to 80
 
  • The %ACTIVATEDPLUGINS% variable lists activated Plugins by name. (This variable is displayed in TWikiPreferences for debugging use.)
  • The %PLUGINDESCRIPTIONS% variable displays a bullet list with a one-line description of each active Plugins. This variable is based on the %<plugin>_SHORTDESCRIPTION% Preferences variables of individual topics and is shown in TextFormattingRules.
Changed:
<
<
>
>
  DEMO: Active Plugin Variables

%ACTIVATEDPLUGINS%

Line: 159 to 159
 
  1. Customize the template for your Plugin; you'll probably want to post a working version on your local TWiki site.
  2. Save your topic as a text file, for use in packaging and publishing your Plugin.
Changed:
<
<
OUTLINE: Doc Topic Contents
>
>
OUTLINE: Doc Topic Contents
 Check EmptyPlugin on TWiki.org for the latest Plugin doc topic template. Here's a quick overview of what's covered:

Syntax Rules: Describe any special text formatting that will be rendered.

Line: 204 to 204
 -- AndreaSterbini? - 29 May 2001
-- MikeMannix? - 01 Sep 2001
Changed:
<
<
-- PeterThoeny? - 14 Sep 2001
>
>
-- PeterThoeny - 14 Sep 2001

TWikiPlugins 14 - 15 Sep 2001 - Main.MikeMannix
Line: 1 to 1
 

TWiki Plugins

Changed:
<
<
Plugin use and development; about the Plugin API.
>
>
Plug-in enhanced feature add-ons, with a Plugin API for developers
 

Overview

Changed:
<
<
You can add Plugins to greatly extend TWiki's functionality, without alering the program core. With a plug-in approach, you can:
>
>
You can add Plugins to extend TWiki's functionality, without altering the core program code. With a plug-in approach, you can:
 
  • add virtually unlimited features while keeping the main TWiki code compact and efficient;
  • heavily customize an installation and still do clean updates to new versions of TWiki;
Line: 23 to 23
 
  • EmptyPlugin is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development.
Changed:
<
<
  • InterwikiPlugin is preinstalled but can be disabled or removed. Use it for quick linking to to remote sites: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can add your own shortcuts and URLs to the existing directory of Wiki-related and other probably useful sites.
>
>
  • InterwikiPlugin is preinstalled but can be disabled or removed. Use it for quick linking to to remote sites: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can add your own shortcuts and URLs to the existing directory of Wiki-related and other probably useful sites.
 

Installing Plugins

Line: 37 to 37
 Special Requests: Some Plugins need certain Perl modules to be preinstalled on the host system. Plugins may also use other resources, like graphics, other modules, applications, templates. In these cases, detailed instructions are in the Plugin documentation.
Changed:
<
<
Each Plugin has a standard release page, located in the TWiki:Plugins web at TWiki.org. In addition to the documentation topic (SomePlugin), there's a separate development page.
>
>
Each Plugin has a standard release page, located in the TWiki:Plugins web at TWiki.org. In addition to the documentation topic (SomePlugin), there's a separate development page.
 
  • Doc page: Read all available info about the Plugin; download the attached distribution files.
Changed:
<
<
  • Dev page: Post feature requests, bug reports and general dev comments; topic title ends in Dev (SomePluginDev).
>
>
  • Dev page: Post feature requests, bug reports and general dev comments; topic title ends in Dev (SomePluginDev).
 
  • User support: Post installation, how to use type questions (and answers, if you have them) in the TWiki:Support web.

On-Site Pretesting

Line: 47 to 47
 To test new Plugins on your installation before making them public, you may want to use one of these two approaches:

  • Method 1: Create Production and a Test installation of TWiki.
Changed:
<
<
    • Duplicate the twiki/bin and twiki/lib directories for the Test version, adjusting the paths in the new lib/TWiki.cfg, the twiki/data; the twiki/templates and twiki/pub directories are shared.
>
>
    • Duplicate the twiki/bin and twiki/lib directories for the Test version, adjusting the paths in the new lib/TWiki.cfg, the twiki/data; the twiki/templates and twiki/pub directories are shared.
 
    • Test Plugins and other new features in the Test installation until you're satisfied.
    • Copy the modified files to the Production installation. You can update a live TWiki installation and users won't even notice.
Changed:
<
<
  • Method 2: List the Plugin under Test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Test web and do the testing there.
>
>
  • Method 2: List the Plugin under Test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Test web and do the testing there.
 

Managing Plugins

Line: 61 to 61
 Installed Plugins can be toggled on or off, site-wide or by web, through TWikiPreferences and individual WebPreferences:
Changed:
<
<
  • All Plugin modules present in the lib/TWiki/Plugins directory are activated automatically unless disabled by the DISABLEDPLUGINS Preferences variable in TWikiPreferences. You can optionally list the installed Plugins in the INSTALLEDPLUGINS Preferences variable. This is useful to define the sequence of Plugin execution, or to specify other webs than the TWiki web for the Plugin topics. Settings in TWikiPreferences are:
    • Set INSTALLEDPLUGINS = DefaultPlugin, ...
    • Set DISABLEDPLUGINS = EmptyPlugin, ...
>
>
  • All Plugin modules present in the lib/TWiki/Plugins directory are activated automatically unless disabled by the DISABLEDPLUGINS Preferences variable in TWikiPreferences. You can optionally list the installed Plugins in the INSTALLEDPLUGINS Preferences variable. This is useful to define the sequence of Plugin execution, or to specify other webs than the TWiki web for the Plugin topics. Settings in TWikiPreferences are:
    • Set INSTALLEDPLUGINS = DefaultPlugin, ...
    • Set DISABLEDPLUGINS = EmptyPlugin, ...
 
Changed:
<
<
Plugin execution order in TWiki is determined by searching Plugin topics in a specific sequence: First, full web.topicname name, if specified in INSTALLEDPLUGINS; next, the TWiki web is searched; and finally, the current web.
>
>
Plugin execution order in TWiki is determined by searching Plugin topics in a specific sequence: First, full web.topicname name, if specified in INSTALLEDPLUGINS; next, the TWiki web is searched; and finally, the current web.
 Plugin-specific settings are done in individual Plugin topics. Two settings are standard for each Plugin:
  1. One line description, used to form the bullets describing the Plugins in the TextFormattingRules topic:
Changed:
<
<
    • Set SHORTDESCRIPTION = Blah blah woof woof.
  1. Debug Plugin, output can be seen in data/debug.txt. Set to 0=off or 1=on:
    • Set DEBUG = 0
  • The settings can be retrieved as Preferences variables like %<pluginname>_<var>%, ex: %DEFAULTPLUGIN_SHORTDESCRIPTION% shows the description of the DefaultPlugin.
>
>
    • Set SHORTDESCRIPTION = Blah blah woof woof.
  1. Debug Plugin, output can be seen in data/debug.txt. Set to 0=off or 1=on:
    • Set DEBUG = 0
  • The settings can be retrieved as Preferences variables like %<pluginname>_<var>%, ex: %DEFAULTPLUGIN_SHORTDESCRIPTION% shows the description of the DefaultPlugin.
 

Listing Active Plugins

Plugin status variables let you list all active Plugins wherever needed. There are two list formats:

Changed:
<
<
  • The %ACTIVATEDPLUGINS% variable lists activated Plugins by name. (This variable is displayed in TWikiPreferences for debugging use.)
  • The %PLUGINDESCRIPTIONS% variable displays a bullet list with a one-line description of each active Plugins. This variable is based on the %<plugin>_SHORTDESCRIPTION% Preferences variables of individual topics and is shown in TextFormattingRules.
>
>
  • The %ACTIVATEDPLUGINS% variable lists activated Plugins by name. (This variable is displayed in TWikiPreferences for debugging use.)
  • The %PLUGINDESCRIPTIONS% variable displays a bullet list with a one-line description of each active Plugins. This variable is based on the %<plugin>_SHORTDESCRIPTION% Preferences variables of individual topics and is shown in TextFormattingRules.
 
DEMO: Active Plugin Variables
Changed:
<
<
%ACTIVATEDPLUGINS%
>
>
%ACTIVATEDPLUGINS%
 On this TWiki site, the active Plugins are: SpreadSheetPlugin, ActionTrackerPlugin, AttachmentListPlugin, BreadCrumbsPlugin, CalendarPlugin, CommentPlugin, CompareRevisionsAddonPlugin, EditTablePlugin, FilterPlugin, FlexWebListPlugin, FootNotePlugin, GluePlugin, IfDefinedPlugin, InterwikiPlugin, JQueryPlugin, NatSkinPlugin, PreferencesPlugin, RedDotPlugin, RenderListPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TreeBrowserPlugin, TreePlugin, TwistyPlugin, VotePlugin, WysiwygPlugin.
Changed:
<
<
%PLUGINDESCRIPTIONS%
>
>
%PLUGINDESCRIPTIONS%
 You can use any of these active TWiki Plugins:
  • SpreadSheetPlugin (any TWiki, 10197): Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables and other topic text
  • ActionTrackerPlugin (21 May 2007, $Rev: 14969 (20 Sep 2007) $): Adds support for action tags in topics, and automatic notification of action statuses
  • AttachmentListPlugin (1.0.1, $Rev: 15921 (07 Dec 2007) $): Displays a formattable list of topic attachments, anywhere in a topic.
  • BreadCrumbsPlugin (v1.00, $Rev: 13657 (08 May 2007) $): A flexible way to display breadcrumbs navigation
  • CalendarPlugin (Dakar, 9113): Show a monthly calendar with highlighted events
  • CommentPlugin (Dakar, 11359): Allows users to quickly post comments to a page without an edit/preview/save cycle
  • CompareRevisionsAddonPlugin (Dakar, $Rev: 9808$):
  • EditTablePlugin (any TWiki, 11646): Edit TWiki tables using edit fields, date pickers and drop down boxes
  • FilterPlugin (1.40, $Rev: 15932 (07 Dec 2007) $): Substitute and extract information from content by using regular expressions
  • FlexWebListPlugin (v1.21, $Rev: 16132 (03 Jan 2008) $): Flexible way to display hierarchical weblists
  • FootNotePlugin (2.006): Footnotes are notes placed at the end of a topic.
  • GluePlugin (2.00, $Rev: 15708 (23 Nov 2007) $): Enable markup to span multiple lines
  • IfDefinedPlugin (v1.01, $Rev: 15157 (05 Oct 2007) $): Render content conditionally
  • InterwikiPlugin (Dakar, $Rev: 11935$): Link ExternalSite:Page text to external sites based on aliases defined in a rules topic
  • JQueryPlugin (v0.4, $Rev: 15608 (15 Nov 2007) $): jQuery JavaScript library for TWiki
  • NatSkinPlugin (3.00-pre17, $Rev: 15581 (13 Nov 2007) $): Supplements the bare bones NatSkin theme for TWiki
  • PreferencesPlugin (Dakar, 9839): Allows editing of preferences using fields predefined in a form
  • RedDotPlugin (1.40, $Rev: 16137 (03 Jan 2008) $): Renders edit-links as little red dots
  • RenderListPlugin (any TWiki, 1.034): Render bullet lists in a variety of formats
  • SlideShowPlugin (Any TWiki, $Rev: 12847$): Create web based presentations based on topics with headings.
  • SmiliesPlugin (Dakar, 8154): Render smilies as icons, like smile for  :-) or eek! for = :eek:=
  • TablePlugin (1.020, 12339): Control attributes of tables and sorting of table columns
  • TreeBrowserPlugin (v1.8): Renders a list as a collapsable/expandable tree.
  • TreePlugin (1.7): Dynamic generation of TWiki topic trees
  • TwistyPlugin (1.2.0, $Rev: 12154$): Twisty section JavaScript library to open/close content dynamically
  • VotePlugin (1.33, $Rev: 14312 (01 Jul 2007) $): Simple way to count votes
  • WysiwygPlugin (Dakar, 12422): Translator framework for Wysiwyg editors
Line: 98 to 98
 

Available Core Functions

Changed:
<
<
The lib/TWiki/Func.pm implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.
>
>
The lib/TWiki/Func.pm implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.
 
Changed:
<
<
DevALERT: If you use functions not in Func.pm, you run the risk of creating security holes. Also, your Plugin will likely break and require updating when you upgrade to a new version of TWiki.
>
>
DevALERT: If you use functions not in Func.pm, you run the risk of creating security holes. Also, your Plugin will likely break and require updating when you upgrade to a new version of TWiki.
 
Changed:
<
<
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
>
>
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
 

Predefined Hooks

Changed:
<
<
In addition to TWiki core functions, Plugins can use predefined hooks, or call backs, listed in the lib/TWiki/Plugins/EmptyPlugin.pm module.
>
>
In addition to TWiki core functions, Plugins can use predefined hooks, or call backs, listed in the lib/TWiki/Plugins/EmptyPlugin.pm module.
 
Changed:
<
<
  • All but the initPlugin are disabled. To enable a call back, remove DISABLE_ from the function name.
>
>
  • All but the initPlugin are disabled. To enable a call back, remove DISABLE_ from the function name.
 

Plugin Version Detection

Changed:
<
<
To eliminate the incompatibility problems bound to arise from active open Plugin development, a Plugin versioning system and an API GetVersion detection routine are provided for automatic compatibility checking.
>
>
To eliminate the incompatibility problems bound to arise from active open Plugin development, a Plugin versioning system and an API GetVersion detection routine are provided for automatic compatibility checking.
 
Changed:
<
<
  • All modules require a $VERSION='0.000' variable, beginning at 1.000.
>
>
  • All modules require a $VERSION='0.000' variable, beginning at 1.000.
 
Changed:
<
<
  • The initPlugin handler should check all dependencies and return TRUE if the initialization is OK or FALSE if something went wrong.
    • The Plugin initialization code does not register a Plugin that returns FALSE (or that has no initPlugin handler).
>
>
  • The initPlugin handler should check all dependencies and return TRUE if the initialization is OK or FALSE if something went wrong.
    • The Plugin initialization code does not register a Plugin that returns FALSE (or that has no initPlugin handler).
 
Changed:
<
<
  • $VERSION='1.000' is the current setting in TWiki::Plugins.pm and in the preinstalled system Plugins (DefaultPlugin? , EmptyPlugin, InterwikiPlugin).
>
>
  • $VERSION='1.000' is the current setting in TWiki::Plugins.pm and in the preinstalled system Plugins (DefaultPlugin? , EmptyPlugin, InterwikiPlugin).
 

Creating Plugins

Line: 134 to 134
 A basic TWiki Plugin consists of two elements:
Changed:
<
<
  • a Perl module, ex: MyFirstPlugin.pm
  • a documentation topic, ex: MyFirstPlugin.txt
>
>
  • a Perl module, ex: MyFirstPlugin.pm
  • a documentation topic, ex: MyFirstPlugin.txt
 The Perl module can be a block of code that connects with TWiki alone, or it can include other elements, like other Perl modules (including other Plugins), graphics, TWiki templates, external applications (ex: a Java applet), or just about anything else it can call.
Changed:
<
<
In particular, files that should be web-accessible (graphics, Java applets ...) are best placed as attachments of the MyFirstPlugin topic. Other needed Perl code is best placed in a lib/TWiki/Plugins/MyFirstPlugin/ directory.
>
>
In particular, files that should be web-accessible (graphics, Java applets ...) are best placed as attachments of the MyFirstPlugin topic. Other needed Perl code is best placed in a lib/TWiki/Plugins/MyFirstPlugin/ directory.
 The Plugin API handles the details of connecting your Perl module with main TWiki code. When you're familiar with the Plugin API, you're ready to develop Plugins.

Creating the Perl Module

Changed:
<
<
Copy file lib/TWiki/Plugins/EmptyPlugin.pm to <name>Plugin.pm. EmptyPlugin.pm contains no executable code, so it does nothing, but it's ready to be used. Customize it. Refer to the Plugin API specs for more information.
>
>
Copy file lib/TWiki/Plugins/EmptyPlugin.pm to <name>Plugin.pm. EmptyPlugin.pm contains no executable code, so it does nothing, but it's ready to be used. Customize it. Refer to the Plugin API specs for more information.
 

Writing the Documentation Topic

Line: 180 to 180
 

Packaging for Distribution

Changed:
<
<
A minimum Plugin release consists of a Perl module with a WikiName that ends in Plugin, ex: MyFirstPlugin.pm, and a documentation page with the same name(MyFirstPlugin.txt).
>
>
A minimum Plugin release consists of a Perl module with a WikiName that ends in Plugin, ex: MyFirstPlugin.pm, and a documentation page with the same name(MyFirstPlugin.txt).
 
  1. Distribute the Plugin files in a directory structure that mirrors TWiki. If your Plugin uses additional files, include them ALL:
Changed:
<
<
    • lib/TWiki/Plugins/MyFirstPlugin.pm
    • data/TWiki/MyFirstPlugin.txt
    • pub/TWiki/MyFirstPlugin/uparrow.gif [a required graphic]
  1. Create a zip archive with the Plugin name (MyFirstPlugin.zip) and add the entire directory structure from Step 1. The archive should look like this:
    • lib/TWiki/Plugins/MyFirstPlugin.pm
    • data/TWiki/MyFirstPlugin.txt
    • pub/TWiki/MyFirstPlugin/uparrow.gif
>
>
    • lib/TWiki/Plugins/MyFirstPlugin.pm
    • data/TWiki/MyFirstPlugin.txt
    • pub/TWiki/MyFirstPlugin/uparrow.gif [a required graphic]
  1. Create a zip archive with the Plugin name (MyFirstPlugin.zip) and add the entire directory structure from Step 1. The archive should look like this:
    • lib/TWiki/Plugins/MyFirstPlugin.pm
    • data/TWiki/MyFirstPlugin.txt
    • pub/TWiki/MyFirstPlugin/uparrow.gif
 

Publishing for Public Use

Changed:
<
<
You can release your tested, packaged Plugin to the TWiki community through the TWiki:Plugins web, where all Plugins submitted to TWiki.org are available for download and further development discussion. Publish your Plugin in three steps:
>
>
You can release your tested, packaged Plugin to the TWiki community through the TWiki:Plugins web. All Plugins submitted to TWiki.org are available for download and further development in TWiki:Plugins. Publish your Plugin in three steps:
 
  1. Post the Plugin documentation topic in the TWiki:Plugins web:
Changed:
<
<
  1. Attach the distribution zip file to the topic, ex: MyFirstPlugin.zip.
  2. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: MyFirstPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)
>
>
  1. Attach the distribution zip file to the topic, ex: MyFirstPlugin.zip
  2. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: MyFirstPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)
 -- AndreaSterbini? - 29 May 2001
-- MikeMannix? - 01 Sep 2001

TWikiPlugins 13 - 14 Sep 2001 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Line: 13 to 13
 
  • heavily customize an installation and still do clean updates to new versions of TWiki;
  • rapidly develop new TWiki functions in Perl using the Plugin API.
Changed:
<
<
Everything to do with TWiki Plugins - demos, new releases, downloads, development, general discussion - is available at TWiki.org, in the TWiki.org Plugins web.
>
>
Everything to do with TWiki Plugins - demos, new releases, downloads, development, general discussion - is available at TWiki.org, in the TWiki:Plugins web.
 

Preinstalled Plugins

Line: 21 to 21
 
  • DefaultPlugin handles some legacy TWiki variables that may be present in long-established sites. This option can be controlled from TWikiPreferences. (Perl programmers can also add rules for simple custom processing.)
Changed:
<
<
  • EmptyPlug is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development.
>
>
  • EmptyPlugin is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development.
 
  • InterwikiPlugin is preinstalled but can be disabled or removed. Use it for quick linking to to remote sites: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can add your own shortcuts and URLs to the existing directory of Wiki-related and other probably useful sites.
Line: 83 to 83
 
DEMO: Active Plugin Variables
Changed:
<
<
%ACTIVATEDPLUGINS%
>
>
%ACTIVATEDPLUGINS%
 On this TWiki site, the active Plugins are: SpreadSheetPlugin, ActionTrackerPlugin, AttachmentListPlugin, BreadCrumbsPlugin, CalendarPlugin, CommentPlugin, CompareRevisionsAddonPlugin, EditTablePlugin, FilterPlugin, FlexWebListPlugin, FootNotePlugin, GluePlugin, IfDefinedPlugin, InterwikiPlugin, JQueryPlugin, NatSkinPlugin, PreferencesPlugin, RedDotPlugin, RenderListPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TreeBrowserPlugin, TreePlugin, TwistyPlugin, VotePlugin, WysiwygPlugin.
Changed:
<
<
%PLUGINDESCRIPTIONS%
>
>
%PLUGINDESCRIPTIONS%
 You can use any of these active TWiki Plugins:
  • SpreadSheetPlugin (any TWiki, 10197): Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables and other topic text
  • ActionTrackerPlugin (21 May 2007, $Rev: 14969 (20 Sep 2007) $): Adds support for action tags in topics, and automatic notification of action statuses
  • AttachmentListPlugin (1.0.1, $Rev: 15921 (07 Dec 2007) $): Displays a formattable list of topic attachments, anywhere in a topic.
  • BreadCrumbsPlugin (v1.00, $Rev: 13657 (08 May 2007) $): A flexible way to display breadcrumbs navigation
  • CalendarPlugin (Dakar, 9113): Show a monthly calendar with highlighted events
  • CommentPlugin (Dakar, 11359): Allows users to quickly post comments to a page without an edit/preview/save cycle
  • CompareRevisionsAddonPlugin (Dakar, $Rev: 9808$):
  • EditTablePlugin (any TWiki, 11646): Edit TWiki tables using edit fields, date pickers and drop down boxes
  • FilterPlugin (1.40, $Rev: 15932 (07 Dec 2007) $): Substitute and extract information from content by using regular expressions
  • FlexWebListPlugin (v1.21, $Rev: 16132 (03 Jan 2008) $): Flexible way to display hierarchical weblists
  • FootNotePlugin (2.006): Footnotes are notes placed at the end of a topic.
  • GluePlugin (2.00, $Rev: 15708 (23 Nov 2007) $): Enable markup to span multiple lines
  • IfDefinedPlugin (v1.01, $Rev: 15157 (05 Oct 2007) $): Render content conditionally
  • InterwikiPlugin (Dakar, $Rev: 11935$): Link ExternalSite:Page text to external sites based on aliases defined in a rules topic
  • JQueryPlugin (v0.4, $Rev: 15608 (15 Nov 2007) $): jQuery JavaScript library for TWiki
  • NatSkinPlugin (3.00-pre17, $Rev: 15581 (13 Nov 2007) $): Supplements the bare bones NatSkin theme for TWiki
  • PreferencesPlugin (Dakar, 9839): Allows editing of preferences using fields predefined in a form
  • RedDotPlugin (1.40, $Rev: 16137 (03 Jan 2008) $): Renders edit-links as little red dots
  • RenderListPlugin (any TWiki, 1.034): Render bullet lists in a variety of formats
  • SlideShowPlugin (Any TWiki, $Rev: 12847$): Create web based presentations based on topics with headings.
  • SmiliesPlugin (Dakar, 8154): Render smilies as icons, like smile for  :-) or eek! for = :eek:=
  • TablePlugin (1.020, 12339): Control attributes of tables and sorting of table columns
  • TreeBrowserPlugin (v1.8): Renders a list as a collapsable/expandable tree.
  • TreePlugin (1.7): Dynamic generation of TWiki topic trees
  • TwistyPlugin (1.2.0, $Rev: 12154$): Twisty section JavaScript library to open/close content dynamically
  • VotePlugin (1.33, $Rev: 14312 (01 Jul 2007) $): Simple way to count votes
  • WysiwygPlugin (Dakar, 12422): Translator framework for Wysiwyg editors
Line: 94 to 94
 

The TWiki Plugin API

Changed:
<
<
The Application Programming Interface (API) for TWikiPlugins provides the specifications for hooking into the core TWiki code from your external Perl Plugin module. The Plugin API is new to the Production version of TWiki with the TWikiReleaseSpring2001.
>
>
The Application Programming Interface (API) for TWikiPlugins provides the specifications for hooking into the core TWiki code from your external Perl Plugin module. The Plugin API is new to the Production version of TWiki with the 01-Sep-2001 release.
 

Available Core Functions

Line: 128 to 128
 

The DefaultPlugin Alternative

Changed:
<
<
  • DefaultPlugin can handle some outdated TWiki variables, found, for example, in sites recently updated from an old version. Settings are in TWikiPreferences. You can also add your own simple custom processing rules here, though in all but very simple cases, writing a new Plugin is preferable.
>
>
  • DefaultPlugin can handle some outdated TWiki variables, found, for example, in sites recently updated from an old version. Settings are in DefaultPlugin? topic. You can also add your own simple custom processing rules here, though in all but very simple cases, writing a new Plugin is preferable.
 

Anatomy of a Plugin

A basic TWiki Plugin consists of two elements:

Changed:
<
<
  • a Perl module, ex: YourPlugin.pm
  • a documentation topic, ex: YourPlugin.txt
>
>
  • a Perl module, ex: MyFirstPlugin.pm
  • a documentation topic, ex: MyFirstPlugin.txt
 The Perl module can be a block of code that connects with TWiki alone, or it can include other elements, like other Perl modules (including other Plugins), graphics, TWiki templates, external applications (ex: a Java applet), or just about anything else it can call.
Changed:
<
<
In particular, files that should be web-accessible (graphics, Java applets ...) are best placed as attachments of the YourPlugin topic. Other needed Perl code is best placed in a lib/TWiki/Plugins/YourPlugin/ directory.
>
>
In particular, files that should be web-accessible (graphics, Java applets ...) are best placed as attachments of the MyFirstPlugin topic. Other needed Perl code is best placed in a lib/TWiki/Plugins/MyFirstPlugin/ directory.
 The Plugin API handles the details of connecting your Perl module with main TWiki code. When you're familiar with the Plugin API, you're ready to develop Plugins.

Creating the Perl Module

Changed:
<
<
Copy file (EmptyPlugin.pm to <name>Plugin.pm EmptyPlugin.pm contains no executable code, so it does nothing, but it's ready to be used. Customize it. Refer to the Plugin API specs for more information.
>
>
Copy file lib/TWiki/Plugins/EmptyPlugin.pm to <name>Plugin.pm. EmptyPlugin.pm contains no executable code, so it does nothing, but it's ready to be used. Customize it. Refer to the Plugin API specs for more information.
 

Writing the Documentation Topic

The Plugin documentation topic contains usage instructions and version details. It serves the Plugin files as FileAttachments for downloading. (The doc topic is also included in the distribution package.) To create a documentation topic:

Changed:
<
<
  1. Copy the Plugin topic template from http://TWiki.org/cgi-bin/view/TWiki/EmptyPlugin. To copy the text, go to the page and:
>
>
  1. Copy the Plugin topic template from EmptyPlugin. To copy the text, go to the page and:
 
    • click Edit
    • select all in the Edit box & copy
    • Cancel the edit
Line: 161 to 161
 
OUTLINE: Doc Topic Contents
Changed:
<
<
Check EmptyPlugin on TWiki.org for the latest Plugin doc topic template. Here's a quick overview of what's covered:
>
>
Check EmptyPlugin on TWiki.org for the latest Plugin doc topic template. Here's a quick overview of what's covered:
 Syntax Rules: Describe any special text formatting that will be rendered.
Changed:
<
<
YourPlugin Settings: Description and settings for your custom Plugin %VARIABLES%, and those required by TWiki.
>
>
MyFirstPlugin Settings: Description and settings for custom Plugin %VARIABLES%, and those required by TWiki.
 Plugins Preferences work exactly like TWikiPreferences and WebPreferences: six (6) spaces and then:
    • Set EXAMPLE = got it!
Line: 180 to 180
 

Packaging for Distribution

Changed:
<
<
A minimum Plugin release consists of a Perl module with a WikiName that ends in Plugin, ex: YourPlugin.pm, and a documentation page with the same name(YourPlugin.txt).
>
>
A minimum Plugin release consists of a Perl module with a WikiName that ends in Plugin, ex: MyFirstPlugin.pm, and a documentation page with the same name(MyFirstPlugin.txt).
 
Changed:
<
<
  1. Distribute your Plugin files in a directory structure that mirrors TWiki. If your Plugin uses additional files, include them ALL:
    • lib/TWiki/Plugins/YourPlugin.pm
    • data/TWiki/YourPlugin.txt
    • pub/TWiki/YourPlugin/uparrow.gif [a required graphic]
  2. Create a zip archive with the Plugin name (YourPlugin.zip) and add the entire directory structure from Step 1. Your archive should look like this:
    • lib/TWiki/Plugins/YourPlugin.pm
    • data/TWiki/YourPlugin.txt
    • pub/TWiki/YourPlugin/uparrow.gif
>
>
  1. Distribute the Plugin files in a directory structure that mirrors TWiki. If your Plugin uses additional files, include them ALL:
    • lib/TWiki/Plugins/MyFirstPlugin.pm
    • data/TWiki/MyFirstPlugin.txt
    • pub/TWiki/MyFirstPlugin/uparrow.gif [a required graphic]
  2. Create a zip archive with the Plugin name (MyFirstPlugin.zip) and add the entire directory structure from Step 1. The archive should look like this:
    • lib/TWiki/Plugins/MyFirstPlugin.pm
    • data/TWiki/MyFirstPlugin.txt
    • pub/TWiki/MyFirstPlugin/uparrow.gif
 

Publishing for Public Use

Line: 197 to 197
 You can release your tested, packaged Plugin to the TWiki community through the TWiki:Plugins web, where all Plugins submitted to TWiki.org are available for download and further development discussion. Publish your Plugin in three steps:

  1. Post the Plugin documentation topic in the TWiki:Plugins web:
Changed:
<
<
    • create a new topic using the Plugin name, ex: YourPlugin.txt;
>
>
    • create a new topic using the Plugin name, ex: MyFirstPlugin.txt;
 
Changed:
<
<
  1. Attach the distribution zip file to the topic, ex: YourPlugin.zip.
  2. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: YourPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)
>
>
  1. Attach the distribution zip file to the topic, ex: MyFirstPlugin.zip.
  2. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: MyFirstPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)
 
Changed:
<
<
-- AndreaSterbini? - 29 May 2001
-- MikeMannix? - 01 Sep 2001
>
>
-- AndreaSterbini? - 29 May 2001
-- MikeMannix? - 01 Sep 2001
-- PeterThoeny? - 14 Sep 2001

TWikiPlugins 12 - 07 Sep 2001 - Main.MikeMannix
Line: 1 to 1
 
Changed:
<
<

TWiki Plugins

>
>

TWiki Plugins

 Plugin use and development; about the Plugin API.
Changed:
<
<

Overview

>
>

Overview

 You can add Plugins to greatly extend TWiki's functionality, without alering the program core. With a plug-in approach, you can:
Line: 15 to 15
 Everything to do with TWiki Plugins - demos, new releases, downloads, development, general discussion - is available at TWiki.org, in the TWiki.org Plugins web.
Changed:
<
<

Preinstalled Plugins

>
>

Preinstalled Plugins

 TWiki comes with three Plugins as part of the standard installation.
Line: 26 to 26
 
  • InterwikiPlugin is preinstalled but can be disabled or removed. Use it for quick linking to to remote sites: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can add your own shortcuts and URLs to the existing directory of Wiki-related and other probably useful sites.

Changed:
<
<

Installing Plugins

>
>

Installing Plugins

 Each TWikiPlugin comes with full documentation: step-by-step installation instructions, a detailed description of any special requirements, version details, and a working example for testing.
Line: 42 to 42
 
  • Dev page: Post feature requests, bug reports and general dev comments; topic title ends in Dev (SomePluginDev).
  • User support: Post installation, how to use type questions (and answers, if you have them) in the TWiki:Support web.
Changed:
<
<

On-Site Pretesting

>
>

On-Site Pretesting

 To test new Plugins on your installation before making them public, you may want to use one of these two approaches:
Line: 53 to 53
 
  • Method 2: List the Plugin under Test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Test web and do the testing there.
Changed:
<
<

Managing Plugins

>
>

Managing Plugins

 Ideally, after you've installed a Plugin, just read the instructions and you're set. In fact, some Plugins require additional settings or offer extra options that you can modify on Preferences pages. You may want to make a Plugin available only in certain webs, or temporarily disable it. And having to list all available Plugins will probably come up. You can handle all of these with simple procedures.
Changed:
<
<

Setting Preferences

>
>

Setting Preferences

 Installed Plugins can be toggled on or off, site-wide or by web, through TWikiPreferences and individual WebPreferences:
Line: 75 to 74
 
    • Set DEBUG = 0
  • The settings can be retrieved as Preferences variables like %<pluginname>_<var>%, ex: %DEFAULTPLUGIN_SHORTDESCRIPTION% shows the description of the DefaultPlugin.
Changed:
<
<

Listing Active Plugins

>
>

Listing Active Plugins

 Plugin status variables let you list all active Plugins wherever needed. There are two list formats:
  • The %ACTIVATEDPLUGINS% variable lists activated Plugins by name. (This variable is displayed in TWikiPreferences for debugging use.)
Line: 93 to 92
 

Changed:
<
<

The TWiki Plugin API

>
>

The TWiki Plugin API

 The Application Programming Interface (API) for TWikiPlugins provides the specifications for hooking into the core TWiki code from your external Perl Plugin module. The Plugin API is new to the Production version of TWiki with the TWikiReleaseSpring2001.
Changed:
<
<

Available Core Functions

>
>

Available Core Functions

 The lib/TWiki/Func.pm implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.
Line: 105 to 104
 
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
Changed:
<
<

Predefined Hooks

>
>

Predefined Hooks

 In addition to TWiki core functions, Plugins can use predefined hooks, or call backs, listed in the lib/TWiki/Plugins/EmptyPlugin.pm module.

  • All but the initPlugin are disabled. To enable a call back, remove DISABLE_ from the function name.
Changed:
<
<

Plugin Version Detection

>
>

Plugin Version Detection

 To eliminate the incompatibility problems bound to arise from active open Plugin development, a Plugin versioning system and an API GetVersion detection routine are provided for automatic compatibility checking.
Line: 122 to 121
 
  • $VERSION='1.000' is the current setting in TWiki::Plugins.pm and in the preinstalled system Plugins (DefaultPlugin? , EmptyPlugin, InterwikiPlugin).
Deleted:
<
<
 
Changed:
<
<

Creating Plugins

>
>

Creating Plugins

 With a reasonable knowledge of the Perl scripting language, you can create new Plugins or modify and extend existing ones. Basic plug-in architecture uses an Application Programming Interface (API), a set of software instructions that allow external code to interact with the main program. The TWiki Plugin API Plugins by providing a programming interface for TWiki.
Changed:
<
<

The DefaultPlugin Alternative

>
>

The DefaultPlugin Alternative

 
  • DefaultPlugin can handle some outdated TWiki variables, found, for example, in sites recently updated from an old version. Settings are in TWikiPreferences. You can also add your own simple custom processing rules here, though in all but very simple cases, writing a new Plugin is preferable.
Changed:
<
<

Anatomy of a Plugin

>
>

Anatomy of a Plugin

 A basic TWiki Plugin consists of two elements:
Line: 144 to 142
 The Plugin API handles the details of connecting your Perl module with main TWiki code. When you're familiar with the Plugin API, you're ready to develop Plugins.
Changed:
<
<

Creating the Perl Module

>
>

Creating the Perl Module

 Copy file (EmptyPlugin.pm to <name>Plugin.pm EmptyPlugin.pm contains no executable code, so it does nothing, but it's ready to be used. Customize it. Refer to the Plugin API specs for more information.

Changed:
<
<

Writing the Documentation Topic

>
>

Writing the Documentation Topic

 The Plugin documentation topic contains usage instructions and version details. It serves the Plugin files as FileAttachments for downloading. (The doc topic is also included in the distribution package.) To create a documentation topic:
Line: 180 to 178
 

Changed:
<
<

Packaging for Distribution

>
>

Packaging for Distribution

 A minimum Plugin release consists of a Perl module with a WikiName that ends in Plugin, ex: YourPlugin.pm, and a documentation page with the same name(YourPlugin.txt).
Line: 194 to 192
 
    • pub/TWiki/YourPlugin/uparrow.gif

Changed:
<
<

Publishing for Public Use

>
>

Publishing for Public Use

 You can release your tested, packaged Plugin to the TWiki community through the TWiki:Plugins web, where all Plugins submitted to TWiki.org are available for download and further development discussion. Publish your Plugin in three steps:

TWikiPlugins 11 - 02 Sep 2001 - Main.AndreaSterbini
Line: 1 to 1
 

TWiki Plugins

Line: 117 to 117
 
  • All modules require a $VERSION='0.000' variable, beginning at 1.000.
Changed:
<
<
  • The initPlugin handler checks all dependencies and returns TRUE if the initialization is OK or FALSE if something went wrong.
>
>
  • The initPlugin handler should check all dependencies and return TRUE if the initialization is OK or FALSE if something went wrong.
 
    • The Plugin initialization code does not register a Plugin that returns FALSE (or that has no initPlugin handler).

  • $VERSION='1.000' is the current setting in TWiki::Plugins.pm and in the preinstalled system Plugins (DefaultPlugin? , EmptyPlugin, InterwikiPlugin).
Line: 140 to 140
 
  • a documentation topic, ex: YourPlugin.txt

The Perl module can be a block of code that connects with TWiki alone, or it can include other elements, like other Perl modules (including other Plugins), graphics, TWiki templates, external applications (ex: a Java applet), or just about anything else it can call.

Added:
>
>
In particular, files that should be web-accessible (graphics, Java applets ...) are best placed as attachments of the YourPlugin topic. Other needed Perl code is best placed in a lib/TWiki/Plugins/YourPlugin/ directory.
 The Plugin API handles the details of connecting your Perl module with main TWiki code. When you're familiar with the Plugin API, you're ready to develop Plugins.

TWikiPlugins 10 - 02 Sep 2001 - Main.MikeMannix
Line: 1 to 1
 

TWiki Plugins

Changed:
<
<
TWikiPlugins allow you to add new features to TWiki without changing the core program. Using a plug-in approach means that you can:
>
>
Plugin use and development; about the Plugin API.
 
Changed:
<
<
  • add virtually unlimited features while keeping the main TWiki program compact and efficient;
>
>

Overview

You can add Plugins to greatly extend TWiki's functionality, without alering the program core. With a plug-in approach, you can:

  • add virtually unlimited features while keeping the main TWiki code compact and efficient;
 
  • heavily customize an installation and still do clean updates to new versions of TWiki;
  • rapidly develop new TWiki functions in Perl using the Plugin API.
Changed:
<
<
Everything to do with TWiki Plugins - including demos, new releases, downloads, and discussion - is available at TWiki.org, in the TWiki.org Plugins web.
>
>
Everything to do with TWiki Plugins - demos, new releases, downloads, development, general discussion - is available at TWiki.org, in the TWiki.org Plugins web.

Preinstalled Plugins

TWiki comes with three Plugins as part of the standard installation.

  • DefaultPlugin handles some legacy TWiki variables that may be present in long-established sites. This option can be controlled from TWikiPreferences. (Perl programmers can also add rules for simple custom processing.)

  • EmptyPlug is a fully functional module, minus active code; it does nothing and serves as a template for new Plugin development.

  • InterwikiPlugin is preinstalled but can be disabled or removed. Use it for quick linking to to remote sites: TWiki:Plugins expands to TWiki:Plugins on TWiki.org. You can add your own shortcuts and URLs to the existing directory of Wiki-related and other probably useful sites.
 

Installing Plugins

Line: 21 to 35
 
  1. Distribute the files to their proper locations - unzip the zip archive in your TWiki installation directory - if have a standard TWiki installation, this will distribute automatically. Otherwise, place the files according to the directory paths listed on the Plugin top in TWiki:Plugins.
  2. Check the demo example on the Plugin topic: if it's working, the installation was fine!
Changed:
<
<
Some Plugins need certain Perl modules to be pre-installed on the host system. Plugins may also use other resources, like graphics, other modules, applications, templates. In these cases, detailed instructions are in the Plugin documentation.
>
>
Special Requests: Some Plugins need certain Perl modules to be preinstalled on the host system. Plugins may also use other resources, like graphics, other modules, applications, templates. In these cases, detailed instructions are in the Plugin documentation.
 
Changed:
<
<
TWikiPlugin documentation pages are located at TWiki.org, in TWiki:Plugins web. Each Plugin has an doc topic (ex: SomePlugin) and a separate development page.
>
>
Each Plugin has a standard release page, located in the TWiki:Plugins web at TWiki.org. In addition to the documentation topic (SomePlugin), there's a separate development page.
 
  • Doc page: Read all available info about the Plugin; download the attached distribution files.
Changed:
<
<
  • Dev page: Post feature requests, bug reports and general dev comments; topic title ends in Dev (ex: SomePluginDev).
>
>
  • Dev page: Post feature requests, bug reports and general dev comments; topic title ends in Dev (SomePluginDev).
 
  • User support: Post installation, how to use type questions (and answers, if you have them) in the TWiki:Support web.
Changed:
<
<

Preinstalled Plugins

>
>

On-Site Pretesting

 
Changed:
<
<
TWiki comes with three Plugins as part of the standard installation.
>
>
To test new Plugins on your installation before making them public, you may want to use one of these two approaches:
 
Changed:
<
<
  • DefaultPlugin handles some legacy TWiki variables that may be present in long-established sites. This option can be controlled from TWikiPreferences. (Perl programmers can also add rules for simple custom processing.)
>
>
  • Method 1: Create Production and a Test installation of TWiki.
    • Duplicate the twiki/bin and twiki/lib directories for the Test version, adjusting the paths in the new lib/TWiki.cfg, the twiki/data; the twiki/templates and twiki/pub directories are shared.
    • Test Plugins and other new features in the Test installation until you're satisfied.
    • Copy the modified files to the Production installation. You can update a live TWiki installation and users won't even notice.
 
Changed:
<
<
  • EmptyPlug is a fully functional Plugin module, minus any active code; it does nothing but serve as a template on demand.
>
>
  • Method 2: List the Plugin under Test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the Test web and do the testing there.
 
Deleted:
<
<
  • InterwikiPlugin is included but can be disabled or removed. Use it for quick linking to frequently linked to remote sites. Ex: TWiki:Plugins expands to TWiki:Plugins - on TWiki.org. You can add your own shortcuts and URLs to the existing directory of Wiki-related sites.
 

Managing Plugins

Line: 76 to 92
 
  • SpreadSheetPlugin (any TWiki, 10197): Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables and other topic text
  • ActionTrackerPlugin (21 May 2007, $Rev: 14969 (20 Sep 2007) $): Adds support for action tags in topics, and automatic notification of action statuses
  • AttachmentListPlugin (1.0.1, $Rev: 15921 (07 Dec 2007) $): Displays a formattable list of topic attachments, anywhere in a topic.
  • BreadCrumbsPlugin (v1.00, $Rev: 13657 (08 May 2007) $): A flexible way to display breadcrumbs navigation
  • CalendarPlugin (Dakar, 9113): Show a monthly calendar with highlighted events
  • CommentPlugin (Dakar, 11359): Allows users to quickly post comments to a page without an edit/preview/save cycle
  • CompareRevisionsAddonPlugin (Dakar, $Rev: 9808$):
  • EditTablePlugin (any TWiki, 11646): Edit TWiki tables using edit fields, date pickers and drop down boxes
  • FilterPlugin (1.40, $Rev: 15932 (07 Dec 2007) $): Substitute and extract information from content by using regular expressions
  • FlexWebListPlugin (v1.21, $Rev: 16132 (03 Jan 2008) $): Flexible way to display hierarchical weblists
  • FootNotePlugin (2.006): Footnotes are notes placed at the end of a topic.
  • GluePlugin (2.00, $Rev: 15708 (23 Nov 2007) $): Enable markup to span multiple lines
  • IfDefinedPlugin (v1.01, $Rev: 15157 (05 Oct 2007) $): Render content conditionally
  • InterwikiPlugin (Dakar, $Rev: 11935$): Link ExternalSite:Page text to external sites based on aliases defined in a rules topic
  • JQueryPlugin (v0.4, $Rev: 15608 (15 Nov 2007) $): jQuery JavaScript library for TWiki
  • NatSkinPlugin (3.00-pre17, $Rev: 15581 (13 Nov 2007) $): Supplements the bare bones NatSkin theme for TWiki
  • PreferencesPlugin (Dakar, 9839): Allows editing of preferences using fields predefined in a form
  • RedDotPlugin (1.40, $Rev: 16137 (03 Jan 2008) $): Renders edit-links as little red dots
  • RenderListPlugin (any TWiki, 1.034): Render bullet lists in a variety of formats
  • SlideShowPlugin (Any TWiki, $Rev: 12847$): Create web based presentations based on topics with headings.
  • SmiliesPlugin (Dakar, 8154): Render smilies as icons, like smile for  :-) or eek! for = :eek:=
  • TablePlugin (1.020, 12339): Control attributes of tables and sorting of table columns
  • TreeBrowserPlugin (v1.8): Renders a list as a collapsable/expandable tree.
  • TreePlugin (1.7): Dynamic generation of TWiki topic trees
  • TwistyPlugin (1.2.0, $Rev: 12154$): Twisty section JavaScript library to open/close content dynamically
  • VotePlugin (1.33, $Rev: 14312 (01 Jul 2007) $): Simple way to count votes
  • WysiwygPlugin (Dakar, 12422): Translator framework for Wysiwyg editors
Changed:
<
<
TIP! To test new Plugins on your installation before making them public, you may want to use one of these two approaches:
>
>

The TWiki Plugin API

 
Changed:
<
<
  • Method 1: Create a Production and a Test installation of TWiki. The twiki/data, twiki/templates and twiki/pub directories are shared, and the twiki/bin and twiki/lib directories are separate. Do all tests of Plugins and other new features in the Test installation. When everything works, copy the modified files over to the Production installation. This way, you can update a live TWiki installation and users won't even notice.
>
>
The Application Programming Interface (API) for TWikiPlugins provides the specifications for hooking into the core TWiki code from your external Perl Plugin module. The Plugin API is new to the Production version of TWiki with the TWikiReleaseSpring2001.
 
Changed:
<
<
  • Method 2: List the Plugin under test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the test web and do the testing there.
>
>

Available Core Functions

 
Changed:
<
<

Creating Plugins

>
>
The lib/TWiki/Func.pm implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.
 
Changed:
<
<
With a reasonable knowledge of the Perl scripting language, you can create new Plugins or modify and extend existing ones. Basic plug-in architecture uses an Application Programming Interface (API), a set of software instructions that allow external code to interact with the main program. The TWiki Plugin API Plugins by providing a programming interface for TWiki.
>
>
DevALERT: If you use functions not in Func.pm, you run the risk of creating security holes. Also, your Plugin will likely break and require updating when you upgrade to a new version of TWiki.
 
Changed:
<
<

Anatomy of a Plugin

>
>
  • For best performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
 
Changed:
<
<
A basic TWiki Plugin consists of two elements:
>
>

Predefined Hooks

 
Changed:
<
<
  • a Perl module, ex: YourPlugin.pm
  • a documentation topic, ex: YourPlugin.txt
>
>
In addition to TWiki core functions, Plugins can use predefined hooks, or call backs, listed in the lib/TWiki/Plugins/EmptyPlugin.pm module.
 
Changed:
<
<
The Perl module can be a block of code that connects with TWiki alone, or it can include other elements, like other Perl modules (including other Plugins), graphics, TWiki templates, external applications (ex: a Java applet), or just about anything else it can call.
>
>
  • All but the initPlugin are disabled. To enable a call back, remove DISABLE_ from the function name.
 
Changed:
<
<
The Plugin API handles the details of connecting your Perl module with main TWiki code. When you're familiar with the Plugin API, you're ready to develop Plugins.
>
>

Plugin Version Detection

 
Changed:
<
<

TWiki Plugin API

>
>
To eliminate the incompatibility problems bound to arise from active open Plugin development, a Plugin versioning system and an API GetVersion detection routine are provided for automatic compatibility checking.
 
Changed:
<
<
The Application Programming Interface (API) for TWikiPlugins provides the specifications for hooking into the core TWiki code from your external Perl Plugin module. The Plugin API is new to the Production version of TWiki with the TWikiReleaseSpring2001.
>
>
  • All modules require a $VERSION='0.000' variable, beginning at 1.000.
 
Changed:
<
<
The lib/TWiki/Func.pm implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.
>
>
  • The initPlugin handler checks all dependencies and returns TRUE if the initialization is OK or FALSE if something went wrong.
    • The Plugin initialization code does not register a Plugin that returns FALSE (or that has no initPlugin handler).
 
Changed:
<
<
DevALERT: If you use functions not in Func.pm, you run the risk of creating security holes. Also, your Plugin will likely break and require updating when you upgrade to a new version of TWiki.
>
>
  • $VERSION='1.000' is the current setting in TWiki::Plugins.pm and in the preinstalled system Plugins (DefaultPlugin? , EmptyPlugin, InterwikiPlugin).
 
Deleted:
<
<
In addition to TWiki core functions, Plugins can use predefined hooks, or call backs, listed in the lib/TWiki/Plugins/EmptyPlugin.pm module.
 
Changed:
<
<
  • All but the initPlugin are disabled. To enable a call back, remove DISABLE_ from the function name.
>
>

Creating Plugins

 
Changed:
<
<
  • For improve performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
>
>
With a reasonable knowledge of the Perl scripting language, you can create new Plugins or modify and extend existing ones. Basic plug-in architecture uses an Application Programming Interface (API), a set of software instructions that allow external code to interact with the main program. The TWiki Plugin API Plugins by providing a programming interface for TWiki.
 

The DefaultPlugin Alternative

  • DefaultPlugin can handle some outdated TWiki variables, found, for example, in sites recently updated from an old version. Settings are in TWikiPreferences. You can also add your own simple custom processing rules here, though in all but very simple cases, writing a new Plugin is preferable.
Added:
>
>

Anatomy of a Plugin

A basic TWiki Plugin consists of two elements:

  • a Perl module, ex: YourPlugin.pm
  • a documentation topic, ex: YourPlugin.txt

The Perl module can be a block of code that connects with TWiki alone, or it can include other elements, like other Perl modules (including other Plugins), graphics, TWiki templates, external applications (ex: a Java applet), or just about anything else it can call.

The Plugin API handles the details of connecting your Perl module with main TWiki code. When you're familiar with the Plugin API, you're ready to develop Plugins.

 

Creating the Perl Module

Copy file (EmptyPlugin.pm to <name>Plugin.pm EmptyPlugin.pm contains no executable code, so it does nothing, but it's ready to be used. Customize it. Refer to the Plugin API specs for more information.

Line: 177 to 203
 
  1. Attach the distribution zip file to the topic, ex: YourPlugin.zip.
  2. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: YourPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)
Changed:
<
<
-- MikeMannix? - 26 Aug 2001
>
>
-- AndreaSterbini? - 29 May 2001
-- MikeMannix? - 01 Sep 2001

TWikiPlugins 9 - 01 Sep 2001 - Main.MikeMannix
Line: 1 to 1
 

TWiki Plugins

Line: 28 to 28
 
  • Dev page: Post feature requests, bug reports and general dev comments; topic title ends in Dev (ex: SomePluginDev).
  • User support: Post installation, how to use type questions (and answers, if you have them) in the TWiki:Support web.
Changed:
<
<

Pre-Installed Plugins

>
>

Preinstalled Plugins

 TWiki comes with three Plugins as part of the standard installation.
Line: 38 to 38
 
  • InterwikiPlugin is included but can be disabled or removed. Use it for quick linking to frequently linked to remote sites. Ex: TWiki:Plugins expands to TWiki:Plugins - on TWiki.org. You can add your own shortcuts and URLs to the existing directory of Wiki-related sites.
Changed:
<
<

Managing Installed Plugins

>
>

Managing Plugins

 Ideally, after you've installed a Plugin, just read the instructions and you're set. In fact, some Plugins require additional settings or offer extra options that you can modify on Preferences pages. You may want to make a Plugin available only in certain webs, or temporarily disable it. And having to list all available Plugins will probably come up. You can handle all of these with simple procedures.
Changed:
<
<

Set Preferences for Individual Plugins

>
>

Setting Preferences

 Installed Plugins can be toggled on or off, site-wide or by web, through TWikiPreferences and individual WebPreferences:
Line: 59 to 59
 
    • Set DEBUG = 0
  • The settings can be retrieved as Preferences variables like %<pluginname>_<var>%, ex: %DEFAULTPLUGIN_SHORTDESCRIPTION% shows the description of the DefaultPlugin.
Changed:
<
<

List Active Plugins Automatically

>
>

Listing Active Plugins

 Plugin status variables let you list all active Plugins wherever needed. There are two list formats:
  • The %ACTIVATEDPLUGINS% variable lists activated Plugins by name. (This variable is displayed in TWikiPreferences for debugging use.)
Line: 83 to 83
 
  • Method 2: List the Plugin under test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the test web and do the testing there.

Changed:
<
<

Creating New Plugins

>
>

Creating Plugins

 With a reasonable knowledge of the Perl scripting language, you can create new Plugins or modify and extend existing ones. Basic plug-in architecture uses an Application Programming Interface (API), a set of software instructions that allow external code to interact with the main program. The TWiki Plugin API Plugins by providing a programming interface for TWiki.
Line: 113 to 113
 
  • For improve performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.
Changed:
<
<

Customize the DefaultPlugin

>
>

The DefaultPlugin Alternative

 
  • DefaultPlugin can handle some outdated TWiki variables, found, for example, in sites recently updated from an old version. Settings are in TWikiPreferences. You can also add your own simple custom processing rules here, though in all but very simple cases, writing a new Plugin is preferable.
Changed:
<
<

Create a Plugin Module in Perl

>
>

Creating the Perl Module

 Copy file (EmptyPlugin.pm to <name>Plugin.pm EmptyPlugin.pm contains no executable code, so it does nothing, but it's ready to be used. Customize it. Refer to the Plugin API specs for more information.

Changed:
<
<

Create a Plugin Documentation Topic

>
>

Writing the Documentation Topic

 The Plugin documentation topic contains usage instructions and version details. It serves the Plugin files as FileAttachments for downloading. (The doc topic is also included in the distribution package.) To create a documentation topic:
Line: 153 to 153
 

Changed:
<
<

Package a Plugin for Distribution

>
>

Packaging for Distribution

 A minimum Plugin release consists of a Perl module with a WikiName that ends in Plugin, ex: YourPlugin.pm, and a documentation page with the same name(YourPlugin.txt).
Line: 167 to 167
 
    • pub/TWiki/YourPlugin/uparrow.gif

Changed:
<
<

Publish a Plugin for General Use

>
>

Publishing for Public Use

 You can release your tested, packaged Plugin to the TWiki community through the TWiki:Plugins web, where all Plugins submitted to TWiki.org are available for download and further development discussion. Publish your Plugin in three steps:

TWikiPlugins 8 - 31 Aug 2001 - Main.MikeMannix
Line: 1 to 1
 

TWiki Plugins

Deleted:
<
<

About Plugins

 TWikiPlugins allow you to add new features to TWiki without changing the core program. Using a plug-in approach means that you can:

  • add virtually unlimited features while keeping the main TWiki program compact and efficient;

TWikiPlugins 7 - 27 Aug 2001 - Main.MikeMannix
Line: 1 to 1
 

TWiki Plugins

Line: 11 to 11
 
  • heavily customize an installation and still do clean updates to new versions of TWiki;
  • rapidly develop new TWiki functions in Perl using the Plugin API.
Changed:
<
<
Everything to do with TWiki Plugins - including demos, new releases, downloads, and discussion - is available at TWiki.org, in the TWiki.org Plugins web.
>
>
Everything to do with TWiki Plugins - including demos, new releases, downloads, and discussion - is available at TWiki.org, in the TWiki.org Plugins web.
 

Installing Plugins

Line: 46 to 46
 

Set Preferences for Individual Plugins

Changed:
<
<
Installed Plugins can be toggled on or off, site-wide or by web, through TWikiPreferences and individual WebPreferences:
>
>
Installed Plugins can be toggled on or off, site-wide or by web, through TWikiPreferences and individual WebPreferences:
 
Changed:
<
<
  • All Plugin modules present in the lib/TWiki/Plugins directory are activated automatically unless disabled by the DISABLEDPLUGINS Preferences variable in TWikiPreferences. You can optionally list the installed Plugins in the INSTALLEDPLUGINS Preferences variable. This is useful to define the sequence of Plugin execution, or to specify other webs than the TWiki web for the Plugin topics. Settings in TWikiPreferences are:
>
>
  • All Plugin modules present in the lib/TWiki/Plugins directory are activated automatically unless disabled by the DISABLEDPLUGINS Preferences variable in TWikiPreferences. You can optionally list the installed Plugins in the INSTALLEDPLUGINS Preferences variable. This is useful to define the sequence of Plugin execution, or to specify other webs than the TWiki web for the Plugin topics. Settings in TWikiPreferences are:
 
    • Set INSTALLEDPLUGINS = DefaultPlugin, ...
    • Set DISABLEDPLUGINS = EmptyPlugin, ...
Line: 64 to 64
 

List Active Plugins Automatically

Plugin status variables let you list all active Plugins wherever needed. There are two list formats:

Changed:
<
<
  • The %ACTIVATEDPLUGINS% variable lists activated Plugins by name. (This variable is displayed in TWikiPreferences for debugging use.)
  • The %PLUGINDESCRIPTIONS% variable displays a bullet list with a one-line description of each active Plugins. This variable is based on the %<plugin>_SHORTDESCRIPTION% Preferences variables of individual topics and is shown in TextFormattingRules.
>
>
  • The %ACTIVATEDPLUGINS% variable lists activated Plugins by name. (This variable is displayed in TWikiPreferences for debugging use.)
  • The %PLUGINDESCRIPTIONS% variable displays a bullet list with a one-line description of each active Plugins. This variable is based on the %<plugin>_SHORTDESCRIPTION% Preferences variables of individual topics and is shown in TextFormattingRules.
 
DEMO: Active Plugin Variables
Line: 82 to 82
 
  • Method 1: Create a Production and a Test installation of TWiki. The twiki/data, twiki/templates and twiki/pub directories are shared, and the twiki/bin and twiki/lib directories are separate. Do all tests of Plugins and other new features in the Test installation. When everything works, copy the modified files over to the Production installation. This way, you can update a live TWiki installation and users won't even notice.
Changed:
<
<
  • Method 2: List the Plugin under test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the test web and do the testing there.
>
>
  • Method 2: List the Plugin under test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the test web and do the testing there.
 

Creating New Plugins

Line: 138 to 138
 
OUTLINE: Doc Topic Contents
Changed:
<
<
Check EmptyPlugin on TWiki.org for the latest Plugin doc topic template. Here's a quick overview of what's covered:
>
>
Check EmptyPlugin on TWiki.org for the latest Plugin doc topic template. Here's a quick overview of what's covered:
 
Changed:
<
<
Syntax Rules: explanation coming up
>
>
Syntax Rules: Describe any special text formatting that will be rendered.
 YourPlugin Settings: Description and settings for your custom Plugin %VARIABLES%, and those required by TWiki.
Line: 175 to 175
 
  1. Post the Plugin documentation topic in the TWiki:Plugins web:
    • create a new topic using the Plugin name, ex: YourPlugin.txt;
Changed:
<
<
>
>
 
  1. Attach the distribution zip file to the topic, ex: YourPlugin.zip.
  2. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: YourPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)

TWikiPlugins 6 - 27 Aug 2001 - Main.MikeMannix
Line: 1 to 1
 

TWiki Plugins

Line: 179 to 179
 
  1. Attach the distribution zip file to the topic, ex: YourPlugin.zip.
  2. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: YourPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)
Changed:
<
<
-- MikeMannix? - 26 Aug 2001
>
>
-- MikeMannix? - 26 Aug 2001

TWikiPlugins 5 - 26 Aug 2001 - Main.MikeMannix
Line: 1 to 1
Changed:
<
<

TWiki Plugins

>
>

TWiki Plugins

 
Changed:
<
<
Plugins allow you to extend the syntax or functionality of TWiki. ...
>
>

About Plugins

 
Changed:
<
<
TWikiPreferences has the list of installed plugins and activated plugins.
>
>
TWikiPlugins allow you to add new features to TWiki without changing the core program. Using a plug-in approach means that you can:
 
Changed:
<
<

How to Create a Plugin

>
>
  • add virtually unlimited features while keeping the main TWiki program compact and efficient;
  • heavily customize an installation and still do clean updates to new versions of TWiki;
  • rapidly develop new TWiki functions in Perl using the Plugin API.
 
Changed:
<
<
under construction... ( check back at http://TWiki.org/cgi-bin/view/TWiki/TWikiPlugins )
>
>
Everything to do with TWiki Plugins - including demos, new releases, downloads, and discussion - is available at TWiki.org, in the TWiki.org Plugins web.
 
Changed:
<
<

How to Install a Plugin

>
>

Installing Plugins

 
Changed:
<
<
under construction... ( check back at http://TWiki.org/cgi-bin/view/TWiki/TWikiPlugins )
>
>
Each TWikiPlugin comes with full documentation: step-by-step installation instructions, a detailed description of any special requirements, version details, and a working example for testing.
 
Changed:
<
<

Plugins under the hood

>
>
Most Plugins can be installed in three easy steps, with no programming skills required:
  1. Download the zip file containing the Plugin, documentation, and any other required files, from TWiki:Plugins.
  2. Distribute the files to their proper locations - unzip the zip archive in your TWiki installation directory - if have a standard TWiki installation, this will distribute automatically. Otherwise, place the files according to the directory paths listed on the Plugin top in TWiki:Plugins.
  3. Check the demo example on the Plugin topic: if it's working, the installation was fine!
 
Changed:
<
<
  • All plugin modules that exist in the lib/TWiki/Plugins directory are activated automatically unless disabled by the DISABLEDPLUGINS preferences variable in TWikiPreferences. You can optionally list the installed plugins in the INSTALLEDPLUGINS preferences variable. This is useful to define the sequence of plugin execution, or to specify other webs then the TWiki web for the plugin topics. Settings in TWikiPreferences:
    • Set INSTALLEDPLUGINS = DefaultPlugin, ...
    • Set DISABLEDPLUGINS = EmptyPlugin, ...
>
>
Some Plugins need certain Perl modules to be pre-installed on the host system. Plugins may also use other resources, like graphics, other modules, applications, templates. In these cases, detailed instructions are in the Plugin documentation.
 
Changed:
<
<
  • The %ACTIVATEDPLUGINS% variable shows all currently activated plugins. This variable is shown in TWikiPreferences for debug reasons.
>
>
TWikiPlugin documentation pages are located at TWiki.org, in TWiki:Plugins web. Each Plugin has an doc topic (ex: SomePlugin) and a separate development page.
  • Doc page: Read all available info about the Plugin; download the attached distribution files.
  • Dev page: Post feature requests, bug reports and general dev comments; topic title ends in Dev (ex: SomePluginDev).
  • User support: Post installation, how to use type questions (and answers, if you have them) in the TWiki:Support web.
 
Changed:
<
<
  • Search order for plugin topics: Full web.topicname name is used if specified in INSTALLEDPLUGINS, then the TWiki web is searched, then the current web.
>
>

Pre-Installed Plugins

 
Changed:
<
<
  • Plugin specific settings are done in individual plugin topics. Two settings are standard for each plugin:
    • One line description, used to form the bullets describing the plugins in the TextFormattingRules topic:
      • Set SHORTDESCRIPTION = Blah blah.
    • Debug plugin, output can be seen in data/debug.txt: (Se to 0 or 1)
      • Set DEBUG = 0
    • The settings can be retrieved as preferences variables like %<pluginname>_<var>%, i.e. %DEFAULTPLUGIN_SHORTDESCRIPTION% shows the description of the DefaultPlugin.
>
>
TWiki comes with three Plugins as part of the standard installation.
 
Changed:
<
<
  • The %PLUGINDESCRIPTIONS% variable shows a bullet list with descriptions of all currently activated plugins. This variable is based on %<plugin>_SHORTDESCRIPTION% preferences variables of individual topics and is shown in TextFormattingRules.
>
>
  • DefaultPlugin handles some legacy TWiki variables that may be present in long-established sites. This option can be controlled from TWikiPreferences. (Perl programmers can also add rules for simple custom processing.)
 
Changed:
<
<
-- PeterThoeny? - 14 Jul 2001
>
>
  • EmptyPlug is a fully functional Plugin module, minus any active code; it does nothing but serve as a template on demand.

  • InterwikiPlugin is included but can be disabled or removed. Use it for quick linking to frequently linked to remote sites. Ex: TWiki:Plugins expands to TWiki:Plugins - on TWiki.org. You can add your own shortcuts and URLs to the existing directory of Wiki-related sites.

Managing Installed Plugins

Ideally, after you've installed a Plugin, just read the instructions and you're set. In fact, some Plugins require additional settings or offer extra options that you can modify on Preferences pages. You may want to make a Plugin available only in certain webs, or temporarily disable it. And having to list all available Plugins will probably come up. You can handle all of these with simple procedures.

Set Preferences for Individual Plugins

Installed Plugins can be toggled on or off, site-wide or by web, through TWikiPreferences and individual WebPreferences:

  • All Plugin modules present in the lib/TWiki/Plugins directory are activated automatically unless disabled by the DISABLEDPLUGINS Preferences variable in TWikiPreferences. You can optionally list the installed Plugins in the INSTALLEDPLUGINS Preferences variable. This is useful to define the sequence of Plugin execution, or to specify other webs than the TWiki web for the Plugin topics. Settings in TWikiPreferences are:
    • Set INSTALLEDPLUGINS = DefaultPlugin, ...
    • Set DISABLEDPLUGINS = EmptyPlugin, ...

Plugin execution order in TWiki is determined by searching Plugin topics in a specific sequence: First, full web.topicname name, if specified in INSTALLEDPLUGINS; next, the TWiki web is searched; and finally, the current web.

Plugin-specific settings are done in individual Plugin topics. Two settings are standard for each Plugin:

  1. One line description, used to form the bullets describing the Plugins in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Blah blah woof woof.
  2. Debug Plugin, output can be seen in data/debug.txt. Set to 0=off or 1=on:
    • Set DEBUG = 0
  • The settings can be retrieved as Preferences variables like %<pluginname>_<var>%, ex: %DEFAULTPLUGIN_SHORTDESCRIPTION% shows the description of the DefaultPlugin.

List Active Plugins Automatically

Plugin status variables let you list all active Plugins wherever needed. There are two list formats:

  • The %ACTIVATEDPLUGINS% variable lists activated Plugins by name. (This variable is displayed in TWikiPreferences for debugging use.)
  • The %PLUGINDESCRIPTIONS% variable displays a bullet list with a one-line description of each active Plugins. This variable is based on the %<plugin>_SHORTDESCRIPTION% Preferences variables of individual topics and is shown in TextFormattingRules.

DEMO: Active Plugin Variables

%ACTIVATEDPLUGINS%
On this TWiki site, the active Plugins are: SpreadSheetPlugin, ActionTrackerPlugin, AttachmentListPlugin, BreadCrumbsPlugin, CalendarPlugin, CommentPlugin, CompareRevisionsAddonPlugin, EditTablePlugin, FilterPlugin, FlexWebListPlugin, FootNotePlugin, GluePlugin, IfDefinedPlugin, InterwikiPlugin, JQueryPlugin, NatSkinPlugin, PreferencesPlugin, RedDotPlugin, RenderListPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TreeBrowserPlugin, TreePlugin, TwistyPlugin, VotePlugin, WysiwygPlugin.

%PLUGINDESCRIPTIONS%
You can use any of these active TWiki Plugins:

  • SpreadSheetPlugin (any TWiki, 10197): Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables and other topic text
  • ActionTrackerPlugin (21 May 2007, $Rev: 14969 (20 Sep 2007) $): Adds support for action tags in topics, and automatic notification of action statuses
  • AttachmentListPlugin (1.0.1, $Rev: 15921 (07 Dec 2007) $): Displays a formattable list of topic attachments, anywhere in a topic.
  • BreadCrumbsPlugin (v1.00, $Rev: 13657 (08 May 2007) $): A flexible way to display breadcrumbs navigation
  • CalendarPlugin (Dakar, 9113): Show a monthly calendar with highlighted events
  • CommentPlugin (Dakar, 11359): Allows users to quickly post comments to a page without an edit/preview/save cycle
  • CompareRevisionsAddonPlugin (Dakar, $Rev: 9808$):
  • EditTablePlugin (any TWiki, 11646): Edit TWiki tables using edit fields, date pickers and drop down boxes
  • FilterPlugin (1.40, $Rev: 15932 (07 Dec 2007) $): Substitute and extract information from content by using regular expressions
  • FlexWebListPlugin (v1.21, $Rev: 16132 (03 Jan 2008) $): Flexible way to display hierarchical weblists
  • FootNotePlugin (2.006): Footnotes are notes placed at the end of a topic.
  • GluePlugin (2.00, $Rev: 15708 (23 Nov 2007) $): Enable markup to span multiple lines
  • IfDefinedPlugin (v1.01, $Rev: 15157 (05 Oct 2007) $): Render content conditionally
  • InterwikiPlugin (Dakar, $Rev: 11935$): Link ExternalSite:Page text to external sites based on aliases defined in a rules topic
  • JQueryPlugin (v0.4, $Rev: 15608 (15 Nov 2007) $): jQuery JavaScript library for TWiki
  • NatSkinPlugin (3.00-pre17, $Rev: 15581 (13 Nov 2007) $): Supplements the bare bones NatSkin theme for TWiki
  • PreferencesPlugin (Dakar, 9839): Allows editing of preferences using fields predefined in a form
  • RedDotPlugin (1.40, $Rev: 16137 (03 Jan 2008) $): Renders edit-links as little red dots
  • RenderListPlugin (any TWiki, 1.034): Render bullet lists in a variety of formats
  • SlideShowPlugin (Any TWiki, $Rev: 12847$): Create web based presentations based on topics with headings.
  • SmiliesPlugin (Dakar, 8154): Render smilies as icons, like smile for  :-) or eek! for = :eek:=
  • TablePlugin (1.020, 12339): Control attributes of tables and sorting of table columns
  • TreeBrowserPlugin (v1.8): Renders a list as a collapsable/expandable tree.
  • TreePlugin (1.7): Dynamic generation of TWiki topic trees
  • TwistyPlugin (1.2.0, $Rev: 12154$): Twisty section JavaScript library to open/close content dynamically
  • VotePlugin (1.33, $Rev: 14312 (01 Jul 2007) $): Simple way to count votes
  • WysiwygPlugin (Dakar, 12422): Translator framework for Wysiwyg editors

TIP! To test new Plugins on your installation before making them public, you may want to use one of these two approaches:

  • Method 1: Create a Production and a Test installation of TWiki. The twiki/data, twiki/templates and twiki/pub directories are shared, and the twiki/bin and twiki/lib directories are separate. Do all tests of Plugins and other new features in the Test installation. When everything works, copy the modified files over to the Production installation. This way, you can update a live TWiki installation and users won't even notice.

  • Method 2: List the Plugin under test in the DISABLEDPLUGINS variable in TWikiPreferences. Redefine the DISABLEDPLUGINS variable in the test web and do the testing there.

Creating New Plugins

With a reasonable knowledge of the Perl scripting language, you can create new Plugins or modify and extend existing ones. Basic plug-in architecture uses an Application Programming Interface (API), a set of software instructions that allow external code to interact with the main program. The TWiki Plugin API Plugins by providing a programming interface for TWiki.

Anatomy of a Plugin

A basic TWiki Plugin consists of two elements:

  • a Perl module, ex: YourPlugin.pm
  • a documentation topic, ex: YourPlugin.txt

The Perl module can be a block of code that connects with TWiki alone, or it can include other elements, like other Perl modules (including other Plugins), graphics, TWiki templates, external applications (ex: a Java applet), or just about anything else it can call.

The Plugin API handles the details of connecting your Perl module with main TWiki code. When you're familiar with the Plugin API, you're ready to develop Plugins.

TWiki Plugin API

The Application Programming Interface (API) for TWikiPlugins provides the specifications for hooking into the core TWiki code from your external Perl Plugin module. The Plugin API is new to the Production version of TWiki with the TWikiReleaseSpring2001.

The lib/TWiki/Func.pm implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.

DevALERT: If you use functions not in Func.pm, you run the risk of creating security holes. Also, your Plugin will likely break and require updating when you upgrade to a new version of TWiki.

In addition to TWiki core functions, Plugins can use predefined hooks, or call backs, listed in the lib/TWiki/Plugins/EmptyPlugin.pm module.

  • All but the initPlugin are disabled. To enable a call back, remove DISABLE_ from the function name.

  • For improve performance, enable only the functions you really need. NOTE: outsidePREHandler and insidePREHandler are particularly expensive.

Customize the DefaultPlugin

  • DefaultPlugin can handle some outdated TWiki variables, found, for example, in sites recently updated from an old version. Settings are in TWikiPreferences. You can also add your own simple custom processing rules here, though in all but very simple cases, writing a new Plugin is preferable.

Create a Plugin Module in Perl

Copy file (EmptyPlugin.pm to <name>Plugin.pm EmptyPlugin.pm contains no executable code, so it does nothing, but it's ready to be used. Customize it. Refer to the Plugin API specs for more information.

Create a Plugin Documentation Topic

The Plugin documentation topic contains usage instructions and version details. It serves the Plugin files as FileAttachments for downloading. (The doc topic is also included in the distribution package.) To create a documentation topic:

  1. Copy the Plugin topic template from http://TWiki.org/cgi-bin/view/TWiki/EmptyPlugin. To copy the text, go to the page and:
    • click Edit
    • select all in the Edit box & copy
    • Cancel the edit
    • paste & save as a text file or new topic on your site
  2. Customize the template for your Plugin; you'll probably want to post a working version on your local TWiki site.
  3. Save your topic as a text file, for use in packaging and publishing your Plugin.

OUTLINE: Doc Topic Contents
Check EmptyPlugin on TWiki.org for the latest Plugin doc topic template. Here's a quick overview of what's covered:

Syntax Rules: explanation coming up

YourPlugin Settings: Description and settings for your custom Plugin %VARIABLES%, and those required by TWiki.

Plugins Preferences work exactly like TWikiPreferences and WebPreferences: six (6) spaces and then:

    • Set EXAMPLE = got it!

How-to Instructions: Step-by-step set-up guide, user help, whatever it takes to install and run, goes here.

Test Example: Include an example of the Plugin in action: if it works, the installation was a success!

Plugin Info: Version, credits, history, requirements - entered in a form, displayed as a table. Both are automatically generated when you create or edit a page in the TWiki:Plugins web.

Package a Plugin for Distribution

A minimum Plugin release consists of a Perl module with a WikiName that ends in Plugin, ex: YourPlugin.pm, and a documentation page with the same name(YourPlugin.txt).

  1. Distribute your Plugin files in a directory structure that mirrors TWiki. If your Plugin uses additional files, include them ALL:
    • lib/TWiki/Plugins/YourPlugin.pm
    • data/TWiki/YourPlugin.txt
    • pub/TWiki/YourPlugin/uparrow.gif [a required graphic]
  2. Create a zip archive with the Plugin name (YourPlugin.zip) and add the entire directory structure from Step 1. Your archive should look like this:
    • lib/TWiki/Plugins/YourPlugin.pm
    • data/TWiki/YourPlugin.txt
    • pub/TWiki/YourPlugin/uparrow.gif

Publish a Plugin for General Use

You can release your tested, packaged Plugin to the TWiki community through the TWiki:Plugins web, where all Plugins submitted to TWiki.org are available for download and further development discussion. Publish your Plugin in three steps:

  1. Post the Plugin documentation topic in the TWiki:Plugins web:
  2. Attach the distribution zip file to the topic, ex: YourPlugin.zip.
  3. Link from the doc page to a new, blank page named after the Plugin, and ending in Dev, ex: YourPluginDev. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)

-- MikeMannix? - 26 Aug 2001


TWikiPlugins 4 - 14 Jul 2001 - Main.PeterThoeny
Line: 1 to 1
 

TWiki Plugins

Plugins allow you to extend the syntax or functionality of TWiki. ...

Line: 12 to 13
 under construction... ( check back at http://TWiki.org/cgi-bin/view/TWiki/TWikiPlugins )
Changed:
<
<
-- PeterThoeny? - 17 Feb 2001
>
>

Plugins under the hood

  • All plugin modules that exist in the lib/TWiki/Plugins directory are activated automatically unless disabled by the DISABLEDPLUGINS preferences variable in TWikiPreferences. You can optionally list the installed plugins in the INSTALLEDPLUGINS preferences variable. This is useful to define the sequence of plugin execution, or to specify other webs then the TWiki web for the plugin topics. Settings in TWikiPreferences:
    • Set INSTALLEDPLUGINS = DefaultPlugin, ...
    • Set DISABLEDPLUGINS = EmptyPlugin, ...

  • The %ACTIVATEDPLUGINS% variable shows all currently activated plugins. This variable is shown in TWikiPreferences for debug reasons.

  • Search order for plugin topics: Full web.topicname name is used if specified in INSTALLEDPLUGINS, then the TWiki web is searched, then the current web.

  • Plugin specific settings are done in individual plugin topics. Two settings are standard for each plugin:
    • One line description, used to form the bullets describing the plugins in the TextFormattingRules topic:
      • Set SHORTDESCRIPTION = Blah blah.
    • Debug plugin, output can be seen in data/debug.txt: (Se to 0 or 1)
      • Set DEBUG = 0
    • The settings can be retrieved as preferences variables like %<pluginname>_<var>%, i.e. %DEFAULTPLUGIN_SHORTDESCRIPTION% shows the description of the DefaultPlugin.

  • The %PLUGINDESCRIPTIONS% variable shows a bullet list with descriptions of all currently activated plugins. This variable is based on %<plugin>_SHORTDESCRIPTION% preferences variables of individual topics and is shown in TextFormattingRules.

-- PeterThoeny? - 14 Jul 2001


TWikiPlugins 3 - 14 Mar 2001 - Main.PeterThoeny
Line: 2 to 2
 Plugins allow you to extend the syntax or functionality of TWiki. ...
Added:
>
>
TWikiPreferences has the list of installed plugins and activated plugins.
 

How to Create a Plugin

under construction... ( check back at http://TWiki.org/cgi-bin/view/TWiki/TWikiPlugins )


TWikiPlugins 2 - 04 Mar 2001 - Main.PeterThoeny
Line: 1 to 1
Added:
>
>

TWiki Plugins

 Plugins allow you to extend the syntax or functionality of TWiki. ...
Changed:
<
<
How to Create a Plugin
>
>

How to Create a Plugin

 under construction... ( check back at http://TWiki.org/cgi-bin/view/TWiki/TWikiPlugins )
Changed:
<
<
How to Install a Plugin
>
>

How to Install a Plugin

 under construction... ( check back at http://TWiki.org/cgi-bin/view/TWiki/TWikiPlugins )

TWikiPlugins 1 - 17 Feb 2001 - Main.PeterThoeny
Line: 1 to 1
Added:
>
>
Plugins allow you to extend the syntax or functionality of TWiki. ...

How to Create a Plugin

under construction... ( check back at http://TWiki.org/cgi-bin/view/TWiki/TWikiPlugins )

How to Install a Plugin

under construction... ( check back at http://TWiki.org/cgi-bin/view/TWiki/TWikiPlugins )

-- PeterThoeny? - 17 Feb 2001


Revision 32r32 - 06 Jan 2007 - 09:49:24 - TWikiContributor
Revision 31r31 - 27 Mar 2005 - 13:14:15 - TWikiContributor
Revision 30r30 - 27 Mar 2005 - 13:14:15 - TWikiContributor
Revision 29r29 - 14 Aug 2004 - 08:58:25 - PeterThoeny?
Revision 28r28 - 08 Aug 2004 - 04:48:59 - PeterThoeny?
Revision 27r27 - 18 May 2004 - 06:49:22 - PeterThoeny?
Revision 26r26 - 15 Dec 2003 - 07:23:36 - PeterThoeny?
Revision 25r25 - 12 Dec 2003 - 07:57:00 - PeterThoeny?
Revision 24r24 - 01 Aug 2003 - 07:53:49 - PeterThoeny?
Revision 23r23 - 01 Aug 2003 - 05:37:04 - PeterThoeny?
Revision 22r22 - 28 Feb 2003 - 04:32:00 - PeterThoeny?
Revision 21r21 - 29 Jan 2003 - 07:21:00 - PeterThoeny?
Revision 20r20 - 08 Dec 2002 - 06:36:28 - PeterThoeny?
Revision 19r19 - 18 Jul 2002 - 07:14:42 - PeterThoeny?
Revision 18r18 - 03 Dec 2001 - 10:17:00 - MikeMannix?
Revision 17r17 - 28 Sep 2001 - 00:35:05 - MikeMannix?
Revision 16r16 - 18 Sep 2001 - 04:25:46 - MikeMannix?
Revision 15r15 - 16 Sep 2001 - 06:01:21 - MikeMannix?
Revision 14r14 - 15 Sep 2001 - 10:07:56 - MikeMannix?
Revision 13r13 - 14 Sep 2001 - 09:55:51 - PeterThoeny?
Revision 12r12 - 07 Sep 2001 - 10:11:02 - MikeMannix?
Revision 11r11 - 02 Sep 2001 - 08:34:34 - AndreaSterbini?
Revision 10r10 - 02 Sep 2001 - 01:11:03 - MikeMannix?
Revision 9r9 - 01 Sep 2001 - 04:04:59 - MikeMannix?
Revision 8r8 - 31 Aug 2001 - 06:05:43 - MikeMannix?
Revision 7r7 - 27 Aug 2001 - 09:19:48 - MikeMannix?
Revision 6r6 - 27 Aug 2001 - 04:30:18 - MikeMannix?
Revision 5r5 - 26 Aug 2001 - 19:28:03 - MikeMannix?
Revision 4r4 - 14 Jul 2001 - 11:09:22 - PeterThoeny?
Revision 3r3 - 14 Mar 2001 - 02:26:38 - PeterThoeny?
Revision 2r2 - 04 Mar 2001 - 09:00:17 - PeterThoeny?
Revision 1r1 - 17 Feb 2001 - 08:35:53 - PeterThoeny?
This site is powered by the TWiki collaboration platform.
All material on this collaboration platform is the property of the contributing authors.
All material marked as authored by Eben Moglen is available under the license terms CC-BY-SA version 4.
Syndicate this site RSSATOM