Changes between Version 115 and Version 116 of XmlRpcPlugin


Ignore:
Timestamp:
Sep 7, 2016, 8:25:54 PM (8 years ago)
Author:
figaro
Comment:

Further cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • XmlRpcPlugin

    v115 v116  
    1313Method status:
    1414 * 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].
    1616
    1717Protocol and method documentation for the latest version of the plugin can be found [/rpc here].
    1818
     19Accessing 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
    1923=== Todo
    2024
    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.
     25Outstanding 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.
    2226
    2327== Bugs/Feature Requests
    2428 
    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].
     29Existing bugs and feature requests for XmlRpcPlugin are
     30[report:9?COMPONENT=XmlRpcPlugin here].
     31
     32If you have any issues, create a
     33[/newticket?component=XmlRpcPlugin&owner=osimons&cc=olemis new ticket].
    2834
    2935[[TicketQuery(component=XmlRpcPlugin&group=type,format=progress)]]
    3036
    3137== Download
    32                  
     38
    3339Download the zipped source from [export:xmlrpcplugin here].
    3440
     
    113119=== Problems with mod_python, Apache, Python 2.4
    114120 
    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                  
     121XmlRpcPlugin 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
    117123== Example
    118124
     
    122128
    123129=== Python End-User Usage
    124                  
     130
    125131Obtain and print a list of XML-RPC exported functions available to my user:
    126          
     132
    127133{{{#!python
    128134import xmlrpclib
     
    135141  print
    136142}}}
    137          
     143
    138144The 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
     147import xmlrpclib
     148
    143149server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac/devel/login/xmlrpc")
    144                  
     150
    145151multicall = xmlrpclib.MultiCall(server)
    146152for method in server.system.listMethods():
    147153    multicall.system.methodHelp(method)
    148          
     154
    149155for help in multicall():
    150156    lines = help.splitlines()
     
    152158    print '\n'.join(['  ' + x for x in lines[2:]])
    153159    print
    154          
    155 }}}
    156          
     160}}}
     161
    157162List 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
     165import xmlrpclib
     166
    162167server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac/devel/login/xmlrpc")
    163                  
     168
    164169multicall = xmlrpclib.MultiCall(server)
    165170for ticket in server.ticket.query("owner=athomas"):
     
    167172print map(str, multicall())
    168173}}}
    169          
     174
    170175Access the Wiki with [http://www.jspwiki.org/Wiki.jsp?page=WikiRPCInterface2 WikiRPC]:
    171176
    172177{{{#!python
    173178import xmlrpclib
    174                  
     179
    175180server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac-dev/login/xmlrpc")
    176          
     181
    177182# print the content of WikiStart
    178183print server.wiki.getPage("WikiStart")
    179          
     184
    180185# print WikiStart as HTML
    181186print server.wiki.getPageHTML("WikiStart")
    182          
     187
    183188# write to the SandBox page from a text file
    184189sandbox_content = file("sandbox.txt").read()
    185190server.wiki.putPage("SandBox", sandbox_content, {"comment": "testing the WikiRPC interface"})
    186 }}} 
    187                  
     191}}}
     192
    188193Add an attachment to WikiStart:
    189          
     194
    190195{{{#!python
    191196import xmlrpclib
    192197 
    193198server = xmlrpclib.ServerProxy("http://athomas:password@localhost:8080/trunk/login/xmlrpc")
    194          
     199
    195200server.wiki.putAttachment('WikiStart/t.py', xmlrpclib.Binary(open('t.py').read()))
    196201}}}
     
    245250
    246251See XmlRpcPlugin/DotNet.
    247          
     252
    248253=== Using from Java
    249254
     
    259264
    260265=== API Usage
    261          
     266
    262267See 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
    270269== Change Log
    271270 
    272271[[ChangeLog(/xmlrpcplugin, 3)]]
    273          
     272
    274273== Author/Contributors
    275274