[Zope] Re: Automatically import a zexp

Tille, Andreas TilleA@rki.de
Wed, 23 Jan 2002 09:47:29 +0100 (CET)


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.