Re: adding metadata (using metadata access handlers)

Jan-Wijbrand Kolman <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Organization Infrae
Message-ID <[email protected]>
Andy Altepeter wrote:
> (resurrecting an old thread)
> 
> I asked awhile ago about conditionally displaying/using metadatasets on a 
> content type.  Specifically, I wanted to show a custom metadata set on 
> SilvaDocuments that were under a certain directory path.  jw was very helpful 
> in pointing me in the right direction.  I thought it may be a good idea to 
> post some documentation on this, especially since it seems little-used but 
> very useful (for me!).  Anyways, here's a link:
> 
> http://altepeter.net/tech/sm-access-handlers/

That's great!! Thanks!!


BTW, with the Silva-1.3 (and thus Silva.14 too) releases, SilvaMetadata gained a 
number of convenience methods for adding and removing metadata-to-type-mappings 
(the original API is rather, uhm, cumbersome, to say the least).

If you're interested, have a look at:

SilvaMetadata/MetadataTool.py:

     def initializeMetadata(self):
         ....
     def addTypesMapping(self, types, setids, default=''):
         ....
     def addTypeMapping(self, type, setids, default=''):
         ....
     def removeTypesMapping(self, types, setids):
         ....
     def removeTypeMapping(self, type, setids):
         ....

So, these methods are available on the service_metadata. This can drastically 
simplify the installation code for metadata sets.


kind regards,
jw

-- 
Jan-Wijbrand Kolman
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.