Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
TWiki Plugins | ||||||||
Line: 30 to 30 | ||||||||
Installing Plugins | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | The TWiki:Plugins web on TWiki.org is the repository for TWiki plugins. Each plugin such as the TWiki:Plugins.ChartPlugin has a topic with user guide, step-by-step installation instructions, a detailed description of any special requirements, version details, and a working example for testing. There's usually a number of other related topics, such as a developers page, and an appraisal page. | |||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | Most TWiki plugins are packaged so that they can be installed and upgraded using the configure script. To install a plugin, open up the Extensions tab, follow the "Find More Extensions" link, and follow the instructions. A plugin needs to be enabled after installation. | |||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | Plugins can also be installed manually: Download the zip or tgz package of a TWiki plugin from the TWiki.org repository, upload it to the TWiki server, unpack it, and follow the installation instructions found in the plugin topic on TWiki.org.
Special Requirements: 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, and templates. You should be able to find detailed instructions in the plugin's documentation. Use the package manager of the server OS (yum , apt-get , rpm , etc) to install dependent libraries.
If available, install CPAN (Comprehensive Perl Archive Network) libraries with the OS package manager. For example, to install IO::Socket::SSL on Fedora/RedHat/CentOS, run yum install perl-IO-Socket-SSL . CPAN modules can also be installed natively, see TWiki:TWiki.HowToInstallCpanModules. | |||||||
On-Site Pretesting | ||||||||
Changed: | ||||||||
< < | 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 satisfied that it won't compromise your main installation, you can install it there as well. | |||||||
> > | If you have a mission critical TWiki installation and you are concerned about installing new plugins, you can test new plugins before making them available by creating a second test TWiki installation, and test the plugin there. It is also possible to configure this test TWiki to use the live data. You can allow selected users access to the test area. Once you are satisfied that it won't compromise your primary installation, you can install it there as well. | |||||||
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. | ||||||||
Line: 59 to 63 | ||||||||
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: | ||||||||
Added: | ||||||||
> > | ||||||||
Enabling/Disabling PluginsPlugins can be enabled and disabled with the configure script in the Plugins section. An installed plugin needs to be enabled before it can be used. | ||||||||
Line: 177 to 182 | ||||||||
Creating Plugins | ||||||||
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 provides the programming interface for TWiki. | |||||||
> > | 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 provides the programming interface for TWiki. Understanding how TWiki is working at high level is beneficial for plugin development. | |||||||
Anatomy of a Plugin |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
TWiki Plugins | ||||||||
Line: 59 to 59 | ||||||||
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: | ||||||||
< < | Enabling Plugins | |||||||
> > | Enabling/Disabling Plugins | |||||||
Changed: | ||||||||
< < | Plugins can be enabled and disabled with the configure script. An installed plugin needs to be enabled before it can be used. | |||||||
> > | Plugins can be enabled and disabled with the configure script in the Plugins section. An installed plugin needs to be enabled before it can be used. | |||||||
Plugin Evaluation Order |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
TWiki Plugins | ||||||||
Line: 67 to 67 | ||||||||
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 spreadsheet CALCs. This can be done with {PluginsOrder} in the plugins section of configure. | ||||||||
Added: | ||||||||
> > | ||||||||
Plugin-Specific Settings | ||||||||
Changed: | ||||||||
< < | Some plugins are configured with plugin preferences variables, newer plugins with configure variables. | |||||||
> > | Plugins can be configured with 1. preferences settings and/or 2. with configure settings. Older plugins use plugin preferences settings defined in the plugin topic, which is no longer recommended. | |||||||
Changed: | ||||||||
< < | Configure variables are accessible though the configure interface. | |||||||
> > | 1. Use preferences settings: | |||||||
Changed: | ||||||||
< < | Plugin preferences variables are defined in the plugin topic and can be overloaded. The SHORTDESCRIPTION preferences variable is always present, it is needed for the TWiki:Plugins repository on twiki.org. Example preferences variable defined in the TablePlugin topic: | |||||||
> > | Adinistrators can set plugin-specific settings in the local site preferences at Main.TWikiPreferences and users can overload them at the web level and page level. This approach is recommended if users should be able to overload settings. For security this is not recommended for system settings, such as a path to an executable. By convention, preferences setting names start with the plugin name in all caps, and an underscore. For example, to set the cache refresh period of the TWiki:Plugins.VarCachePlugin, add this bullet in Main.TWikiPreferences | |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < | Preferences variables of active plugins can be retrieved anywhere in TWiki with %<pluginname>_<var>% , such as %TABLEPLUGIN_SHORTDESCRIPTION% . They can also be redefined with the %<pluginname>_<var>% setting at a lower level in the Main.TWikiPreferences or at the web level. For an easier upgrade it is recommended to customize plugin preferences variables in Main.TWikiPreferences only. | |||||||
> > | Preferences settings that have been defined in Main.TWikiPreferences can be retrieved anywhere in TWiki with %<pluginname>_<setting>% , such as %VARCACHEPLUGIN_REFRESH% .
To learn how this is done, use the TWiki:Plugins.VarCachePlugin documentation and Perl plugin code as a reference.
2. Use configure settings:
The administrator can set plugin settings in the configure interface. Recommended if only site administrators should be able to change settings. Chose this option to set sensitive or dangerous system settings, such as passwords or path to executables. To define plugin-specific configure settings,
our $NO_PREFS_IN_TOPIC = 1; | |||||||
Listing Active Plugins | ||||||||
Line: 112 to 136 | ||||||||
In addition to TWiki core functions, plugins can use predefined hooks, or callbacks, as described in the lib/TWiki/Plugins/EmptyPlugin.pm module. | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < | TWiki:Codev/StepByStepRenderingOrder helps you decide which rendering handler to use. | |||||||
> > | TWiki:Codev.StepByStepRenderingOrder helps you decide which rendering handler to use. | |||||||
Hints on Writing Fast Plugins | ||||||||
Line: 124 to 148 | ||||||||
eval { require IPC::Run } return "<font color=\"red\">SamplePlugin: Can't load required modules ($@)</font>" if $@;
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Version Detection | ||||||||
Line: 207 to 231 | ||||||||
Plugin Settings: <Description and settings for custom plugin %VARIABLES%, and those required by TWiki.>" | ||||||||
Deleted: | ||||||||
< < |
| |||||||
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: 291 to 312 | ||||||||
Structure of a
The | ||||||||
Changed: | ||||||||
< < | # ---+ BathPlugin | |||||||
> > | # ---+ Extensions # ---++ BathPlugin | |||||||
# This plugin senses the level of water in your bath, and ensures the plug # is not removed while the water is still warm. | ||||||||
Line: 316 to 338 | ||||||||
} | ||||||||
Changed: | ||||||||
< < | The config.spec file is read by configure , which then writes LocalSite.cfg with the values chosen by the local site admin. | |||||||
> > | The Config.spec file is read by configure , which then writes LocalSite.cfg with the values chosen by the local site admin. | |||||||
A range of types are available for use in Config.spec files: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
TWiki Plugins | ||||||||
Line: 190 to 190 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 289 to 289 | ||||||||
Config.spec files are read during TWiki configuration. Once a Config.spec has defined a configuration item, it is available for edit through the standard configure interface. Config.spec files are stored in the 'plugin directory' e.g. lib/TWiki/Plugins/BathPlugin/Config.spec .
Structure of a | ||||||||
Changed: | ||||||||
< < | The Config.spec file for a plugin starts with the plugin announcing what it is: | |||||||
> > | The Config.spec file for an extension starts with the extension announcing what it is: | |||||||
# ---+ BathPlugin # This plugin senses the level of water in your bath, and ensures the plug | ||||||||
Line: 303 to 303 | ||||||||
# *NUMBER* # Enter the chain length in cm | ||||||||
Changed: | ||||||||
< < | $TWiki::cfg{BathPlugin}{ChainLength} = '30'; | |||||||
> > | $TWiki::cfg{BathPlugin}{ChainLength} = 30; | |||||||
# *BOOLEAN EXPERT* | ||||||||
Changed: | ||||||||
< < | # Turn this option off to disable the water temperature alarm $TWiki::cfg{BathPlugin}{TempSensorEnabled} = '1'; | |||||||
> > | # Set this option to 0 to disable the water temperature alarm $TWiki::cfg{BathPlugin}{TempSensorEnabled} = 1; | |||||||
Changed: | ||||||||
< < | The type (e.g. **SELECT** ) tells configure to how to prompt for the value. It also tells configure how to do some basic checking on the value you actually enter. All the comments between the type and the configuration item are taken as part of the description. The configuration item itself defines the default value for the configuration item. The above spec defines the configuration items $TWiki::cfg{BathPlugin}{PlugType} , $TWiki::cfg{BathPlugin}{ChainLength} , and $TWiki::cfg{BathPlugin}{TempSensorEnabled} for use in your plugin. For example, | |||||||
> > | The type (e.g. **SELECT** ) tells configure to how to prompt for the value. It also tells configure how to do some basic checking on the value you actually enter. All the comments between the type and the configuration item are taken as part of the description. The configuration item itself defines the default value for the configuration item. The above spec defines the configuration items $TWiki::cfg{BathPlugin}{PlugType} , $TWiki::cfg{BathPlugin}{ChainLength} , and $TWiki::cfg{BathPlugin}{TempSensorEnabled} for use in your plugin. For example, | |||||||
if( $TWiki::cfg{BathPlugin}{TempSensorEnabled} && $curTemperature > 50 ) { die "The bathwater is too hot for comfort"; } | ||||||||
Changed: | ||||||||
< < | The config.spec file is read by configure, and configure then writes LocalSite.cfg with the values chosen by the local site admin. | |||||||
> > | The config.spec file is read by configure , which then writes LocalSite.cfg with the values chosen by the local site admin. | |||||||
A range of types are available for use in Config.spec files: | ||||||||
Line: 342 to 342 | ||||||||
See lib/TWiki.spec for many more examples. | ||||||||
Changed: | ||||||||
< < | Config.spec files are also used for other (non-plugin) extensions. in this case they are stored under the Contrib directory instead of the Plugins directory. | |||||||
> > | Config.spec files for non-plugin extensions are stored under the Contrib directory instead of the Plugins directory.
Note that from TWiki 5.0 onwards, CGI scripts (in the TWiki bin directory) provided by extensions must also have an entry in the Config.spec file. This entry looks like this (example taken from PublishContrib)
# **PERL H** # Bin script registration - do not modify $TWiki::cfg{SwitchBoard}{publish} = [ "TWiki::Contrib::Publish", "publish", { publishing => 1 } ]; PERL specifies a perl data structure, and H a hidden setting (it won't appear in configure ). The first field of the data value specifies the class where the function that implements the script can be found. The second field specifies the name of the function, which must be the same as the name of the script. The third parameter is a hash of initial context settings for the script. | |||||||
TWiki:TWiki/SpecifyingConfigurationItemsForExtensions has supplemental documentation on configure settings. |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
TWiki Plugins | ||||||||
Changed: | ||||||||
< < | Add functionality to TWiki with readily available Plugins; create Plugins based on APIs | |||||||
> > | Add functionality to TWiki with readily available plugins; create plugins based on APIs | |||||||
On this page:
Overview | ||||||||
Changed: | ||||||||
< < | You can add Plugins to extend TWiki functionality, without altering the core 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: | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
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. | |||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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. | |||||||
Relevant links on TWiki.org:
| ||||||||
Line: 30 to 30 | ||||||||
Installing Plugins | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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. | |||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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: | ||||||||
< < | 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. | |||||||
> > | 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: | ||||||||
< < | 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 satisfied that it won't compromise your main installation, you can install it there as well. | |||||||
> > | 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 satisfied 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 | ||||||||
Changed: | ||||||||
< < | 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 | |||||||
> > | 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: | ||||||||
< < | 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. | |||||||
> > | 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,
| ||||||||
Line: 57 to 57 | ||||||||
Managing Installed Plugins | ||||||||
Changed: | ||||||||
< < | 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: | |||||||
> > | 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: | |||||||
Enabling Plugins | ||||||||
Changed: | ||||||||
< < | Plugins can be enabled and disabled with the configure script. An installed Plugin needs to be enabled before it can be used. | |||||||
> > | Plugins can be enabled and disabled with the configure script. An installed plugin needs to be enabled before it can be used. | |||||||
Plugin Evaluation Order | ||||||||
Changed: | ||||||||
< < | 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 spreadsheet CALCs. This can be done with {PluginsOrder} in the Plugins section of configure. | |||||||
> > | 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 spreadsheet CALCs. This can be done with {PluginsOrder} in the plugins section of configure. | |||||||
Plugin-Specific Settings | ||||||||
Changed: | ||||||||
< < | 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:
%<pluginname>_<var>% . For example, %RUBBERPLUGIN_SETTING% shows the value of SETTING in the RubberPlugin topic. | |||||||
> > | Some plugins are configured with plugin preferences variables, newer plugins with configure variables.
Configure variables are accessible though the configure interface.
Plugin preferences variables are defined in the plugin topic and can be overloaded. The SHORTDESCRIPTION preferences variable is always present, it is needed for the TWiki:Plugins repository on twiki.org. Example preferences variable defined in the TablePlugin topic:
%<pluginname>_<var>% , such as %TABLEPLUGIN_SHORTDESCRIPTION% . They can also be redefined with the %<pluginname>_<var>% setting at a lower level in the Main.TWikiPreferences or at the web level. For an easier upgrade it is recommended to customize plugin preferences variables in Main.TWikiPreferences only. | |||||||
Listing Active Plugins | ||||||||
Changed: | ||||||||
< < | Plugin status variables let you list all active Plugins wherever needed. | |||||||
> > | Plugin status variables let you list all active plugins wherever needed. | |||||||
Changed: | ||||||||
< < | This site is running TWiki version TWiki-6.0.0, Mon, 14 Oct 2013, build 26523, Plugin API version | |||||||
> > | This site is running TWiki version TWiki-6.0.0, Mon, 14 Oct 2013, build 26523, plugin API version | |||||||
6.00
| ||||||||
Changed: | ||||||||
< < | On this TWiki site, the enabled Plugins are: SpreadSheetPlugin, BackupRestorePlugin, ColorPickerPlugin, CommentPlugin, DatePickerPlugin, EditTablePlugin, HeadlinesPlugin, InterwikiPlugin, JQueryPlugin, PreferencesPlugin, SetGetPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TagMePlugin, TinyMCEPlugin, TwistyPlugin, WysiwygPlugin. | |||||||
> > | On this TWiki site, the enabled plugins are: SpreadSheetPlugin, BackupRestorePlugin, ColorPickerPlugin, CommentPlugin, DatePickerPlugin, EditTablePlugin, HeadlinesPlugin, InterwikiPlugin, JQueryPlugin, PreferencesPlugin, SetGetPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TagMePlugin, TinyMCEPlugin, TwistyPlugin, WysiwygPlugin. | |||||||
| ||||||||
Line: 94 to 100 | ||||||||
The TWiki Plugin API | ||||||||
Changed: | ||||||||
< < | The Application Programming Interface (API) for TWiki Plugins provides the specifications for hooking into the core TWiki code from your external Perl Plugin module. | |||||||
> > | 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 TWikiFuncDotPm module (lib/TWiki/Func.pm ) describes all the interfaces available to Plugins. Plugins should only use the interfaces described 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: | ||||||||
< < | 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. | |||||||
> > | 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 callbacks, as described 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. | |||||||
| ||||||||
Line: 113 to 119 | ||||||||
Hints on Writing Fast Plugins | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 124 to 130 | ||||||||
Version Detection | ||||||||
Changed: | ||||||||
< < | To eliminate the incompatibility problems that are bound to arise from active open Plugin development, a Plugin versioning system is provided for automatic compatibility checking. | |||||||
> > | To eliminate the incompatibility problems that are bound to arise from active open plugin development, a plugin versioning system is provided for automatic compatibility checking. | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Security | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Creating Plugins | ||||||||
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. | |||||||
> > | 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 provides the programming interface for TWiki. | |||||||
Anatomy of a Plugin | ||||||||
Changed: | ||||||||
< < | A (very) basic TWiki Plugin consists of two files: | |||||||
> > | A (very) basic TWiki plugin consists of two files: | |||||||
| ||||||||
Changed: | ||||||||
< < | The Perl module can be a block of code that talks to 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 Perl module can be a block of code that talks to 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. | |||||||
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. | ||||||||
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. | |||||||
> > | 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: | ||||||||
< < | The TWiki::Plugins.BuildContrib module provides a lot of support for plugins development, including a plugin creator, automatic publishing support, and automatic installation script writer. If you plan on writing more than one plugin, you probably need it. | |||||||
> > | The TWiki:Plugins.BuildContrib module provides a lot of support for plugins development, including a plugin creator, automatic publishing support, and automatic installation script writer. If you plan on writing more than one plugin, you probably need it. | |||||||
Creating the Perl ModuleCopy filelib/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. | ||||||||
Changed: | ||||||||
< < | 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: | |||||||
> > | 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(); | ||||||||
Line: 175 to 182 | ||||||||
Writing the Documentation Topic | ||||||||
Changed: | ||||||||
< < | 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: | |||||||
> > | 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: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
OUTLINE: Doc Topic Contents | ||||||||
Changed: | ||||||||
< < | Check the Plugins web 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: | ||||||||
< < | 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!>" | |||||||
> > | 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 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.>" | |||||||
| ||||||||
Line: 211 to 218 | ||||||||
Packaging for Distribution | ||||||||
Changed: | ||||||||
< < | 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! | |||||||
> > | 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! | |||||||
Changed: | ||||||||
< < | 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 ). | |||||||
> > | 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: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 227 to 234 | ||||||||
Measuring and Improving the Plugin Performance | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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.
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. | |||||||
> > | 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. | |||||||
Changed: | ||||||||
< < | Publish your Plugin by following these steps:
| |||||||
> > | Publish your plugin by following these steps:
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < | Once you have done the above steps once, you can use the BuildContrib to upload updates to your Plugin. | |||||||
> > | Once you have done the above steps once, you can use the BuildContrib to upload updates to your plugin. | |||||||
Changed: | ||||||||
< < | Thank you very much for sharing your Plugin with the TWiki community | |||||||
> > | Thank you very much for sharing your plugin with the TWiki community | |||||||
Recommended Storage of Plugin Specific Data | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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 | ||||||||
Changed: | ||||||||
< < | You can create a Plugin "work area" using the TWiki::Func::getWorkArea() function, which gives you a persistent 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. | |||||||
> > | You can create a plugin "work area" using the TWiki::Func::getWorkArea() function, which gives you a persistent 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 | ||||||||
Line: 263 to 270 | ||||||||
Recommendation for file name:
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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. | |||||||
Changed: | ||||||||
< < | Recommendation for file names in Plugin attachment area: | |||||||
> > | Recommendation for file names in plugin attachment area: | |||||||
| ||||||||
Line: 337 to 344 | ||||||||
Config.spec files are also used for other (non-plugin) extensions. in this case they are stored under the Contrib directory instead of the Plugins directory. | ||||||||
Added: | ||||||||
> > | TWiki:TWiki/SpecifyingConfigurationItemsForExtensions has supplemental documentation on configure settings. | |||||||
Maintaining PluginsDiscussions and Feedback on Plugins | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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 | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | The plugin interface (TWikiFuncDotPm functions and plugin handlers) evolve over time. TWiki introduces new API functions to address the needs of plugin authors. Plugins using unofficial TWiki internal functions may no longer work on a TWiki upgrade. | |||||||
Changed: | ||||||||
< < | 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 fulfilled if Plugins are maintained in a compatible manner. | |||||||
> > | 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 fulfilled if plugins are maintained in a compatible manner. | |||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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.
Here is an example; the TWiki:TWiki.TWikiPluginsSupplement#MaintainPlugins has more details.
if( $TWiki::Plugins::VERSION >= 1.1 ) { @webs = TWiki::Func::getListOfWebs( 'user,public' ); } else { @webs = TWiki::Func::getPublicWebList( ); } | |||||||
Handling deprecated functions | ||||||||
Line: 372 to 390 | ||||||||
Related Topics: DeveloperDocumentationCategory, AdminDocumentationCategory, TWiki:TWiki.TWikiPluginsSupplement | ||||||||
Added: | ||||||||
> > | -- Contributors: TWiki:Main.PeterThoeny, TWiki:Main.AndreaSterbini, TWiki:Main.MikeMannix, TWiki:Main.CrawfordCurrie, TWiki:Main.ArthurClemens, TWiki:Main.WillNorris |
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Deleted: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | TWiki Plugins | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | TWiki Plugins | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Add functionality to TWiki with readily available Plugins; create Plugins based on APIs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OverviewYou can add Plugins to extend TWiki functionality, without altering the core code. A plug-in approach lets you: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 38 to 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
On-Site Pretesting | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | 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 satisfied that it won't compromise your main installation, you can install it there as well. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | 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, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | 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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 64 to 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Plugin Evaluation Order | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | 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 spreadsheet CALCs. This can be done with {PluginsOrder} in the Plugins section of configure. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Plugin-Specific Settings | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 76 to 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Plugin status variables let you list all active Plugins wherever needed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | This site is running TWiki version TWiki-6.0.0, Mon, 14 Oct 2013, build 26523, Plugin API version 6.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
On this TWiki site, the enabled Plugins are: SpreadSheetPlugin, BackupRestorePlugin, ColorPickerPlugin, CommentPlugin, DatePickerPlugin, EditTablePlugin, HeadlinesPlugin, InterwikiPlugin, JQueryPlugin, PreferencesPlugin, SetGetPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TagMePlugin, TinyMCEPlugin, TwistyPlugin, WysiwygPlugin.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Plugin | Errors |
---|---|
SpreadSheetPlugin | none |
BackupRestorePlugin | none |
ColorPickerPlugin | none |
CommentPlugin | none |
DatePickerPlugin | none |
EditTablePlugin | none |
HeadlinesPlugin | none |
InterwikiPlugin | none |
JQueryPlugin | none |
PreferencesPlugin | none |
SetGetPlugin | none |
SlideShowPlugin | none |
SmiliesPlugin | none |
TablePlugin | none |
TagMePlugin | none |
TinyMCEPlugin | none |
TwistyPlugin | none |
WysiwygPlugin | none |
Handler | Plugins |
---|---|
afterEditHandler | WysiwygPlugin |
afterRenameHandler | TagMePlugin |
afterSaveHandler | TagMePlugin |
beforeCommonTagsHandler | EditTablePlugin PreferencesPlugin TwistyPlugin WysiwygPlugin |
beforeEditHandler | TinyMCEPlugin WysiwygPlugin |
beforeMergeHandler | WysiwygPlugin |
beforeSaveHandler | CommentPlugin WysiwygPlugin |
commonTagsHandler | SpreadSheetPlugin BackupRestorePlugin CommentPlugin EditTablePlugin HeadlinesPlugin JQueryPlugin SlideShowPlugin SmiliesPlugin |
initPlugin | SpreadSheetPlugin BackupRestorePlugin ColorPickerPlugin CommentPlugin DatePickerPlugin EditTablePlugin HeadlinesPlugin InterwikiPlugin JQueryPlugin PreferencesPlugin SetGetPlugin SlideShowPlugin SmiliesPlugin TablePlugin TagMePlugin TinyMCEPlugin TwistyPlugin WysiwygPlugin |
modifyHeaderHandler | WysiwygPlugin |
postRenderingHandler | EditTablePlugin PreferencesPlugin WysiwygPlugin |
preRenderingHandler | InterwikiPlugin SmiliesPlugin TablePlugin |
eval
block like this:eval { require IPC::Run }
return "<font color=\"red\">SamplePlugin: Can't load required modules ($@)</font>" if $@;
lib/TWiki/Plugins/BathPlugin/
.
$NO_PREFS_IN_TOPIC
if you possibly can, as that will stop TWiki from reading the plugin topic for every page. Use Config.spec instead.
$VERSION='0.000'
variable, beginning at 1.000
.
$VERSION
variable. This should be an integer, or a subversion version id.
initPlugin
handler should check all dependencies and return TRUE if the initialization is OK or FALSE if something went wrong. initPlugin
handler).
initPlugin
handler should check all dependencies and return 1 if the initialization is OK or 0 if something went wrong. initPlugin
handler).
$TWiki::Plugins::VERSION
in the TWiki::Plugins
module contains the TWiki Plugin API version, currently 6.00. %PLUGINVERSION{}%
variable to query the Plugin API version or the version of installed Plugins.
MyFirstPlugin.pm
MyFirstPlugin.txt
MyFirstPlugin.pm
MyFirstPlugin.txt
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.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.MyFirstPlugin
, press enter and create the new topic
data/TWiki/MyFirstPlugin.txt
pub/TWiki/MyFirstPlugin/uparrow.gif
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.TWiki::Func::getWorkArea()
function, which gives you a persistent 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._Main_roundedge-ul.gif
configure
configure
rather than trying to use TWiki preferences variables. These extensions use Config.spec
files to publish their configuration requirements.
Config.spec
files are read during TWiki configuration. Once a Config.spec
has defined a configuration item, it is available for edit through the standard configure
interface. Config.spec
files are stored in the 'plugin directory' e.g. lib/TWiki/Plugins/BathPlugin/Config.spec
.
Config.spec
file Config.spec
file for a plugin starts with the plugin announcing what it is:
# ---+ BathPlugin # This plugin senses the level of water in your bath, and ensures the plug # is not removed while the water is still warm.This is followed by one or more configuration items. Each configuration item has a type, a description and a default. For example:
# **SELECT Plastic,Rubber,Metal** # Select the plug type $TWiki::cfg{BathPlugin}{PlugType} = 'Plastic'; # **NUMBER** # Enter the chain length in cm $TWiki::cfg{BathPlugin}{ChainLength} = '30'; # **BOOLEAN EXPERT** # Turn this option off to disable the water temperature alarm $TWiki::cfg{BathPlugin}{TempSensorEnabled} = '1';The type (e.g.
**SELECT**
) tells configure
to how to prompt for the value. It also tells configure how to do some basic checking on the value you actually enter. All the comments between the type and the configuration item are taken as part of the description. The configuration item itself defines the default value for the configuration item. The above spec defines the configuration items $TWiki::cfg{BathPlugin}{PlugType}
, $TWiki::cfg{BathPlugin}{ChainLength}
, and $TWiki::cfg{BathPlugin}{TempSensorEnabled}
for use in your plugin. For example,
if( $TWiki::cfg{BathPlugin}{TempSensorEnabled} && $curTemperature > 50 ) { die "The bathwater is too hot for comfort"; }The config.spec file is read by configure, and
configure
then writes LocalSite.cfg
with the values chosen by the local site admin.
A range of types are available for use in Config.spec
files:
BOOLEAN | A true/false value, represented as a checkbox |
COMMAND length | A shell command |
LANGUAGE | A language (selected from {LocalesDir} |
NUMBER | A number |
OCTAL | An octal number |
PASSWORD length | A password (input is hidden) |
PATH length | A file path |
PERL | A perl structure, consisting of arrays and hashes |
REGEX length | A perl regular expression |
SELECT choices | Pick one of a range of choices |
SELECTCLASS root | Select a perl package (class) |
STRING length | A string |
URL length | A url |
URLPATH length | A relative URL path |
EXPERT | means this an expert option |
M | means the setting is mandatory (may not be empty) |
H | means the option is not visible in configure |
lib/TWiki.spec
for many more examples.
Config.spec
files are also used for other (non-plugin) extensions. in this case they are stored under the Contrib
directory instead of the Plugins
directory.Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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: TWiki:TWiki.TWikiPluginsSupplement on TWiki.org has supplemental documentation on TWiki Plugins. | |||||||
> > | Relevant links on TWiki.org:
| |||||||
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: | ||||||||
< < | 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.) | |||||||
> > | 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:
| |||||||
> > | 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:
%<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:
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Security |
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
On this page:
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: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | 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:
SomePlugin ), there's a separate development page.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | 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:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | 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://office.vtc365.com/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: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | 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: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Listing Active Plugins | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Plugin status variables let you list all active Plugins wherever needed. There are two list formats:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Plugin status variables let you list all active Plugins wherever needed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | DEMO: Automatically List Active Plugins Using Variables | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
On this TWiki site, the enabled Plugins are: SpreadSheetPlugin, BackupRestorePlugin, ColorPickerPlugin, CommentPlugin, DatePickerPlugin, EditTablePlugin, HeadlinesPlugin, InterwikiPlugin, JQueryPlugin, PreferencesPlugin, SetGetPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TagMePlugin, TinyMCEPlugin, TwistyPlugin, WysiwygPlugin. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | Using %ACTIVATEDPLUGINS% :On this TWiki site, the active Plugins are: SpreadSheetPlugin, BackupRestorePlugin, ColorPickerPlugin, CommentPlugin, DatePickerPlugin, EditTablePlugin, HeadlinesPlugin, InterwikiPlugin, JQueryPlugin, PreferencesPlugin, SetGetPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TagMePlugin, TinyMCEPlugin, TwistyPlugin, WysiwygPlugin. Using % :You can use any of these active TWiki Plugins: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
|
Plugin | Errors |
---|---|
SpreadSheetPlugin | none |
BackupRestorePlugin | none |
ColorPickerPlugin | none |
CommentPlugin | none |
DatePickerPlugin | none |
EditTablePlugin | none |
HeadlinesPlugin | none |
InterwikiPlugin | none |
JQueryPlugin | none |
PreferencesPlugin | none |
SetGetPlugin | none |
SlideShowPlugin | none |
SmiliesPlugin | none |
TablePlugin | none |
TagMePlugin | none |
TinyMCEPlugin | none |
TwistyPlugin | none |
WysiwygPlugin | none |
Handler | Plugins |
---|---|
afterEditHandler | WysiwygPlugin |
afterRenameHandler | TagMePlugin |
afterSaveHandler | TagMePlugin |
beforeCommonTagsHandler | EditTablePlugin PreferencesPlugin TwistyPlugin WysiwygPlugin |
beforeEditHandler | TinyMCEPlugin WysiwygPlugin |
beforeMergeHandler | WysiwygPlugin |
beforeSaveHandler | CommentPlugin WysiwygPlugin |
commonTagsHandler | SpreadSheetPlugin BackupRestorePlugin CommentPlugin EditTablePlugin HeadlinesPlugin JQueryPlugin SlideShowPlugin SmiliesPlugin |
initPlugin | SpreadSheetPlugin BackupRestorePlugin ColorPickerPlugin CommentPlugin DatePickerPlugin EditTablePlugin HeadlinesPlugin InterwikiPlugin JQueryPlugin PreferencesPlugin SetGetPlugin SlideShowPlugin SmiliesPlugin TablePlugin TagMePlugin TinyMCEPlugin TwistyPlugin WysiwygPlugin |
modifyHeaderHandler | WysiwygPlugin |
postRenderingHandler | EditTablePlugin PreferencesPlugin WysiwygPlugin |
preRenderingHandler | InterwikiPlugin SmiliesPlugin TablePlugin |
lib/TWiki/Func.pm
) implements ALL official Plugin functions. Plugins should ONLY use functions published in this module.lib/TWiki/Func.pm
) describes all the interfaces available to Plugins. Plugins should only use the interfaces described in this module.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.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.lib/TWiki/Plugins/EmptyPlugin.pm
module.lib/TWiki/Plugins/EmptyPlugin.pm
module.DISABLE_
from the function name.
outsidePREHandler
and insidePREHandler
are particularly expensive.
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]]
eval
block like:eval
block like this:eval { require IPC::Run }
return "<font color=\"red\">SamplePlugin: Can't load required modules ($@)</font>" if $@;
initPlugin
handler).
$TWiki::Plugins::VERSION
in the TWiki::Plugins
module contains the TWiki Plugin API version, currently 6.00.
%PLUGINVERSION{}%
variable to query the Plugin API version or the version of installed Plugins.
%TWiki::cfg
hash than adding it as preferences in the Plugin topic MyFirstPlugin
, press enter and create the new topic
OUTLINE: Doc Topic Contents
Plugin
, ex: MyFirstPlugin.pm
, and a documentation page with the same name(MyFirstPlugin.txt
).Plugin
, ex: MyFirstPlugin.pm
, and a documentation page with the same name(MyFirstPlugin.txt
).lib/TWiki/Plugins/MyFirstPlugin.pm
data/TWiki/MyFirstPlugin.txt
pub/TWiki/MyFirstPlugin/uparrow.gif
[a required graphic]
MyFirstPlugin
MyFirstPlugin.zip
Dev
, ex: MyFirstPluginDev
. This is the discussion page for future development. (User support for Plugins is handled in TWiki:Support.)
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.
TWiki::Func::saveAttachment()
function to store the data.
Recommendation for file name: _FooBarPlugin_img123.gif
TWiki::Func::saveAttachment()
function to store the data.
Recommendation for file names in Plugin attachment area: _Main_roundedge-ul.gif
Dev
, such as MyFirstPluginDev
. The Plugin development topic is a great resource to discuss feature enhancements and to get feedback from the TWiki community.
pubdir/Installweb/FooBarPlugin
Installweb
refers to the name of the web where the Plugin is installed
%PUBURL%/Installweb/FooBarPlugin
_any_name.ext
getPubDir()
to get the attachment root directory
getUrlHost()
and getPubUrlPath()
to build the URL in case you create content for the browser
$installWeb
to get the name of the web where the Plugin is installed
pubdir/Webname/TopicName
%PUBURL%/Webname/TopicName
_FooBarPlugin_any_name.ext
getPubDir()
to get the attachment root directory
getUrlHost()
and getPubUrlPath()
to build the URL in case you create content for the browser
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:TWiki::Plugins
before 1.1 will still call the handler as required.Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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. | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
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 |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 20 to 20 | ||||||||
TWiki comes with a set of Plugins as part of the standard installation.
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 59 to 59 | ||||||||
| ||||||||
Added: | ||||||||
> > | Checking that Plugins are Working on a Live ServerInstalledPlugins 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 PerformanceThe 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://office.vtc365.com/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: | ||||||||
> > |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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.>" | |||||||
| ||||||||
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: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
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
Recommended Storage of Plugin DataPlugins 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 DataIn 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.
Where to Store Data for Topics using the PluginIn case the Plugin generates data which is specific to a topic, store it in the topic's attachment directory.
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 |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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: | ||||||||
< < |
| |||||||
> > |
| |||||||
Installing Plugins | ||||||||
Line: 55 to 59 | ||||||||
| ||||||||
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://office.vtc365.com/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://office.vtc365.com/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 | ||||||||
| ||||||||
Added: | ||||||||
> > | Most Plugins use either the commonTagsHandler or startRenderingHandler for rendering tasks:
Hints on Writing Fast Plugins
| |||||||
Plugin Version DetectionTo eliminate the incompatibility problems bound to arise from active open Plugin development, a Plugin versioning system and an APIGetVersion detection routine are provided for automatic compatibility checking. | ||||||||
Line: 221 to 240 | ||||||||
| ||||||||
Changed: | ||||||||
< < | -- PeterThoeny - 29 Jan 2003 | |||||||
> > | -- PeterThoeny - 11 Dec 2003 | |||||||
-- MikeMannix - 03 Dec 2001 |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 55 to 55 | ||||||||
| ||||||||
Added: | ||||||||
> > | A Note on PerformanceThe 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 PluginsWhen 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. |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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: | ||||||||
< < |
| |||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
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 TopicThe 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: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
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: | ||||||||
< < |
| |||||||
> > | 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.>" | |||||||
> > |
| |||||||
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 | ||||||||
| ||||||||
Changed: | ||||||||
< < | -- PeterThoeny - 14 Sep 2001 | |||||||
> > | -- PeterThoeny - 29 Jan 2003 | |||||||
-- MikeMannix - 03 Dec 2001 |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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. | |||||||
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: | ||||||||
< < |
| |||||||
Predefined HooksIn addition to TWiki core functions, Plugins can use predefined hooks, or call backs, listed in thelib/TWiki/Plugins/EmptyPlugin.pm module. | ||||||||
Added: | ||||||||
> > |
| |||||||
Plugin Version Detection |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 53 to 53 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Managing Plugins |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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:>" | |||||||
> > |
| |||||||
| ||||||||
Line: 206 to 206 | ||||||||
| ||||||||
Deleted: | ||||||||
< < | -- MikeMannix - 01 Sep 2001 | |||||||
-- PeterThoeny - 14 Sep 2001 | ||||||||
Added: | ||||||||
> > | -- MikeMannix - 03 Dec 2001 |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 42 to 42 | ||||||||
| ||||||||
Added: | ||||||||
> > | ||||||||
On-Site PretestingTo test new Plugins on your installation before making them public, you may want to use one of these two approaches: | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
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. | |||||||
> > | 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. | |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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: | |||||||
| ||||||||
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 PluginsTWiki comes with three Plugins as part of the standard installation. | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Installing Plugins | ||||||||
Line: 51 to 51 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
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 | ||||||||
| ||||||||
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, BackupRestorePlugin, ColorPickerPlugin, CommentPlugin, DatePickerPlugin, EditTablePlugin, HeadlinesPlugin, InterwikiPlugin, JQueryPlugin, PreferencesPlugin, SetGetPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TagMePlugin, TinyMCEPlugin, TwistyPlugin, WysiwygPlugin. | ||||||||
Changed: | ||||||||
< < | % | |||||||
> > | Using % : | |||||||
You can use any of these active TWiki Plugins:
| ||||||||
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
| ||||||||
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:
| |||||||
> > | Plugins Preferences <If user settings are needed, explain... Entering valuse works exactly like TWikiPreferences and WebPreferences: six (6) spaces and then:>"
| |||||||
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.>" | |||||||
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 80 to 80 | ||||||||
| ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
DEMO: Active Plugin Variables
%ACTIVATEDPLUGINS% | ||||||||
Line: 159 to 159 | ||||||||
| ||||||||
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 |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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: | |||||||
| ||||||||
Line: 23 to 23 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
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. | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
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:
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
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: | ||||||||
< < |
| |||||||
> > |
| |||||||
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:
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Listing Active PluginsPlugin status variables let you list all active Plugins wherever needed. There are two list formats: | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
DEMO: Active Plugin Variables | ||||||||
Changed: | ||||||||
< < | %ACTIVATEDPLUGINS% | |||||||
> > | %ACTIVATEDPLUGINS% | |||||||
On this TWiki site, the active Plugins are: SpreadSheetPlugin, BackupRestorePlugin, ColorPickerPlugin, CommentPlugin, DatePickerPlugin, EditTablePlugin, HeadlinesPlugin, InterwikiPlugin, JQueryPlugin, PreferencesPlugin, SetGetPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TagMePlugin, TinyMCEPlugin, TwistyPlugin, WysiwygPlugin. | ||||||||
Changed: | ||||||||
< < | % | |||||||
> > | % | |||||||
You can use any of these active TWiki Plugins:
| ||||||||
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: | ||||||||
< < |
| |||||||
> > |
| |||||||
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: | ||||||||
< < |
| |||||||
> > |
| |||||||
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: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Creating Plugins | ||||||||
Line: 134 to 134 | ||||||||
A basic TWiki Plugin consists of two elements: | ||||||||
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. | ||||||||
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 ). | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
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: | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
-- AndreaSterbini - 29 May 2001 -- MikeMannix - 01 Sep 2001 |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 13 to 13 | ||||||||
| ||||||||
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 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 83 to 83 | ||||||||
DEMO: Active Plugin Variables | ||||||||
Changed: | ||||||||
< < | %ACTIVATEDPLUGINS% | |||||||
> > | %ACTIVATEDPLUGINS% | |||||||
On this TWiki site, the active Plugins are: SpreadSheetPlugin, BackupRestorePlugin, ColorPickerPlugin, CommentPlugin, DatePickerPlugin, EditTablePlugin, HeadlinesPlugin, InterwikiPlugin, JQueryPlugin, PreferencesPlugin, SetGetPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TagMePlugin, TinyMCEPlugin, TwistyPlugin, WysiwygPlugin. | ||||||||
Changed: | ||||||||
< < | % | |||||||
> > | % | |||||||
You can use any of these active TWiki Plugins:
| ||||||||
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: | ||||||||
< < |
| |||||||
> > |
| |||||||
Anatomy of a PluginA basic TWiki Plugin consists of two elements: | ||||||||
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. | ||||||||
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 TopicThe 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: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
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:
| ||||||||
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: | ||||||||
< < |
| |||||||
> > |
| |||||||
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:
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < | -- AndreaSterbini - 29 May 2001 -- MikeMannix - 01 Sep 2001 | |||||||
> > | -- AndreaSterbini - 29 May 2001 -- MikeMannix - 01 Sep 2001 -- PeterThoeny - 14 Sep 2001 |
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 | ||||||||
| ||||||||
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 | ||||||||
| ||||||||
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 | ||||||||
| ||||||||
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 | ||||||||
| ||||||||
Changed: | ||||||||
< < | Listing Active Plugins | |||||||
> > | Listing Active Plugins | |||||||
Plugin status variables let you list all active Plugins wherever needed. There are two list formats:
| ||||||||
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 | ||||||||
| ||||||||
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.
| ||||||||
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 | ||||||||
| ||||||||
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 | |||||||
| ||||||||
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 | ||||||||
| ||||||||
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: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 117 to 117 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 140 to 140 | ||||||||
| ||||||||
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. |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
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: | ||||||||
< < |
| |||||||
> > | OverviewYou can add Plugins to greatly extend TWiki's functionality, without alering the program core. With a plug-in approach, you can:
| |||||||
| ||||||||
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 PluginsTWiki comes with three Plugins as part of the standard installation.
| |||||||
Installing Plugins | ||||||||
Line: 21 to 35 | ||||||||
| ||||||||
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. | |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
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: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Deleted: | ||||||||
< < |
| |||||||
Managing Plugins | ||||||||
Line: 76 to 92 | ||||||||
| ||||||||
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: | ||||||||
< < |
| |||||||
> > | 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 | |||||||
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 | |||||||
> > |
| |||||||
Changed: | ||||||||
< < | A basic TWiki Plugin consists of two elements: | |||||||
> > | 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. | |||||||
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. | |||||||
> > |
| |||||||
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. | |||||||
> > |
| |||||||
Changed: | ||||||||
< < | 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. | |||||||
> > |
| |||||||
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: | ||||||||
< < |
| |||||||
> > |
Creating Plugins | |||||||
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. | |||||||
The DefaultPlugin Alternative
| ||||||||
Added: | ||||||||
> > | Anatomy of a PluginA basic TWiki Plugin consists of two elements:
| |||||||
Creating the Perl ModuleCopy 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 | ||||||||
| ||||||||
Changed: | ||||||||
< < | -- MikeMannix - 26 Aug 2001 | |||||||
> > | -- AndreaSterbini - 29 May 2001 -- MikeMannix - 01 Sep 2001 |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 28 to 28 | ||||||||
| ||||||||
Changed: | ||||||||
< < | Pre-Installed Plugins | |||||||
> > | Preinstalled Plugins | |||||||
TWiki comes with three Plugins as part of the standard installation. | ||||||||
Line: 38 to 38 | ||||||||
| ||||||||
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 | ||||||||
| ||||||||
Changed: | ||||||||
< < | List Active Plugins Automatically | |||||||
> > | Listing Active Plugins | |||||||
Plugin status variables let you list all active Plugins wherever needed. There are two list formats:
| ||||||||
Line: 83 to 83 | ||||||||
| ||||||||
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 | ||||||||
| ||||||||
Changed: | ||||||||
< < | Customize the DefaultPlugin | |||||||
> > | The DefaultPlugin Alternative | |||||||
| ||||||||
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 | ||||||||
| ||||||||
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: |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 11 to 11 | ||||||||
| ||||||||
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: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Line: 64 to 64 | ||||||||
List Active Plugins AutomaticallyPlugin status variables let you list all active Plugins wherever needed. There are two list formats: | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
DEMO: Active Plugin Variables | ||||||||
Line: 82 to 82 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
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 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
On this page:
TWiki Plugins | ||||||||
Line: 179 to 179 | ||||||||
| ||||||||
Changed: | ||||||||
< < | -- MikeMannix - 26 Aug 2001 | |||||||
> > | -- MikeMannix - 26 Aug 2001 |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Changed: | ||||||||
< < | TWiki Plugins | |||||||
> > | On this page:
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 | |||||||
> > |
| |||||||
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:
| |||||||
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. | |||||||
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.
| |||||||
Changed: | ||||||||
< < |
| |||||||
> > | Pre-Installed Plugins | |||||||
Changed: | ||||||||
< < |
| |||||||
> > | TWiki comes with three Plugins as part of the standard installation. | |||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Changed: | ||||||||
< < | -- PeterThoeny - 14 Jul 2001 | |||||||
> > |
Managing Installed PluginsIdeally, 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 PluginsInstalled Plugins can be toggled on or off, site-wide or by web, through TWikiPreferences and individual WebPreferences:
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:
List Active Plugins AutomaticallyPlugin status variables let you list all active Plugins wherever needed. There are two list formats:
DEMO: Active Plugin VariablesTIP! To test new Plugins on your installation before making them public, you may want to use one of these two approaches:
Creating New PluginsWith 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 PluginA basic TWiki Plugin consists of two elements:
TWiki Plugin APIThe 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. Thelib/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.
Customize the DefaultPlugin
Create a Plugin Module in PerlCopy 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 TopicThe 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:
OUTLINE: Doc Topic Contents Package a Plugin for DistributionA minimum Plugin release consists of a Perl module with a WikiName that ends inPlugin , ex: YourPlugin.pm , and a documentation page with the same name(YourPlugin.txt ).
Publish a Plugin for General UseYou 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:
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
TWiki PluginsPlugins 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
|
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 Pluginunder construction... ( check back at http://TWiki.org/cgi-bin/view/TWiki/TWikiPlugins ) |
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 ) |
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 |