Modify

Opened 17 years ago

Last modified 6 years ago

#1805 assigned enhancement

Access to Trac reports via XmlRpc

Reported by: moritz.schallaboeck@… Owned by: Olemis Lang
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 (5)

comment:1 Changed 15 years ago by Olemis Lang

Trac Release: 0.100.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 15 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 15 years ago by Olemis Lang

Owner: changed from Alec Thomas to Olemis Lang
Status: newassigned

comment:4 Changed 10 years ago by Olemis Lang

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

comment:5 Changed 6 years ago by anonymous

This would indeed be useful, especially if such queries returned the whole table as seen in the actual report, as otherwise joined information could well be lost.

Greville Earle

Modify Ticket

Change Properties
Set your email in Preferences
Action
as assigned The owner will remain Olemis Lang.

Add Comment


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

 
Note: See TracTickets for help on using tickets.