[Zope3-Users] Stuck on configuration of extra folder metadata
Cliff Ford
Cliff.Ford at ed.ac.uk
Fri Apr 29 05:49:26 EDT 2005
To partly answer my own question, I found this configuration works:
<!-- Extra Metadata -->
<!--
<adapter
for=".interfaces.IFolderInformable"
provides=".interfaces.IFolderInfo"
factory=".folderinfo.FolderInfo"
trusted="true"
/>
-->
<!-- store metadate on a standard folder object -->
<adapter
for="zope.app.folder.interfaces.IFolder"
provides=".interfaces.IFolderInfo"
factory=".folderinfo.FolderInfo"
trusted="true"
/>
<!-- store metadata on a custom content object -->
<adapter
for=".interfaces.IGlgPage"
provides=".interfaces.IFolderInfo"
factory=".folderinfo.FolderInfo"
trusted="true"
/>
And the .interfaces.IFolderInfo from my initial posting below is not
needed (it should have been .interfaces.IFolderInformable anyway). I
don't know why I don't have to configure the abstract IAnnotatable
class, perhaps because both classes I am interested in are already
IAttributeAnnotatable. I also think I learned a lot about how to use the
annotations from page templates. An example:
<div tal:define="info python:view.getFolderInfo(context).getdata()">
...
</div>
Sorry this is a bit of a blog, but anyone searching the archives for
answers might find it useful.
Cliff
Cliff Ford wrote:
>
> I want to keep some extra metadata in a folder instance (by extra I mean
> other than Dublin Core). I have produced the components necessary to
> store the extra metadata on one of my own content objects but I don't
> know how to change the configuration so that it applies to a normal
> folder. Can anyone enlighten me?
>
> Cliff
>
> I have this in configure.zcml:
>
> <content class=".mypage.MyPage">
> <implements
> interface="zope.app.annotation.interfaces.IattrubuteAnnotatable
> .interfaces.IFolderInfo"
> />
> ...
>
> The .interfaces.IFolderInfo needs to be applied to a folder rather than
> my own content object.
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
More information about the Zope3-users
mailing list