I've written a few stand-alone plugins and I'm just really getting familiar 
with Trac Component Architecture 
(http://trac.edgewall.org/wiki/TracDev/ComponentArchitecture) and I'm having 
trouble figuring out how and where to define the interface for some extension 
points.  While I'd like to understand the design philosopy in general, a 
specific example will make my needs clear.

My TracJSGanttChart (http://trac-hacks.org/wiki/TracJsGanttPlugin) plugin 
provides a visual presentation of Trac tickets that have estimates and due 
dates associated with them.  It currently implements a very simple scheduling 
algorithm.  I don't want to spend too much time making it to too sophisticated 
because I think users may want to substitute their own algorithm.

I'm working on a scheduler plugin that could provide a more sophisticated 
algorithm.  What I'd like to be able to do is install both plugins and 
configure them properly and have the Gantt use the better scheduler instead of 
its built-in default.  (Later, I also want to be able to use the scheduler in a 
ticket change listener which reschedules tickets when estimates or deadlines 
change.)

If I understand extension points correctly, somewhere I need to define the 
interface for the scheduler.  If I define it in the scheduler plugin then it 
has to be installed to use the Gantt even if the Gannt is configured to use its 
own algorithm.  If I define it in the Gantt, then the Gantt has to be installed 
-- even if unused -- for the scheduler to be available.  (Or does it? Can I say 
"Implements foo" if "foo" isn't in the system?)

This suggests to me that I define the extension point interfaces outside both 
plugins.  There are other interfaces that I think will be useful for developing 
project management in Trac (e.g., 
http://trac-hacks.org/wiki/ProjectManagementIdeas, which is definitely stale).  
Does it make sense to have a PM plugin that does nothing but define interfaces 
to be used by other plugins?  How would that work?  

When I go looking for other interfaces, 
http://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints gets to 
a "this page doesn't exist" but lists intriguing pages like:

    
TracDev/PluginDevelopment/ExtensionPoints/trac.admin.api.IAdminCommandProvider
    TracDev/PluginDevelopment/ExtensionPoints/trac.admin.api.IAdminPanelProvider
    TracDev/PluginDevelopment/ExtensionPoints/trac.db.api.IDatabaseConnector
    
TracDev/PluginDevelopment/ExtensionPoints/trac.env.IEnvironmentSetupParticipant
    
TracDev/PluginDevelopment/ExtensionPoints/trac.mimeview.api.IContentConverter
    
TracDev/PluginDevelopment/ExtensionPoints/trac.mimeview.api.IHTMLPreviewAnnotator
    
TracDev/PluginDevelopment/ExtensionPoints/trac.mimeview.api.IHTMLPreviewRenderer
    TracDev/PluginDevelopment/ExtensionPoints/trac.notification.IEmailSender
    TracDev/PluginDevelopment/ExtensionPoints/trac.perm.IPermissionPolicy
    TracDev/PluginDevelopment/ExtensionPoints/trac.perm.IPermissionRequestor
    
TracDev/PluginDevelopment/ExtensionPoints/trac.prefs.api.IPreferencePanelProvider
    TracDev/PluginDevelopment/ExtensionPoints/trac.web.api.IRequestFilter
    
TracDev/PluginDevelopment/ExtensionPoints/trac.web.chrome.INavigationContributor
    TracDev/PluginDevelopment/ExtensionPoints/trac.web.chrome.ITemplateProvider

It seems to me that existing EPs are defined in the core.  Are there non-core 
EPs?  Can someone point me to an example?

                                                 Chris
-- 
Christopher Nelson, Software Engineering Manager
SIXNET - Solutions for Your Industrial Networking Challenges
331 Ushers Road, Ballston Lake, NY  12019
Tel: +1.518.877.5173, Fax: +1.518.877.8346 www.sixnet.com 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to