This is a mock help for farm plugins, to be moved to MoinMaster when farm plugins are implemented. OLD:See also FeatureRequests/WikifarmPluginDirectory.
Farm plugins
To Install plugins in a wikifarm-wide fashion, use the plugin_dirs configuration variable wich is just for that. I've tested it with moin 1.8.4. My setup is something like this:
wikifarm/ config/farmconfig.py plugins/ plugins/macro wikis/
The folder plugins/ and macro/ must contain an empty file named __init__.py, this is required by Python so that this folders become modules that MoinMoin can import.
Then in config/farmconfig.py just add the plugin_dirs variable pointing to your directory, e.g.:
# In farmconfig.py plugin_dirs = ['/path/to/wikifarm/plugins',]
If this doesn't work, check the owner, group and file mod of the plugin/ directory and everything in it (hint: chmod and chown).
Whit this setup you should still be able to install specific plugins for one wiki, using his plugins directory inside his data directory.
I find it useful to look at the code:
http://hg.moinmo.in/moin/1.8/file/3010c1a94185/MoinMoin/config/multiconfig.py#l577
http://hg.moinmo.in/moin/1.8/file/3010c1a94185/MoinMoin/config/multiconfig.py#l895
--Cesco (07/2009)
Plugin types
What does each type of plugin, from the wiki admin point of view.
Wiki plugins
Why wiki plugins are needed? common use cases (when you want to use wiki plugins instead of farm plugins).
Plugins have security implications. It can be important that the use of a particular plugin's features be governed by specific access rules that don't pertain to all wikis in a WikiFarm. Allowing the plugin to be installed for only a specific wiki can allow the appropriate security restrictions to be made for the wiki without impacting the security decisions for wikis that don't need the feature(s) offered by that plugin.
Technical details
The hardest part is the default location that works out of the box.
Add farm_plugin_dir to multiconfig.DefaultConfig, with a default that will work for a simple install.
- Let a wiki config change its farm plugin dir? does not make sense.
- Make it required like the wiki plugin directory?
These are easy, based on exiting code:
Refactor the plugin load method in multiconfing.DefaultConfig to general function, probably in wikiutil (until we have a plugin module) or in pysupport.
load the plugin package once - when multiconfig is imported? or maybe wait for the first call to farmPlugins?
Save the farm plugins module as farm.plugins. From now on, __import__('farm.plugins.kind.name') will work. Maybe use MoinMoin.farm.plugins? Maybe we should have a real module with this name, and a load function that import the plugin package from the correct path and bind it to 'plugins'.
Add new function wikiutil.importFarmPlugin, use same code as importWikiPlugin.
Add wikiutil.farmPlugins function, works like wikiPlugins
In wikiutil.importPlugin, try to load wiki plugin, then farm plugin, then built in.