Modify

Opened 7 years ago

Last modified 6 weeks ago

#1805 assigned enhancement

Access to Trac reports via XmlRpc

Reported by: moritz.schallaboeck@… Owned by: olemis
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

As of yet, there does not seem to be a way to access the reports in a Trac repository via XML-RPC. Since the reporting engine in Trac is fairly powerful, this would be nice to have. I'm thinking of a simple method like tickets.report(int reportid) returning either a list of IDs of the relevant tickets (which the client can then individually query or process) or returning the whole table as seen in the actual report.

Attachments (0)

Change History (4)

comment:1 follow-up: Changed 5 years ago by olemis

  • Trac Release changed from 0.10 to 0.11

TracGViz plugin includes an some XML-RPC handlers. ReportRPC 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 :( ).

Initially I though about returning a list of IDs of the relevant tickets but IMHO that's not the correct approach. Therefore I decided to returning the whole table as seen in the actual report.

Please see below a code snippet illustrating public methods :

class ReportRPC(Component):
    r""" An interface to Trac's report module.
    """
    implements(IXMLRPCHandler)
   
    def __init__(self):
      self.repmdl = ReportModule(self.env)
   
    # IXMLRPCHandler methods
    def xmlrpc_namespace(self):
        return 'report'
   
    def xmlrpc_methods(self):
        yield ('REPORT_VIEW', ((list,),), self.getAll)
        yield ('REPORT_VIEW', ((dict, int),), self.get)
        yield ('REPORT_VIEW', ((dict, int),), self.execute)
        yield ('REPORT_VIEW', ((list, int),), self.enum_columns)

There are still a few open issues and further methods may be needed (e.g. to create, update, delete reports). It is possible to move it onto XmlRpcPlugin. Feel free to do it !

PS: I tested it using 0.11, that's why I changed Trac Release field . Hope you don't mind.

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

Replying to olemis:

TracGViz plugin includes an some XML-RPC handlers. ReportRPC 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 athomas to olemis
  • Status changed from new to assigned

comment:4 Changed 6 weeks ago by olemis

Note for Apache Bloodhound users Bloodhound RPC plugin provides an API for reports .

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.