[[PageOutline]] = Trac XML-RPC Plugin = == Description == '''*** Please note that this is still alpha software, so the API may change ***''' This plugin allows Trac plugins to export select parts of their interface via XML-RPC. It also includes some exported functions for manipulating tickets, with plans to include interfaces to other parts of Trac's API. The browsable XML-RPC URI suffix is /xmlrpc, however most XML-RPC clients should use the authenticated URL suffix /login/xmlrpc as this is correctly authenticated by Trac. [http://www.jspwiki.org/Wiki.jsp?page=WikiRPCInterface2 WikiRPC API] is complete, mostly thanks to [wiki:mgood]. Ticket API is also complete, with the following types exported: component, version, milestone, type, status, resolution, priority and severity. For example, for TracHacks the URIs are http://trac-hacks.swapoff.org/xmlrpc and http://trac-hacks.swapoff.org/login/xmlrpc (must be authenticated). == API == See the [source:xmlrpcplugin/0.9/tracrpc/api.py source] for API usage. == Todo == Outstanding tasks are roadmap, timeline, user management (?), plugin management (?)...plus probably more. == Installation == ~~Unfortunately, due to some issues with mod_pythons !FieldStorage emultation layer, this plugin requires [http://projects.edgewall.com/trac/attachment/ticket/2509/trac-field-storage-2.diff?format=txt this patch] be applied to your Trac installation.~~ You must use the [http://projects.edgewall.com/trac/browser/sandbox/wsgi WSGI] branch (or Trac >= 0.10) for this plugin to work, they are more robust with support for alternative content-types. Once this patch has been applied, install in the same manner as any other Trac plugin: {{{ # python setup.py bdist_egg # cp dist/*.egg /srv/trac/env/plugins }}} You will also probably need to enable the plugin in your environments trac.ini: {{{ [components] tracrpc.* = enabled }}} == Bugs/Feature Requests == Existing bugs and feature requests for XmlRpcPlugin are [report:9?COMPONENT=XmlRpcPlugin here]. If you have any issues, create a [http://trac-hacks.swapoff.org/newticket?component=XmlRpcPlugin&owner=athomas new ticket]. == Download == Download the zipped source from [download:xmlrpcplugin here]. == Source == You can check out the source for XmlRpcPlugin from Subversion at http://trac-hacks.swapoff.org/svn/xmlrpcplugin. == Example == === End-User Usage === Obtain and print a list of XML-RPC exported functions available to my user: {{{ #!python import xmlrpclib server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac-dev/login/xmlrpc") for method in server.system.listMethods(): print method print '\n'.join([' ' + x for x in server.system.methodHelp(method).split('\n')]) print print }}} List all tickets that are owned by athomas, using the XML-RPC multicall system to issue multiple RPC calls with one HTTP request: {{{ #!python import xmlrpclib server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac-dev/login/xmlrpc") tickets = server.ticket.query("owner=athomas") print '\n'.join(map(str, server.system.multicall([{'methodName' : 'ticket.get', 'params' : [ticket]} for ticket in tickets]))) }}} === API Usage === See the [source:xmlrpcplugin/0.9/tracrpc/api.py source] for details. == Screenshot == If the HTTP request to this URI is not XML, the XmlRpcPlugin will list all exported functions that the current user has permission to use. http://trac-hacks.swapoff.org/attachment/wiki/XmlRpcPlugin/tracrpc.png?format=raw == Author/Contributors == '''Author:''' [wiki:athomas] [[BR]] '''Contributors:''' [wiki:mgood] [[BR]] [[TagIt(plugin,athomas,alpha,0.9)]]