[Zope-CMF] CMF Events and use of metadata

David Harvey (Hamish) david.harvey@bristol.ac.uk
19 Apr 2002 18:18:26 +0100


I've just been teaching myself to jump through hoops, trying to get some
new meta data elements to work consistently across content types. Tim
Hoffman was a great help to me in my efforts to get extra elements into
the DefaultDublinCoreImpl class, and I'm seriously impressed with the
flexibility afforded by hot fixes in this way.

After extending it in this way, that class is still aptly named, if the
extensions are considered as qualified Dublin Core elements. Since the
element I added was to define the "subdisciplines" to which the item had
relevance, it seems to be a reasonable qualification of the Subject
element.

What forced me into adding my own element was the fact that Event makes
use of the "Subject" field to store the type of event (Meeting,
Convention, etc). While this is an equally valid qualification of
"Subject" it throws a huge spanner in the works for people who want to
use "Subject" consistently across a site. I've only just (touch wood)
rattled out the implications of this - the Plone event_edit.py script
has a rather different structure to its kindred *edit.py forms and,
crucially, doesn't include this

if hasattr(context, 'extended_edit'):
    edit_hook=getattr(context, 'extended_edit')
    response=edit_hook()
    if response:
        return response

which seems to be responsible for passing through metadata if necessary,
and in the absence of which some identical changes I made to the
*edit_form.pt files worked with all types _except_ Events. 

So, two things, the first a request (can be put in the skinTracker if
needs be), the second might be a point for discussion, I haven't been
around long enough to know how you work round here.

1) For alan runyan: Is there any way the event_edit.py script can be
brought in to line with the other edit.py scripts such that it
(apparently) passes through extra fields to extended_edit.py. This meant
that for other content types, all I had to do to get data into my new
metadata element was to include an appropriately named field in the edit
form. I've cut and pasted code, and it appears to work, but I wouldn't
like to make any predictions about the side effects with my limited
(growing) knowledge of Zope/CMF/Plone.

2) General: Is is a good idea to use a metadata field as general as
Subject for a product-specific purpose? A new metadata element such as
EventTypeSubject might be more appropriate. In fact, I'm not at all sure
that the meeting type is meta data at all - it seems to be an important
part of the content item!

Time for a beer before the sun goes down....
Cheers, and have a good weekend,
Hamish

-- 
David Harvey (aka Hamish)
Network Coordinator, FloodRiskNet
Research Assistant, Water and Environmental Management Research Centre
University of Bristol, Lunsford House, Cantock's Close, Bristol BS5 6BU
Email: david.harvey@bristol.ac.uk
GPG/PGP Key Fingerprint: 6F15 A1C7 342F 2F87 E2CC  176D 1072 8A5B 20E8
E497
WWW: http://www.cen.bris.ac.uk/civil/pgra/dph/dph.htm