Difference: TWikiPlugins (9 vs. 10)

Revision 102001-09-02 - 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 (2015-06-07, $Rev: 29570 (2015-11-29) $): Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables or anywhere in topic text
  • BackupRestorePlugin (2015-01-09, $Rev: 28636 (2015-11-29) $): Administrator utility to backup, restore and upgrade a TWiki site
  • ColorPickerPlugin (2015-01-10, $Rev: 29507 (2015-11-29) $): Color picker, packaged for use in TWiki forms and TWiki applications
  • CommentPlugin (2015-01-10, $Rev: 28648 (2015-11-29) $): Quickly post comments to a page without an edit/preview/save cycle
  • DatePickerPlugin (2015-01-10, $Rev: 29510 (2015-11-29) $): Pop-up calendar with date picker, for use in TWiki forms, HTML forms and TWiki plugins
  • EditTablePlugin (2015-01-10, $Rev: 29516 (2015-11-29) $): Edit TWiki tables using edit fields, date pickers and drop down boxes
  • HeadlinesPlugin (2015-11-06, $Rev: 29650 (2015-11-29) $): Show headline news in TWiki pages based on RSS and ATOM news feeds from external sites
  • HttpsRedirectPlugin (2011-01-21, $Rev: 20293 (2011-01-21) $): Redirect authenticated users to HTTPS url.
  • InterwikiPlugin (2015-06-18, $Rev: 29526 (2015-11-29) $): Write ExternalSite:Page to link to a page on an external site based on aliases defined in a rules topic
  • JQueryPlugin (2015-01-10, $Rev: 29532 (2015-11-29) $): jQuery JavaScript library for TWiki
  • LaTeXToMathMLPlugin (2011-03-17, $Rev: 20767 (2011-03-17) $): Display LaTeX-like equations in-line using MathML
  • LatexModePlugin (3.71, $Rev: 16926 (12 Dec 2008) $): Enables LaTeX markup (mathematics and more) in TWiki topics
  • PreferencesPlugin (2015-01-14, $Rev: 29550 (2015-11-29) $): Allows editing of preferences using fields predefined in a form
  • SetGetPlugin (2015-07-09, $Rev: 29564 (2015-11-29) $): Set and get variables and JSON objects in topics, optionally persistently across topic views
  • SlideShowPlugin (2015-01-14, $Rev: 29566 (2015-11-29) $): Create web based presentations based on topics with headings.
  • SmiliesPlugin (2015-02-16, $Rev: 29568 (2015-11-29) $): Render smilies as icons, like  :-)  as smile or  :eek:  as eek!
  • TablePlugin (2015-02-16, $Rev: 29580 (2015-11-29) $): Control attributes of tables and sorting of table columns
  • TagMePlugin (2015-02-16, $Rev: 29582 (2015-11-29) $): Tag wiki content collectively or authoritatively to find content by keywords
  • TinyMCEPlugin (2015-02-16, $Rev: 29584 (2015-11-29) $): Integration of the Tiny MCE WYSIWYG Editor
  • TwistyPlugin (2015-04-28, $Rev: 29600 (2015-11-29) $): Twisty section JavaScript library to open/close content dynamically
  • WatchlistPlugin (2015-01-15, $Rev: 28820 (2015-11-29) $): Watch topics of interest and get notified of changes by e-mail
  • WysiwygPlugin (2015-02-16, $Rev: 29604 (2015-11-29) $): 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.
>
>
 
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
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.TWikiPlugins.