Version 1 (modified by 18 years ago) (diff) | ,
---|
Trac XML-RPC Plugin
Description
This plugin allows Trac to export select parts of its interface via XML-RPC.
It also includes some exported functions for manipulating tickets, with plans to include functions for other parts of Tracs API.
Note: Unfortunately, due to some issues with mod_pythons FieldStorage emultation layer, this plugin requires the patch in [trac-ticket:2509 #T2509] to be applied to your Trac installation.'
Bugs/Feature Requests
Existing bugs and feature requests for XmlRpcPlugin are here.
If you have any issues, create a 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 a list of XML-RPC exported functions available to my user:
import xmlrpclib server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac-dev/RPC2") print server.tracrpc.api.list_xmlrpc_functions()
List all tickets that are owned by athomas:
import xmlrpclib server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac-dev/RPC2") print server.tracrpc.ticket.query_tickets("owner=athomas")
API Usage
Export a "hello world' function:
from tracrpc.api import IXMLRPCProvider from trac.core import Component, implements class HelloWorld(Component): implements(IXMLRPCProvider) def hello_world(self): return "Hello world" def get_xmlrpc_functions(self): yield ('WIKI_VIEW', self.hello_world)
Author/Contributors
Author: athomas
Contributors:
Attachments (2)
- tracrpc.png (94.4 KB) - added by 18 years ago.
-
trac_xml_rpc_example_java.zip (92.8 KB) - added by 16 years ago.
java interfaces and proxy class implementation (alpha example)
Download all attachments as: .zip