[Zope-CMF] portal objects and the clipboard

Florent Guillaume fg@nuxeo.com
Mon, 6 Aug 2001 19:51:42 +0200


I'm dealing right now with a painful problem : portal objects are not
proper full-class Zope objects, and cannot completely be used as if they
were, when dealing with the clipboard.

Example:

 - create a standard Zope folder,

 - inside the folder, create an Document (CMFDefault Content / Document),

 - try to rename it.

 - or inside the folder, try to paste a portal Document from elsewhere.

You get "The object asdf does not support this operation".

I know why, the Document meta_type is Document, which isn't listed in
the folder's meta_types, and thus the Copy or Paste operation can't
check its permissions constraints, I've seen the code (that's in
OFS.CopySupport._verifyObjectPaste for those who want to look).


I have to deal with this for instance in a ZClass that derives from
Portal Folder, and in which I have "default" portal subobjects. They are
stored in the product, but I can't manipulate them there as I want,
because they are contained in the product, which is basically a normal
folder.

Or I have an Ordered Folder somewhere in my CMF instance, which contains
documents. I can't manipulate these documents freely.

For it to work correctly, the Portal Folder has some magic in it to
override _verifyObjectPaste. This looks somewhat hackish to me, portal
objects should behave correctly outside of Portal Folders.

All in all, something's not very clean.


Thanks for your comments,


Florent Guillaume
Nuxeo