[Zope] Problem with xmlrpc and manage_pasteObjects
Casey Duncan
cduncan@kaivo.com
Thu, 19 Apr 2001 16:30:59 -0600
Juan Carlos Coru=F1a wrote:
>=20
> I have another xmlrpc replated problem:
>=20
> If I test the following script (python) with the Zope management
> interface it works ok, but if I call the script from outside Zope using
> xmlrpc I become an Fault error:
>=20
> xmlrpclib.Fault: <Fault -2: 'Unexpected Zope error value: Add Documents=
,
> Images, and Files'>
>=20
> This is the script:
>=20
> # Create a unique document id
> id =3D 'pepe'
>=20
> context.tmp.manage_addProduct['OFSP'].addDTMLDocument(id, title=3D"=
",
> file=3D'esto es una prueba')
> doctmp =3D getattr(context.tmp, id)
> doctmp.manage_addProperty('sender', 'loginName', 'string')
> doctmp.manage_addProperty('sessionId', 'session', 'string')
>=20
> # move the message to the queue
> obj =3D context.tmp.manage_cutObjects(ids=3D[id])
> context.manage_pasteObjects(obj)
>=20
> return id
>=20
> If I comment the line "context.manage_pasteObjects(obj)" Zope doesn't
> produce the error response.
>=20
> Is there a limitations using manage_pasteObjects with xmlrpc?
> Any solutions?
AFAIK, copy and paste in Zope use Cookies, so they won't work over
XML-RPC as you found. You could move something programatically as
follows
obj =3D context.tmp[id].aq_base
context._setObject(obj, id)
context.tmp.manage_delObjects(id)
This code could not be called directly from XML-RPC however...
Probably your best bet is to create a moveObject() external method that
does the above and call it from XML-RPC.=20
hth,
--=20
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>