Edgewall Software

Extension Point : IMilestoneChangeListener

InterfaceIMilestoneChangeListenerSince0.12
Moduletrac.ticket.apiSourceapi.py

The IMilestoneChangeListener allows components to listen for and to react to milestone events.

Purpose

The Trac milestone system helps planning and managing the future development of a project. Plugins can hook into the milestone system to trigger their own actions when milestones are created, deleted or changed.

The main purpose for this interface is to allow plugins to stay informed about the existing milestones and trigger appropriate actions elsewhere (e.g. sending notifications, starting indexing services, updating supplementary data structures etc.)

Usage

Implementing the interface follows the standard guidelines found in TracDev/ComponentArchitecture and of course TracDev/PluginDevelopment.

When a user creates a new milestone the milestone_created method is called. Similarly methods are called when a user deletes a milestone (milestone_deleted) or changes some milestone properties (milestone_changed).

The milestone model object is passed to each handler. So the milestone properties can be accessed as usual (i.e. milestone.name, milestone.due, milestone.completed, milestone.description) and the milestone can be updated etc.

In milestone_changed the changed properties are available by indexing e.g. old_values['name'].

Examples

See MilestoneToVersion sample plugin.

Available Implementations

Additional Information and References

API History

Last modified 4 years ago Last modified on Jul 18, 2014, 10:10:46 PM
Note: See TracWiki for help on using the wiki.