Edgewall Software

Changes between Version 63 and Version 64 of TracDev/PluginDevelopment


Ignore:
Timestamp:
Jul 28, 2011, 9:23:26 PM (13 years ago)
Author:
psuter <petsuter@…>
Comment:

Extract information about extension points to TracDev/PluginDevelopment/ExtensionPoints

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/PluginDevelopment

    v63 v64  
    33
    44Starting with version [milestone:0.9 0.9], you can develop plugins for Trac that extend the builtin functionality. The plugin functionality is based on the [wiki:TracDev/ComponentArchitecture component architecture], so please read that document before continuing here. For more information, not covered here, see TracDev.
    5 
    6 == Extension points ==
    7 
    8 Trac offers an increasing number of ''extension points'' that allow you to plugin custom extensions for various functions. You can view a list of provided and implemented extension points using the [th:TracDeveloperPlugin TracDeveloperPlugin].
    9 
    10 === Trac Extension Points ===
    11 
    12 Below you find a still incomplete list of extension points available in the current trac release ([milestone:0.12 0.12]). If you want to contribute documentation on any of the below described extension point interfaces, feel free to add the documentation. Please use the template [wiki:TracDev/PluginDevelopment/ExtensionPointDocumentationTemplate] when authoring new documentation.
    13 
    14 {{{#!div style="background-color: #ffc"
    15 If the links to the interfaces point to the correct lines, they should also include a precise revision, as the line numbers will certainly change in the future -- rblank
    16 
    17 Correct, I removed the line pointers from here since that would be way too much work to maintain in the future -- cklein
    18 
    19 How about extending the source formatter so that it will generate named anchors so that we could just !source:/trunk/trac/env.py#IEnvironmentSetupParticipant instead? Will make this a feature request. -- cklein
    20  Is there a ticket for this? I'd have a patch that allows linking to #?IEnvironmentSetupParticipant. I used !JavaScript to find the first relevant line though, so no real anchors are needed. -- psuter
    21    no ticket yet; the feature would be very interesting to have, however `?...` suggests you're searching from the end of the file to the top while `/...` would instead suggest you're looking forward (having both would be even better of course ;-) ) -- cboos
    22      Now there's #10284 -- psuter
    23 }}}
    24 
    25 ||='''Extension Point Interface'''[[br]]'''Source''' =||='''Description''' =||
    26 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.env.IEnvironmentSetupParticipant trac.env.IEnvironmentSetupParticipant][[br]]([source:trunk/trac/env.py source])||Plugins that provide their own data models must implement this interface to be able to create the required tables in the database on either the creation of a new environment, or during the upgrade of an existing environment.||
    27 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.db.api.IDatabaseConnector trac.db.api.IDatabaseConnector][[br]]([source:/trunk/trac/db/api.py source])||By implementing this interface you can add additional database backends to the system. Currently available are backends for MySQL, PostgreSQL and SQLITE2/3.||
    28 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.admin.api.IAdminCommandProvider trac.admin.api.IAdminCommandProvider][[br]]([source:/trunk/trac/admin/api.py source])||Allows plugins to add additional commands to the trac-admin console command.||
    29 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.admin.api.IAdminPanelProvider trac.admin.api.IAdminPanelProvider][[br]]([source:trunk/trac/admin/api.py source])||Allows plugins to add additional admin panels to the web-based administration module.||
    30 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.mimeview.api.IContentConverter trac.mimeview.api.IContentConverter][[br]]([source:trunk/trac/mimeview/api.py source])||Allows plugins to implement conversion strategies for arbitrary content types. (NOTE: API is likely to change in the future)||
    31 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.mimeview.api.IHTMLPreviewAnnotator trac.mimeview.api.IHTMLPreviewAnnotator][[br]]([source:trunk/trac/mimeview/api.py source])||Allows plugins to add additional information to an XHTML representation of a given file, for example meta data on the file and so on.||
    32 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.mimeview.api.IHTMLPreviewRenderer trac.mimeview.api.IHTMLPreviewRenderer][[br]]([source:trunk/trac/mimeview/api.py source])||Allows plugins to provide support for rendering specific content of a specific type as HTML (used for TracSyntaxColoring and image preview).||
    33 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.notification.IEmailSender trac.notification.IEmailSender][[br]]([source:trunk/trac/notification.py source])||Implement this interface to be able to send notification mails.||
    34 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.perm.IPermissionGroupProvider trac.perm.IPermissionGroupProvider][[br]]([source:trunk/trac/perm.py source])||Implement this extension point interface when you can provide information on groups that a given user is a member of.||
    35 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.perm.IPermissionPolicy trac.perm.IPermissionPolicy][[br]]([source:trunk/trac/perm.py source])||By implementing this interface you can do more finely grained permission checks.||
    36 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.perm.IPermissionRequestor trac.perm.IPermissionRequestor][[br]]([source:trunk/trac/perm.py source])||Plugins can use this extension point to define additional "actions", or permission roles, for the permission system.||
    37 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.perm.IPermissionStore trac.perm.IPermissionStore][[br]]([source:trunk/trac/perm.py source])||Plugins can use this extension point to implement a storage for permissions and also to handle user authorization.||
    38 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.prefs.api.IPreferencePanelProvider trac.prefs.api.IPreferencePanelProvider][[br]]([source:trunk/trac/api.py source])||Allows plugins to add additional preferences panels to the user's preferences page.||
    39 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.resource.IResourceManager trac.resource.IResourceManager][[br]]([source:trunk/trac/resource.py source])||Allows plugins to take over full control of the realms that they provide, incl. also introducing new resource types to the system.||
    40 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.search.api.ISearchSource trac.search.api.ISearchSource][[br]]([source:trunk/trac/search/api.py source])||Allows plugins to provide additional searchable (re)sources to the system.||
    41 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.ticket.api.ITicketActionController trac.ticket.api.ITicketActionController][[br]]([source:trunk/trac/ticket/api.py source])||Allows plugins to participate in a ticket's workflow.||
    42 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.ticket.api.ITicketChangeListener trac.ticket.api.ITicketChangeListener][[br]]([source:trunk/trac/ticket/api.py source])||Extension point interface for components that require notification on when tickets are created, modified, or deleted.||
    43 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.ticket.api.ITicketManipulator trac.ticket.api.ITicketManipulator][[br]]([source:trunk/trac/ticket/api.py source])||Allows plugins to both prepare tickets on creation and also to validate them prior to that they get stored in the database.||
    44 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.ticket.api.IMilestoneChangeListener trac.ticket.api.IMilestoneChangeListener][[br]]([source:trunk/trac/ticket/api.py source])||Allows plugins to listen on changes to either existing or newly created milestones.||
    45 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.ticket.roadmap.ITicketGroupStatsProvider trac.ticket.roadmap.ITicketGroupStatsProvider][[br]]([source:trunk/trac/ticket/roadmap.py source])||Allows plugins to implement their own scheme of ticket stats, and provide that to the system via the !RoadmapModule.||
    46 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.timeline.ITimelineEventProvider trac.timeline.ITimelineEventProvider][[br]]([source:trunk/trac/timeline/api.py source])||Allows plugins to contribute events to the [wiki:TracTimeline timeline].||
    47 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.web.api.IAuthenticator trac.web.api.IAuthenticator][[br]]([source:trunk/trac/web/api.py source])||Allows plugins to authenticate users and HTTP sessions thereof. The first authenticator able to authenticate a user is the authoritative authenticator, meaning that other authenticators available in the system will not be called. Users that cannot be authenticated by the request and an associated session thereof are called 'anonymous'.||
    48 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.web.api.IRequestFilter trac.web.api.IRequestFilter][[br]]([source:trunk/trac/web/api.py source])||Allows plugins to both preprocess and postprocess HTTP requests.||
    49 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.web.api.IRequestHandler trac.web.api.IRequestHandler][[br]]([source:trunk/trac/web/api.py source])||Allows plugins to process HTTP requests.||
    50 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.web.api.ITemplateStreamFilter trac.web.api.ITemplateStreamFilter][[br]]([source:trunk/trac/web/api.py source])||Allows plugins to filter existing [http://genshi.edgewall.org. Genshi] streams prior to that the template will be rendered.||
    51 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.web.chrome.INavigationContributor trac.web.chrome.INavigationContributor][[br]]([source:trunk/trac/web/chrome.py source])||Allows plugins to extend the navigation menus of the web interface.||
    52 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.web.chrome.ITemplateProvider trac.web.chrome.ITemplateProvider][[br]]([source:trunk/trac/web/chrome.py source])||Extension point interface for components that provide their own templates and accompanying static resources.||
    53 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.wiki.api.IWikiChangeListener trac.wiki.api.IWikiChangeListener][[br]]([source:trunk/trac/wiki/api.py source])||Allows plugins to observe creation, modification and renaming (since trac-0.12), and deletion of wiki pages.||
    54 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.wiki.api.IWikiMacroProvider trac.wiki.api.IWikiMacroProvider][[br]]([source:trunk/trac/wiki/api.py source])||Allows plugins to contribute WikiMacros to Trac.||
    55 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.wiki.api.IWikiPageManipulator trac.wiki.api.IWikiPageManipulator][[br]]([source:trunk/trac/wiki/api.py source])||Allows plugins to validate wiki pages prior to that they get stored in the database.||
    56 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.wiki.api.IWikiSyntaxProvider trac.wiki.api.IWikiSyntaxProvider][[br]]([source:trunk/trac/wiki/api.py source])||Plugins can extend this extension point to add custom syntax rules to the wiki formatting system. In particular, this allows registration of additional TracLinks types.||
    57 ||[wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.versioncontrol.api.IRepositoryChangeListener trac.versioncontrol.api.IRepositoryChangeListener][[br]]([source:trunk/trac/versioncontrol/api.py@9854 source])||Components implementing this interface are notified when new changesets are added to a repository, and when metadata for changesets is modified. [http://trac.edgewall.org/wiki/TracDev/ApiChanges/0.12#IRepositoryChangeListener more here]||
    58 
    59 
    60 ''Note that plugins can themselves add new extension points, so the list above is incomplete by nature.''
    615
    626== Writing the plugin code ==
     
    9337}}}
    9438
    95 Look at the API documentation for the extension point interfaces to see what you're expected to return.  See the [http://trac-hacks.org/wiki/tutorial tutorial] page for more plugin tutorials.
     39== Extension points ==
     40The above example implements two of Trac's many [wiki:TracDev/PluginDevelopment/ExtensionPoints extension point interfaces]. Look at the extension point specific pages (like [wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.web.chrome.INavigationContributor]) for an overview, or the  API documentation to see what exactly you're expected to return.
    9641
    9742== Component member variables ==
     
    208153
    209154----
    210 See also: TracDev, TracDev/ComponentArchitecture, TracPlugins, TracHacks:wiki:EggCookingTutorialTrac0.11
     155See also: TracDev, TracDev/ComponentArchitecture, TracDev/PluginDevelopment/ExtensionPoints, TracPlugins, TracHacks:wiki:EggCookingTutorialTrac0.11,  TracHacks:wiki:tutorial