[Zope] copy paste support

Alexis Roda arv at si.urv.es
Mon Oct 13 07:01:52 EDT 2003

I'm writing a product and I have a little trouble with copy & paste support.

My product defines three clases: ZSimpleMenu, ZSimpleMenuItem and 
ZSubMenuItem. The first one is a container for the other two. The last 
two have no sense outside a ZSimpleMenu, so I don't want them to be 
listed on the "global" add list, only on the ZSimpleMenu add list. In 
order to acomplish this I have registered (registerClass) only 
ZSimpleMenu, and store on ZSimpleMenu.all_meta_types the meta types of 
the two Z*Items.

all_meta_types = (
       {'name': 'Menu Item',
        'action': 'manage_addMenuItemForm'
       {'name': 'Submenu Item',
        'action': 'manage_addSubmenuItemForm'

This does work, I can add objects as expected, but copy & paste don't 
work for Z*Items. When I try to copy/paste a ZSimpleMenuItem (id == 
m0100) within a ZSimpleMenu I get a "The object m0100 does not support 
this operation" error message. Copy/paste does work from ZSimpleMenu.

All three objects inherit from OFS.SimpleItem.Item so I suspect that the 
problem is related to the way I'm registering the classes.

What's the right way to register the Z*Items so I can copy & paste them, 
and they don't appear on the global add list?

                                  (@ @)
         Los pecados de los tres mundos desapareceran conmigo.
Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain)

More information about the Zope mailing list