[Zope-CMF] transparent folder
David Hart
dhart@atlantisblue.com.au
Fri, 07 Mar 2003 20:02:35 +1100
Hi,
Okay, I did a crazy thing: I patched PortalFolder to superclass
OrderedFolder instead of Folder:
#pwd
/opt/zope/Products/CMF-1.3/CMFCore
#
#diff PortalFolder.py.orig PortalFolder.py.Ordered
25a26
> from Products.OrderedFolder.OrderedFolder import OrderedFolder
67c68
< class PortalFolder(DynamicType, CMFCatalogAware, Folder):
---
> class PortalFolder(DynamicType, CMFCatalogAware, OrderedFolder):
380c381
< self.manage_addFolder( id=id, title='' )
---
> self.manage_addOrderedFolder( id=id, title='' )
463c464
< def manage_addFolder( self
---
> def manage_addOrderedFolder( self
Now from the CMF interface (Plone, actually), all works fine. I can add
new PloneFolders, set the transparent flag, add other objects, like
documents, to them, etc.
However, when I use invokeFactory from within a python script, the new
object is created in the parent folder:
inline_content.invokeFactory(id=object_id, type_name='Document')
Now, I think this may have to do with util.py and acquisition within
getToolByName, but I'm not sure... Can anyone help shed any light on the
problem?
Constructive comments only please.
Thanks,
Dave Hart