Edgewall Software

Extension Point : ITemplateStreamFilter

This extension point was deprecated with the introduction of the Jinja2 template engine in Trac 1.4, and removed in Trac 1.5.1 (#12787). Use Javascript instead.

InterfaceITemplateStreamFilterSince0.11
Moduletrac.web.apiSourcetrunk/trac/web/api.py#/ITemplateStreamFilter

The ITemplateStreamFilter extension point is defined by trac.web.api. Implementing the ITemplateStreamFilter interface allows you to have complete control on the generated Genshi event stream. You can use it to change the response at runtime: you can filter out some content, modify it or even inject new content.

Purpose

Since Trac 0.11, while it's still possible to customize the Genshi templates like it was for the Clearsilver ones in previous versions, this is no longer the only way, neither the preferred. What makes the use of the Genshi templating system fairly unique is that you can manipulate the generated output at run-time, in order to filter out some content, modify it or even inject new content. Among other things, leaving the original templates alone make it much easier to benefit from bug fixes and improvements made in newer mainstream Trac versions. All you need for that is to write a plugin implementing the ITemplateStreamFilter interface, which allows you to have complete control on the generated Genshi event stream.

Usage

TODO Provide detailed usage information of the extension point and implementations thereof. E.g. when is a method of the implementation being called and so on.

Examples

Available Implementations

TODO Provide references to available implementations of the interface, for example by linking to sources in trac trunk or on trac-hacks. You might also include short discussions on how they have been implemented.

Additional Information and References

TODO Provide here additional information on the extension point interface, for example open tickets regarding the interface or existing talk on the extension point, for example links to irc back logs and so on, including also best practices when implementing/using the interface. For example, for the IEnvironmentSetupParticipant there is currently talk about always committing changes to the database when upgrading using a migration path, so that on error during the migration, the existing data will not be corrupted.

Last modified 5 years ago Last modified on Aug 26, 2019, 2:09:17 AM
Note: See TracWiki for help on using the wiki.