On 4 Jan 2006, at 20:17, Florent Guillaume wrote:

On 13 Dec 2005, at 13:50, yuppie wrote:
Florent Guillaume wrote:
On 13 Dec 2005, at 12:50, yuppie wrote:

I'd propose to implement an update mode for list properties and to add an update file for each allowed container. Something like that:

<object name="MyContainer">
 <property name="allowed_content_types">
  <element value="MyType"/>
 </property>
</object>

(Didn't have a look at the code. I guess this currently overwrites the list and maybe that's what it should do by default. But we could add an explicit mode="update" to enforce an update mode.)
Yes that was another option I'd considered but found more complex, but if you think it's ok I'll look at how to implement it.

Yes, I prefer this option. It should be easy to implement and also useful for other properties. Workflow bindings are set in a similar way, see the example in the CMFTopic profile.

The mode="update" would be an attribute of <property>, right ?

Yes. But just found that I already use purge="False" for action handlers. I guess this is better than mode="update".

I can't find any code for purge="False".

Workflow bindings don't need that attribute - they are always in update mode if self.environ.shouldPurge() is False. Maybe it would be better to make the shouldPurge setting the default for properties as well. And override it with purge="True" if necessary. Don't know.

On the other hand the object importer and the skins layer importer check insert-before and insert-after. I'll reuse that, even if in my use case the list order doesn't matter.

On second thought it's a bit different, for skins and objects insert- before and insert-after are attributes of the (equivalent of the) element itself, not the property...

So I'll put them on the elements, and make update the default if purge is true, and add an optional purge="True" on the property if you really want to purge it in an extension profile.

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to