diff --git a/browser/concept_macros.pt b/browser/concept_macros.pt index 7215597..cd1ff1b 100644 --- a/browser/concept_macros.pt +++ b/browser/concept_macros.pt @@ -76,6 +76,7 @@ Title Type Modification Date + Author(s) Type Type + Type diff --git a/compound/blog/post.py b/compound/blog/post.py index a0372eb..a62cf9a 100644 --- a/compound/blog/post.py +++ b/compound/blog/post.py @@ -49,6 +49,7 @@ class BlogPost(Compound): _adapterAttributes = Compound._adapterAttributes + ('text', 'private', 'creator',) _contextAttributes = Compound._contextAttributes + ['date', 'privateComment'] _noexportAttributes = ('creator', 'text', 'private') + _textIndexAttributes = ('text',) defaultTextContentType = 'text/restructured' textContentType = defaultTextContentType diff --git a/concept.py b/concept.py index 06f7f0d..4da7406 100644 --- a/concept.py +++ b/concept.py @@ -26,9 +26,11 @@ from zope import component, schema from zope.app.container.btree import BTreeContainer from zope.app.container.contained import Contained from zope.app.container.interfaces import IAdding +from zope.app.security.interfaces import IAuthentication from zope.cachedescriptors.property import Lazy from zope.component import adapts from zope.component.interfaces import ObjectEvent +from zope.dublincore.interfaces import IZopeDublinCore from zope.event import notify from zope.interface import implements from zope.interface import alsoProvides, directlyProvides, directlyProvidedBy @@ -400,6 +402,7 @@ class IndexAttributes(object): actx = adapted(ctx) indexAttrs = getattr(actx, '_textIndexAttributes', ()) return ' '.join([getName(ctx), ctx.title, ctx.description] + + self.creators() + [getattr(actx, attr, u'???') for attr in indexAttrs]).strip() def title(self): @@ -407,6 +410,16 @@ class IndexAttributes(object): return ' '.join((getName(context), context.title, context.description)).strip() + def creators(self): + cr = IZopeDublinCore(self.context).creators or [] + pau = component.getUtility(IAuthentication) + creators = [] + for c in cr: + principal = pau.getPrincipal(c) + if principal is not None: + creators.append(principal.title) + return creators + # events