Changeset 470 for trunk/core/data/TWiki/TWikiPlugins.txt
- Timestamp:
- 11/08/08 18:07:57 (4 years ago)
- File:
-
- 1 edited
-
trunk/core/data/TWiki/TWikiPlugins.txt (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/data/TWiki/TWikiPlugins.txt
r14 r470 1 %META:TOPICINFO{author="TWikiContributor" date="1208648630" format="1.1" version="$Rev: 16 166$"}%1 %META:TOPICINFO{author="TWikiContributor" date="1208648630" format="1.1" version="$Rev: 16704 $"}% 2 2 %STARTINCLUDE% 3 3 ---+ TWiki Plugins … … 26 26 * TWiki:Plugins.PluginPackageHowTo - template to create a new plugin package 27 27 28 __See other types of extensions:__ TWikiAddOns, TWikiContribs, TWikiSkins28 __See other types of extensions:__ ContributedAddOns, TWikiContribs, TWikiSkins 29 29 30 30 #InstallPlugin … … 290 290 291 291 ---+++ Structure of a <code>Config.spec</code> file 292 The =Config.spec= file for a n extension starts with the extension announcing what it is:292 The =Config.spec= file for a plugin starts with the plugin announcing what it is: 293 293 <verbatim> 294 294 # ---+ BathPlugin … … 304 304 # **NUMBER** 305 305 # Enter the chain length in cm 306 $TWiki::cfg{BathPlugin}{ChainLength} = 30;306 $TWiki::cfg{BathPlugin}{ChainLength} = '30'; 307 307 308 308 # **BOOLEAN EXPERT** 309 # Set this option to 0to disable the water temperature alarm310 $TWiki::cfg{BathPlugin}{TempSensorEnabled} = 1;309 # Turn this option off to disable the water temperature alarm 310 $TWiki::cfg{BathPlugin}{TempSensorEnabled} = '1'; 311 311 </verbatim> 312 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,312 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, 313 313 <verbatim> 314 314 if( $TWiki::cfg{BathPlugin}{TempSensorEnabled} && $curTemperature > 50 ) { … … 317 317 </verbatim> 318 318 319 The config.spec file is read by =configure=, whichthen writes =LocalSite.cfg= with the values chosen by the local site admin.319 The config.spec file is read by configure, and =configure= then writes =LocalSite.cfg= with the values chosen by the local site admin. 320 320 321 321 A range of types are available for use in =Config.spec= files: … … 343 343 See =lib/TWiki.spec= for many more examples. 344 344 345 =Config.spec= files for non-plugin extensions are stored under the =Contrib= directory instead of the =Plugins= directory. 346 347 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 Publish<nop>Contrib) 348 349 <verbatim> 350 # **PERL H** 351 # Bin script registration - do not modify 352 $TWiki::cfg{SwitchBoard}{publish} = [ "TWiki::Contrib::Publish", "publish", { publishing => 1 } ]; 353 </verbatim> 354 =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. 345 =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. 355 346 356 347 TWiki:TWiki/SpecifyingConfigurationItemsForExtensions has supplemental documentation on configure settings. … … 400 391 __Related Topics:__ DeveloperDocumentationCategory, AdminDocumentationCategory, TWiki:TWiki.TWikiPluginsSupplement 401 392 402 -- __Contributors:__ TWiki:Main.PeterThoeny, TWiki:Main.AndreaSterbini, TWiki:Main.MikeMannix, TWiki:Main.CrawfordCurrie, TWiki:Main.ArthurClemens, TWiki:Main.WillNorris403
Note: See TracChangeset
for help on using the changeset viewer.
