Changes between Version 115 and Version 116 of XmlRpcPlugin
- Timestamp:
- Sep 7, 2016, 8:25:54 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
XmlRpcPlugin
v115 v116 13 13 Method status: 14 14 * Ticket API is also complete, with the following types exported: component, version, milestone, type, status, resolution, priority and severity. 15 * [http://www.jspwiki.org/Wiki.jsp?page=WikiRPCInterface2 WikiRPC API] is complete, mostly thanks to [wiki:mgood].15 * The [http://www.jspwiki.org/Wiki.jsp?page=WikiRPCInterface2 WikiRPC API] is complete, mostly thanks to [wiki:mgood]. 16 16 17 17 Protocol and method documentation for the latest version of the plugin can be found [/rpc here]. 18 18 19 Accessing the RPC handler through a browser (at `/rpc` or `/login/rpc`) will provide the documentation of protocols and available methods: 20 21 [[Image(tracrpc.png, border=2)]] 22 19 23 === Todo 20 24 21 Outstanding tasks are roadmap, timeline, user management, for example get a (filtered) user list to assign a task in [http://eclipse.org/mylyn/ mylyn], plugin management , plus probably more.25 Outstanding tasks are roadmap, timeline, user management, for example get a (filtered) user list to assign a task in [http://eclipse.org/mylyn/ mylyn], plugin management. 22 26 23 27 == Bugs/Feature Requests 24 28 25 Existing bugs and feature requests for XmlRpcPlugin are [report:9?COMPONENT=XmlRpcPlugin here]. 26 27 If you have any issues, create a [/newticket?component=XmlRpcPlugin&owner=osimons&cc=olemis new ticket]. 29 Existing bugs and feature requests for XmlRpcPlugin are 30 [report:9?COMPONENT=XmlRpcPlugin here]. 31 32 If you have any issues, create a 33 [/newticket?component=XmlRpcPlugin&owner=osimons&cc=olemis new ticket]. 28 34 29 35 [[TicketQuery(component=XmlRpcPlugin&group=type,format=progress)]] 30 36 31 37 == Download 32 38 33 39 Download the zipped source from [export:xmlrpcplugin here]. 34 40 … … 113 119 === Problems with mod_python, Apache, Python 2.4 114 120 115 XmlRpcPlugin might not work with Apache and Python 2.4 as explained in [ http://trac.edgewall.org/wiki/TracInstall#Requirements TracInstall]. Use Python 2.5 if you want to run Trac with mod_python.116 121 XmlRpcPlugin might not work with Apache and Python 2.4 as explained in [t:TracInstall#Requirements TracInstall]. Use Python 2.5 if you want to run Trac with mod_python. 122 117 123 == Example 118 124 … … 122 128 123 129 === Python End-User Usage 124 130 125 131 Obtain and print a list of XML-RPC exported functions available to my user: 126 132 127 133 {{{#!python 128 134 import xmlrpclib … … 135 141 print 136 142 }}} 137 143 138 144 The same example using `system.multicall()`. This reduces network and server load by compacting all of the `system.methodHelp()` calls into one HTTP POST. 139 140 {{{#!python 141 import xmlrpclib 142 145 146 {{{#!python 147 import xmlrpclib 148 143 149 server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac/devel/login/xmlrpc") 144 150 145 151 multicall = xmlrpclib.MultiCall(server) 146 152 for method in server.system.listMethods(): 147 153 multicall.system.methodHelp(method) 148 154 149 155 for help in multicall(): 150 156 lines = help.splitlines() … … 152 158 print '\n'.join([' ' + x for x in lines[2:]]) 153 159 print 154 155 }}} 156 160 }}} 161 157 162 List all tickets that are owned by athomas, using the XML-RPC multicall system to issue multiple RPC calls with one HTTP request: 158 159 {{{#!python 160 import xmlrpclib 161 163 164 {{{#!python 165 import xmlrpclib 166 162 167 server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac/devel/login/xmlrpc") 163 168 164 169 multicall = xmlrpclib.MultiCall(server) 165 170 for ticket in server.ticket.query("owner=athomas"): … … 167 172 print map(str, multicall()) 168 173 }}} 169 174 170 175 Access the Wiki with [http://www.jspwiki.org/Wiki.jsp?page=WikiRPCInterface2 WikiRPC]: 171 176 172 177 {{{#!python 173 178 import xmlrpclib 174 179 175 180 server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac-dev/login/xmlrpc") 176 181 177 182 # print the content of WikiStart 178 183 print server.wiki.getPage("WikiStart") 179 184 180 185 # print WikiStart as HTML 181 186 print server.wiki.getPageHTML("WikiStart") 182 187 183 188 # write to the SandBox page from a text file 184 189 sandbox_content = file("sandbox.txt").read() 185 190 server.wiki.putPage("SandBox", sandbox_content, {"comment": "testing the WikiRPC interface"}) 186 }}} 187 191 }}} 192 188 193 Add an attachment to WikiStart: 189 194 190 195 {{{#!python 191 196 import xmlrpclib 192 197 193 198 server = xmlrpclib.ServerProxy("http://athomas:password@localhost:8080/trunk/login/xmlrpc") 194 199 195 200 server.wiki.putAttachment('WikiStart/t.py', xmlrpclib.Binary(open('t.py').read())) 196 201 }}} … … 245 250 246 251 See XmlRpcPlugin/DotNet. 247 252 248 253 === Using from Java 249 254 … … 259 264 260 265 === API Usage 261 266 262 267 See the [source:xmlrpcplugin/0.10/tracrpc/api.py source] for details. 263 264 == Screenshot 265 266 Accessing the RPC handler through a browser (at `/rpc` or `/login/rpc`) will provide the documentation of protocols and available methods: 267 268 [[Image(tracrpc.png)]] 269 268 270 269 == Change Log 271 270 272 271 [[ChangeLog(/xmlrpcplugin, 3)]] 273 272 274 273 == Author/Contributors 275 274