Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mylyn-integrators] Need help contributing to commitTemplates extension point

Hi,

I have been able to find very little documentation for the org.eclipse.mylyn.team.ui.commitTemplates extension point.  To provide context for my questions, what I'm trying to do (in the CollabNet TeamForge connector) is something very similar to what it looks like Tasktop Dev 2.8 is doing, as described here:

http://tasktop.com/blog/tasktop/integration-options-tasktop-dev-2-8

The screenshot shows a Commit Comment Template that includes a variable like this:

${task.attribute("hp_proxy_id")}

This is not one of the out-of-the box recognizedKeyword's contributed by the org.eclipse.mylyn.team.ui plugin, so I must assume that the Tasktop plugin is contributing it.  I wish to do something similar, so that we can include custom TeamForge task attributes in the commit comment template.  However, looking at org.eclipse.mylyn.team.ui.AbstractCommitTemplateVariable, I do not see that the interface provides any mechanism for passing a parameter (i.e., "hp_proxy_id") to the getValue(ITask task) call.  To include the above example as a recognized template variable, my contribution has to look something like this:

   <extension
         point="org.eclipse.mylyn.team.ui.commitTemplates">
      <templateVariable
            class="com.collabnet.ee.tracker.ui.CommitTemplateVariable"
            recognizedKeyword="task.attribute(&quot; hp_proxy_id &quot;)">
      </templateVariable>      
   </extension>

But this is not what I'm looking for because then my CommitTemplateVariable class will not  be asked to provide a value unless the String in the commit comment template is actually:

${task.attribute("hp_proxy_id")}

Am I missing something here?  What I'm looking for is to let the user include variables like this in the template:

${task.attribute("myCustomField1")}
${task.attribute("myCustomField2")} 
${task.attribute("myCustomField3")}

. . . and have one commit template variable handler that passes back the appropriate value based on the ITask and the field name.  We have no way to even know what custom fields the user might have defined in his tracker, so we can't have explicit templateVariable contributions for every possible field.

I hope this makes sense.  And that someone can help me.

Thanks!
Steve


Back to the top