Plone and XML-RPC object creation
by
antonh
—
last modified
21-Sep-06 09:35 AM
I'm just starting to investigate XML-RPC as a way of shifting content between Plone sites. This "ZopeLabs recipe":http://www.zopelabs.com/cookbook/1109890980 seems like a good place to start.
I'm also interested in looking at the ATContentTypes migration machinery for walking through a site's content (for replication of content) and also the Zope3 based TreeWalker (see the tutorial on Plone.org) for the same purpose.
But, first steps. Add the script listed at the URL above, call it rpc_add and put it in the root of the plone site. , and then try using xmlrpclib ffrom Python on the command line. It's so easy!
>>> import xmlrpclib
>>> url = 'http://user:pass@server:port/path/to/plone/root'
>>> server = xmlrpclib.ServerProxy(url)
>>> server.rpc_add('/path/to/container','id','Title',\
... 'Body','Type','text/html','visible','Description')
'http://url/of/new/object'
How easy was that? The next step is to get it working from a python script on another Zope isntance.