After thinking about it more, it looks like this (HTTP POST) will be the way to go. Directly accessing the ZODB is nifty but would involve stopping Zope while I update which just adds a step to my process. Still, I'm disappointed that xmlrpc can't do this. I thought it would support everything I can do via HTTP plus more. And I was so looking forward to being buzzword compliant. Ah well, live and learn.
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Clemens Robbenhaar Sent: Thursday, October 31, 2002 12:27 PM To: zope@zope.org Subject: [Zope] Programmatic creation/update of ZSQL methods
Charlie Reiman writes:
I've got about 60 or so ZSQL methods that I maintain in my Zope. Actually, I don't maintain them: our Oracle expert changes them then I have to translate them into DTML, split them into little chunks, and upload them into zope.
Since I'm terribly lazy I've automated the DTMLification and the splitting. But the third step of uploading the ZSQL bodies is tricker. Currently I'm uploading them via FTP but this requires that the methods already exist (due to a lack of object type magic). I've also tried using xmlrpc but manage_addZSQLMethod does not seem to live on Folder so I'm not sure how I can call it.
So my question is: How can I create ZSQL methods from an external program (a python script in this case)? I've got the body, the id, the destination, the connection id, the parameters... everything but a clue.
Its maybe ugly, but how about faking the ZMI form by doing something like:
lynx -dump -auth admin:clear_text_passwd \
'http://localhost:8080/my_sql_folder/manage_addZSQLMethod?id=new_s ql_method&title=foo&connection_id=my_db&arguments=&template:text=select+*'
Afterwards the SQL method should be there and may be edited via FTP. Or is this too ugly? Maybe someone else one the list knows a better way to add arbitrary typed objects programatically. Cheers, Clemens