[Zope-CMF] CopySupport and FSPythonScripts?

seb bacon seb@jamkit.com
Thu, 16 Aug 2001 16:55:54 +0100


I can't copy objects inside my Portal programmatically. 

I'm trying to create a default set of objects for each user when they
sign up - a hierarchy of objects, in fact.  I figured the best way
would be to set up a 'template' in my portal root, called
'default_template', which is a folder full of methods, folders, etc.

In MembershipTool I do something like this:

            layout = getattr(parent, 'default_template', None)
            if layout:
                obs = layout.objectIds()
                copy_data = parent.manage_copyObjects(obs)
                f.manage_pasteObjects(copy_data)

I put a single, web-based DTML method in the 'default_template' folder.
However, the manage_copyObjects line throws a 'this operation not
supported' type of error.  I delved deeper.  The bit which fails is in
CopySupport, where cb_isCopyable tests the _p_jar attribute of the
object to be copied.  This is where I get lost, since I only vaguely
know about such things.  I can still copy the object TTW, though.

I noticed when running it through the debugger that the DTML Method in
question actually thinks it is an FSPythonScript.  Why would this be?  Is it
anything to do with the failed copy?

Thanks for enlightenments...:-)

seb