[Zope-CMF] Question on allowedContentTypes

Florent Guillaume fg@nuxeo.com
Sat, 11 May 2002 14:10:17 +0000 (UTC)


Carl Rendell  <cer@sol43.com> wrote:
> 1. when programmatically adding a folder via python script what is 
> the best method? I'm currently adding it via:
> [...]
> 	context.manage_addProduct['CMFCore'].manage_addContent(type='Portal 
> Folder', id='navigation')

This is the normal Zope way of doing things. 

The CMF way is to call container.invokeFactory(). For Portal Folders,
it's the same thing as the Zope way, however for other types defined
in the Types Tool it is not (because _setPortalTypeName and the
workflow notifyCreated would not be called).

In general when working with CMF, invokeFactory is always the safe bet.

> 2. I'm now used to creating products and setting content filtering 
> attributes in  factory_type_information. Can content filters be set 
> arbitrailly at folder creation time, and is that a wise thing?

What do you mean by "set a content filter arbitrarily at folder
creation time" ?


Florent
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com