-
Notifications
You must be signed in to change notification settings - Fork 0
Plugins: Events
// Get the content plugin's domain event observer
observer = getPluginObserver('content', 'domain');
// Trigger the event on the observer passing along the needed information
observer.afterSave(transport, user, domain);
// Get the content plugin's domain event observer
observer = transport.theApplication.managers.plugin.getContent().getObserver().getDomain();
// Trigger the event on the observer passing along the needed information
observer.afterSave(transport, user, domain);
Event handlers in Algid plugins are organized based upon the plugin they are targeting and the observer that will be listening for the event.
For example, if you want to add an event handler for the afterSave
event
for the domain in the content plugin you would put the following in
extend/content/events/evntDomain.cfc
:
component extends="algid.inc.resource.base.event" {
public void function afterSave( required struct transport, required component currUser, required component domain ) {
// Do something with the after save event
// Ex: Log the save
}
}
What events get triggered are at the discretion of the plugin. See the individual plugin documentation for information on the events that are available.
Event handlers are executed in the order that they are added. Algid will load
all events that follow the following pattern automatically in the order that the
plugins appear in the application's plugins
setting.
Event observers and handlers are created and stored as part application startup. If any changes are made, including new handlers, the application with have to be reinitialized to use the changed handlers.