[Zope-CMF] DC Metadata aquisition, how to have a child use it's parent's Met adata

Jean-Francois.Doyon@CCRS.NRCan.gc.ca Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Tue, 29 Jul 2003 11:12:33 -0400


Hello,

I have a CMF object-type which is both contentish and folderish.  This =
means
that it has it's own DC Metadata, and contains objects that also have =
their
own.

Now, due to the nature of the organization of the content, I would like
certain of the children to simply appear as having their own metadata =
when
actually they should link dirrectly to the parent's ...

I'm looking for the best, most dynamic and flexible way to do this.

The easiest, though not fun to maintain, would be to overload all the
DefaultDublinCoreImpl methods one by one and have them refer to the =
parent.
This is a pain to maintain since I extend the existing Metadata
implementation with my own non-DC elements.

I was however hoping I could use some automated way of doing this, =
possibly
by making use of the DefaultDublinCoreImpl.__dict__ , figuring out the
"functions" and mapping them to the child class instances ... I've =
toyed
wiht this though I'm not sure how I would get the mapping part done =
properly
(I can easily figure out the methods declared by the class, just not =
sure
how to "merge" them with my own) ...

There's also the possibility of using __getattr__ ... But then I need a =
way
of discovering what attributes are managed by the DefaultDublinCoreImpl
class, which there isn't.

The idea here is that I won't want to have to hardcode anything into my
class, since the DublinCore implementation may change ...

Anybody know how to go about doing this, or even if it's at all =
possible ?
(Python being so dynamic in nature, I'd expect this is doable)

Thanks in advance for the help!

Jean-Fran=E7ois Doyon
Internet Service Development and Systems Support
GeoAccess Division
Canadian Center for Remote Sensing
Natural Resources Canada
http://atlas.gc.ca
Phone: (613) 992-4902
Fax: (613) 947-2410