更改 Trac 票证时触发操作吗?
目前,我们在工作中使用 FogBugz,每次案例更改时,我都会使用 URLTrigger 插件调用 CGI 脚本。我正在尝试弄清楚如何用 Trac 做类似的事情;有谁知道这是否可能?我找不到任何插件或相关讨论。
We currently use FogBugz at work, and I'm using the URLTrigger plugin to call out to a CGI script every time a case is changed. I'm trying to figure out how to do something similar with Trac; does anyone know if this is possible? I can't find any plugins or discussion on it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
th.o 是寻找 Trac 插件的第一个地址。由于 Trac 从早期就通过其复杂的组件架构积极鼓励插件开发,因此您会发现大量代码。而且由于 Trac 核心开发人员已经参与其中,因此代码质量通常也相当好。您将阅读这些内容来了解事情应该如何运作。
也许您需要从当前的官方 wiki 文档开始,深入研究 Trac 的插件开发,并切换到 trac之后 -hacks.org。
关于您声明的开发目标,请特别关注
trac.ticket.api.ITicketChangeListener
- 一个用于在创建、修改或删除票证时需要通知的组件的扩展点接口。听起来这正是您想要的。您需要(粗略的要求列表)
Component
的类,实现 (ITicketChangeListener)
如果您需要更多详细信息,我建议您查看默认CcPlugin源。还有更多插件实现 ITicketChangeListener 接口,但这是一个相当小的插件,它只会向您显示可用的方法,而不会因它们周围的太多功能而分散注意力。
随着您的进展向您的问题添加信息,或根据需要在此处发表评论。我将尽我所知尽力进一步指导您。
t-h.o is the first address to seek for Trac plugins. Because Trac is actively encouraging plugin development by it's sophisticated Component Architecture since early days, you'll find a lot of code. And since Trac core developers have been involved, this is often quite good code quality too. Stuff you'll read to get an idea on how things are supposed to work.
Maybe you'll want to start with current official wiki docs to dive into Plugin Development for Trac and change over to trac-hacks.org afterwards.
Regarding your declared development goal especially look at
trac.ticket.api.ITicketChangeListener
- an extension point interface for components that require notification on when tickets are created, modified, or deleted. Sounds like this is just what you want.You'll need to (rough list of requirements)
Component
thatimplements (ITicketChangeListener)
If you need more details, I'd recommend to look at the DefaultCcPlugin source. There are many more plugins implementing the ITicketChangeListener interface, but this is a rather small plugin, that'll just show you the available methods and not distract with too much functionality around them.
Add information to your question as you progress, or Comment here as required. I'll try to guide you further on to the best of my own knowledge.