[Zope] New Product Help

J Cameron Cooper jccooper@jcameroncooper.com
Wed, 12 Mar 2003 12:33:27 -0600

>I am trying to create a new zope product. I need to make a root level folder but have a function within my product called to approve access and changes to that folder. But, I don't even know how to make the root level folder. I would really appreciate help.
I really have no idea what you're going at, so I'll just spout some 
possibly helpful stuff:

- there is one and can be only one root, and it is inherent in Zope. You 
cannot change this (without suitable hacking.) All Zope objects are 
children (of some degree removed) of the root folder.

- if you have a product that needs Folderish capabilities, consider 
subclassing Folder or ObjectManager. Then you can ask your Product to 
contain things, and control what it looks like and what it does.

- to add a Folder to another folder, you must say 
folder.manage_addFolder(id, title) Usually 'folder' is 'self' when 
you're inside a folderish product, or 'context' when in a script or 
method. To add a folder just below the root (a top-level folder) you may 
have to do 'restrictedTraverse('/')' or something like that. You cannot 
add a folder to a non-folderish object, though you can make a Folder an 
attribute of any object, though it won't be visible in the ZMI.

- consider whether you need a Product. Unless you need to do something 
complex or need to stamp out a bunch of them, don't bother.

If you can be more specific we can probably give you better advise.