[Zope-CMF] How to add a new metadata property to metatdata
(defaultDublinCoreImpl)
Grégoire Weber
gregoire.weber@switzerland.org
Tue, 04 Sep 2001 12:09:21 +0200
Hi everybody!
In my CMF prototype I like to list the creator and the contributors
of a content item.
I would like to have a method 'Creators_and_Contributors' which
returns a tuple or list containing the creator and all contributors.
So I tried (as in other cases also) to hotfix the
'DefaultDublinCoreImpl' class, but without success (see code and
error message below).
It seems the variable 'security' is not available on python level.
Can somebody give me a hint or a better solution where I do not have
to alter the CMF code?
Anyway, isn't this something which should be in the CMF per default?
Greg
P.S.: I am working with Zope 2.3.3 and CMF 1.1 on WinNT4sp6
---------------------------------------------------------------------
The code of my hotfix product (filename __init__.py)::
from Products.CMFdefault.DublinCore import DefaultDublinCoreImpl
from AccessControl import ClassSecurityInfo
security = DefaultDublinCoreImpl.security
security.declarePublic( 'Creator_and_Contributors' )
def Creator_and_Contributors(self):
"Dublin Core element - return list with creator and contributors"
return (self.Creator(),) + self.Contributors()
DefaultDublinCoreImpl.Creator_and_Contributors = Creator_and_Contributors
Error message at zope startup::
2001-09-04T09:59:12 ERROR(200) Zope Couldn't import
Products.CMFDefaultHotfix
Traceback (innermost last):
File D:\prog\zope\lib\python\OFS\Application.py, line 528, in
import_products
(Object: string)
File F:\user\greg\data\zope\Products\CMFDefaultHotfix\__init__.py, line
96, in ?
AttributeError: security
_____________________________________
Grégoire Weber
mailto:gregoire.weber@switzerland.org