[Zope-CMF] portal metadata tool policy enforcement

Tres Seaver tseaver@zope.com
14 Jul 2002 18:35:05 -0400


On Sun, 2002-07-14 at 18:01, kapil thangavelu wrote:
> hi folks,
> 
> i'm embarking on my first cmf based project, and i had a question about the 
> portal_metadata tool.
> 
> it seems that the portal metadata tool can setup default content metadata 
> values,  and handle enforcement of those values. but it doesn't appear to be 
> wired into content creation or editing. am i missing something?
> 
> as is, i'm calling the tool in specific content factory methods to set 
> initial values, and within the relevant content edit methods.
> 
> in terms of generically hooking up the portal_metadata tool, since content 
> creation is already generic, does it make sense to add a call to the 
> portal_metadata tool directly to CMFCore.utils.manage_addContent and to the 
> types tool.constructInstance method? are there other generic mechanisms for 
> content creation within the cmf?
> 
> that would still leave the editing unaccounted for. the only place i can 
> think to generically add a hook for calling the tool might be the index 
> method of CMFCatalogAware, but that would require some special consideration 
> of creation vs. editing within the index method. any ideas?

I have avoided wiring enforcement of the metadata tool in anywhere
specific because it feels to me like a policy choice:  some sites will
want to defer enforcement, e.g. until the author is "done" with the
object and wants to submit it.  Providing defaults at creation time
seems rather less problematic, however.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com