Modify

Opened 5 years ago

Last modified 2 years ago

#5527 assigned enhancement

Include RPC handler to retrieve timed events managed by Timeline module

Reported by: olemis Owned by: olemis
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords: timeline, events, filters
Cc: lkraav Trac Release: 0.11

Description

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.

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by osimons

Thanks - a very useful set of methods! Haven't had time to look at it yet though, and first I have a few things I want to redo on the internals before I start adding new methods (specifically #5437). I'll get onto extending methods during August most likely. Stay tuned :-)

comment:2 in reply to: ↑ description Changed 5 years ago by anonymous

Replying to olemis:

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 :( ).

BTW newer versions may include further features and bug fixes, so it's better to download the latest version.

comment:3 Changed 5 years ago by olemis

  • Owner changed from osimons to olemis
  • Status changed from new to assigned

comment:4 Changed 2 years ago by rjollos

  • Cc lkraav added; anonymous removed

Re-adding lkraav to the CC list since I accidentally deleted him while cleaning up spam.

Add Comment

Modify Ticket

Action
as assigned The owner will remain olemis.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.