Krang::AddOn - module to manage Krang add-ons
use Krang::ClassLoader 'AddOn';
# install an addon
pkg('AddOn')->install(src => '/path/to/Turbo-1.00.tar.gz');
# get a list of installed addons
my @addons = pkg('AddOn')->find();
# find a particular addon by name
my ($addon) = pkg('AddOn')->find(name => $name);
# find a particular addon by conditional field in conf file set to true
# fields supported are EnableAdminSchedulerActions and EnableObjectSchedulerActions
my @addons = pkg('AddOn')->find(condition => 'EnableFeatureFoo')
# get the name and version of an addon $name = $addon->name; $version = $addon->version;
# remove an addon $addon->uninstall(verbose => 0);
# call all registered handlers of a particular name
pkg('AddOn')->call_handler($name, @args);
This module is responsible for managing Krang addons and their associated versions. See the add_ons.pod document in docs/ for a complete description of how add-ons work.
Krang::AddOn->install(src => $path, verbose => 1, force => 1)
Install a new addon. The source argument must contain the path to an
addon tarball, which must be readable by KrangUser.
The verbose option will cause install steps to be logged to STDERR.
The force option will allow an addon to be installed even if the
addon is already installed and version is greater than or equal to
this version.
$addon->uninstall(verbose => 1, force => 1)
Uninstall an addon. The verbose option will cause uninstall steps
to be logged to STDERR. The force option will allow an addon to be
uninstalled even if an existing addon depends on it, otherwise the
method will die().
$name = $addon->name
Get the addon's name.
$version = $addon->version
Get the addon's version.
$conf = $addon->conf
Get the addon's configuration, a Config::ApacheFormat object.
@addons = Krang::AddOn->find()
Get a list of addons sorted by their Priority. supported:
Find an addon based on name.
Find a set of addons based on boolean flag
pkg('AddOn')->call_handler($name, @args)
Call all handlers named $name passing @args. For example, the NavigationHandler is triggered using:
pkg('AddOn')->call_handler("NavigationHandler", $tree);
Two types of scheduler addons are supported. They are configured with the following directives in krang_addon.conf.
Flags scheduler to look in this addon for items to add to the admin scheduler screen
EnableAdminSchedulerActions 1
List of actions to add to admin scheduler screen
AdminSchedulerActionList Foo Bar
Flags scheduler to look in this addon for actions to add to the story/media scheduler screen
EnableObjectSchedulerActions 1
List of actions to add to story/media scheduler screen
ObjectSchedulerActionList Foo Bar