Re: [Zope] Automatically import a zexp
Andreas, To do this, zope needs to be running. If that is the case, then just copy the .zexp or xml file to the imports directory and make the appropriate xml-rpc call: http://www.zope.org/Members/Amos/XML-RPC To make an xml-rpc call without using python look at the bottom of this page: http://developer.kde.org/documentation/kde2arch/xmlrpc.html You'll also need to figure out how to do base64 encoding for the password, which is described in Amos' HOWTO above. Using perl for that would make it more debianish, since dpkg (or is it apt) depends on perl. To bad you aren't doing this TTW - you could use the ZImporter :) http://www.zope.org/Members/tfarrell/ZImporter/ (It even works with 2.4.3 - I just imported an 18MB xml file TTW) Any method of doing this when zope is not running will need access to the ZODB code in the Zope/lib/python directory, so that will need to be in the python path, unless you choose to rewrite the ZODB access code for scratch :) A few thoughts. Troy -- Troy Farrell Developer Entheos Software mailto:troy@entheossoft.com http://www.entheossoft.com
Hello,
as a Debian maintainer I wonder if there is any clean method to import zexp products by a script (not using the import method from a browser). The idea is that installing Python products is simple by copying the python code to the right place and restart zope. Works fine in the Debian postinst script. But what to do with zexp products. I tried a very dirty hack like
ZOPEUSER="<place the name of Zope administrator here>" PASSWD="<and his password>" ## For sure this is insecure. ## You should find a secure way using debconf to maintain this!!!!
IMPORT=<product-name>.zexp
LC_ALL=en_EN
HOST=localhost PORT=9673
wget --proxy=off --http-user=${ZOPEUSER} --http-pass=${PASSWD} \
http://${HOST}:${PORT}/Control_Panel/Products/${prod}/manage_importObject?f ile=${IMPORT}
but I think I really do not have to tell you that this can not be the recommended way to go.
Any other idea?
Kind regards
Andreas.
On Tue, 22 Jan 2002 entheos@entheossoft.com wrote:
To do this, zope needs to be running. If that is the case, then just copy the .zexp or xml file to the imports directory and make the appropriate xml-rpc call: http://www.zope.org/Members/Amos/XML-RPC Might be possible because there is an ITP (Intent To Package) for xmlrpclib http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=115368
To make an xml-rpc call without using python look at the bottom of this page: http://developer.kde.org/documentation/kde2arch/xmlrpc.html Interesting, too.
You'll also need to figure out how to do base64 encoding for the password, which is described in Amos' HOWTO above. Using perl for that would make it more debianish, since dpkg (or is it apt) depends on perl. I really do not have to do it in Perl (by the way apt depends from dpkg ant thus it implicitely depends from Perl) because if I want to install something which depends from Zope Python is clearly installed in the system.
To bad you aren't doing this TTW - you could use the ZImporter :) http://www.zope.org/Members/tfarrell/ZImporter/ (It even works with 2.4.3 - I just imported an 18MB xml file TTW) Well, as I said, wget is an option to do this stuff. On the other hand this pages says:
This does pose some security issues. It is recommended that after you have imported your site, you remove all instances of ZImporters. A possible way would be to ship ZImporter inside the package, move it into the right place, restart zope, import the zexp product using wget (if I really understand you right), remove ZImporter product, restart Zope. All this stuff could be done in the postinst script. I guess the XML method would be a little bit straightforeward even if the last approach would be possible in principle
Any method of doing this when zope is not running will need access to the ZODB code in the Zope/lib/python directory, so that will need to be in the python path, unless you choose to rewrite the ZODB access code for scratch :) A running Zope can be assumed.
A few thoughts. Thanks
Andreas.
participants (2)
-
entheos@entheossoft.com -
Tille, Andreas