[Zope-CMF] Re: modifying TypeInformation's properties
yuppie
y.2004_ at wcm-solutions.de
Fri Sep 3 03:50:25 EDT 2004
Hi!
Jean-Marc Orliaguet wrote:
> when you have portal types that are all derived from the same base type
> you want to be able to tag them as belonging to a same given category,
> for instance portlets are all derived from a CPSPortlet.py class and
> 'cps_is_portlet' is being used to identify them.
>
> security.declarePublic('listPortletTypes')
> def listPortletTypes(self):
> """Return the list of all defined portal_types which are portlets
>
> It means having the 'CPS Portlet' flag
> """
> ttool = getToolByName(self, 'portal_types')
> returned = []
> for id in ttool.objectIds():
> fti = getattr(ttool, id)
> if getattr(fti, 'cps_is_portlet', 0) == 1:
> returned.append(id)
> return returned
>
> how would you do otherwise? use a dummy action called 'isportlet' ?.
Maybe special kinds of types should have their own Type Information
class? Factory-based Type Information and Scriptable Type Information
are made for ordinary content types.
In general, I'd like to see a discussion about questions like these:
- Do we need more or less configuration options in the type info
objects? See <http://collector.zope.org/CMF/33> for a proposal to remove
"allow discussion" configuration from type infos.
- Is the current default schema up to date, or should some fields be
added / modified?
- If we allow to add arbitrary fields to FTIs and STIs, how do
components play together? Are the content types responsible for setting
these values or the components that use these fields?
Cheers,
Yuppie
More information about the Zope-CMF
mailing list