Changes between Version 67 and Version 68 of XmlRpcPlugin
- Timestamp:
- Oct 29, 2008, 2:34:42 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
XmlRpcPlugin
v67 v68 175 175 You can either use the XMLRPC functionality included in the [http://ruby-doc.org/stdlib/libdoc/xmlrpc/rdoc/index.html Ruby Standard Library] or [/attachment/wiki/XmlRpcPlugin/trac4r.tar.gz download the trac4r library] which does all the trivial stuff for you. 176 176 177 ==== trac4r Example ==== 177 178 This example uses trac4r: 178 179 {{{ … … 225 226 If you have any problems with trac4r you can email me: niklas.cathor (eat) gmail dot com 226 227 228 ==== xmlrpc Example ==== 229 230 An example using XML-RPC directly with Ruby to append to a wiki page: 231 {{{ 232 #!ruby 233 require 'xmlrpc/client' 234 user = "username" 235 password = "password" 236 page_name = "SandBoxRPC" 237 new_content = "\n\nMy new content" 238 new_comment = "Adding new content from ruby" 239 240 server = XMLRPC::Client.new2("https://#{user}:#{password}@trac.server.com/trac/login/xmlrpc") 241 content = server.call("wiki.getPage", page_name) + new_content 242 server.call("wiki.putPage", page_name, content, {"comment" => new_comment}) 243 }}} 244 227 245 === API Usage === 228 246