Include RPC handler to retrieve timed events managed by Timeline module
|Reported by:||olemis||Owned by:||olemis|
|Severity:||normal||Keywords:||timeline, events, filters|
TracGViz plugin includes an some XML-RPC handlers. TimelineRPC class's been included since version 1.3.3 (can't provide a link to browse the source code due to the fact that my SVN client is failing and I can't (commit | check) out anything ... sorry :( ).
It returns all timed events offered by instances of ITimelineEventProvider.
Please see below a code snippet illustrating public methods :
class TimelineRPC(Component): r""" An interface to Trac's timeline module. """ implements(IXMLRPCHandler) sources = ExtensionPoint(ITimelineEventProvider) def __init__(self): self._event_data = TimelineModule(self.env)._event_data # IXMLRPCHandler methods def xmlrpc_namespace(self): return 'timeline' def xmlrpc_methods(self): yield ('TIMELINE_VIEW', ((list, xmlrpclib.DateTime, xmlrpclib.DateTime, list), (list, xmlrpclib.DateTime, xmlrpclib.DateTime), (list, xmlrpclib.DateTime), (list, )), self.getEvents) yield ('TIMELINE_VIEW', ((list,),), self.getEventFilters)
There are still a few open issues and further methods may be needed (e.g. to create, update, delete reports). Besides in order to retrieve all events related to ticket changes (e.g. attachments) timeline.ticket_show_details option in trac.ini needs to be set to true.
It is possible to move it onto XmlRpcPlugin. Feel free to do it !
PS: I tested it using 0.11, that's why I specify that value in Trac Release field . Hope you don't mind.