[Zope] Import xml version of zclass broken ?

Dr. Ross Lazarus rossl@med.usyd.edu.au
Sat, 30 Oct 1999 11:48:17 +1000


Why did I try this stupid trick ?

I'm trying to figure out how to quickly "clone" a zclass - make changes
to a working zclass to produce a variation zclass without all the tedium
of creating the clone from scratch (sure, copying all the dtml etc but
it's still tedious and error prone !). It occurred to me that I could
use a text editor to change the various conflicting id's in the xml
representation - if that works, I could write some code to do it
automagically.

Here's what I did. (zope 2.0.1 on an nt box at home)

1. Use export from the control panel in products to export a zclass as
xml

2. cp the .xml from your var to import directories

3. Try importing it.

4. Of course I expect an import error because I'm stupidly trying to
import objects like permissions and zclass names which already exist -
so I expected various id conflicts - didn't seem to get that far. 

The error is in line 283 of ExportImport.py which reads

                pickler.dump(unpickler.load())
                pickler.dump(unpickler.load())

(Yes, line 284 is a repeat of line 283 for some reason.)

Anyone ?

Traceback (innermost last):
  File D:\zope2\lib\python\ZPublisher\Publish.py, line 214, in
publish_module
  File D:\zope2\lib\python\ZPublisher\Publish.py, line 179, in publish
  File D:\zope2\lib\python\Zope\__init__.py, line 201, in
zpublisher_exception_hook
    (Object: ElementWithAttributes)
  File D:\zope2\lib\python\ZPublisher\Publish.py, line 165, in publish
  File D:\zope2\lib\python\ZPublisher\mapply.py, line 160, in mapply
    (Object: manage_importObject)
  File D:\zope2\lib\python\ZPublisher\Publish.py, line 102, in
call_object
    (Object: manage_importObject)
  File D:\zope2\lib\python\OFS\ObjectManager.py, line 475, in
manage_importObject
    (Object: ElementWithAttributes)
  File D:\zope2\lib\python\ZODB\ExportImport.py, line 215, in importFile
  File D:\zope2\lib\python\ZODB\ExportImport.py, line 318, in importXML
  File D:\zope2\lib\python\ZODB\ExportImport.py, line 283, in importFile
TypeError: (see above)

-- 

Dr Ross Lazarus
Associate Professor and Sub-Dean for Information Technology
Faculty of Medicine, A27, R126a, University of Sydney,
Camperdown, NSW 2006, Australia
Tel: (+61 2) 93514429 Mobile: +61414872482
Fax: (+61 2) 93516646 Email: rossl@med.usyd.edu.au
http://www.health.usyd.edu.au/people/rossl.htm