[Zope-CMF] pre- and post-filtering of STX

Tres Seaver tseaver@zope.com
25 May 2003 12:18:38 -0400


On Sun, 2003-05-25 at 09:36, martin f krafft wrote:
> what I would really like to do is allow for a method to pre- and
> post-filter the data before and after being converted to structured
> text. Looking over the source, I could not find such hooks.
> 
> Now I am wondering what the best practice is to implement this.
> I would like the filters to be subject to acquisition, and thus
> I face the problem of integration... Structured text currently is
> handled by an external method, but acquisition works only within
> ZODB.
> 
> Providing a wrapper script for STX is not an option because a lot of
> content on the site uses CookedBody() or similar, and that won't be
> subjected to the wrapper method.

Change the templates which depend on CookedBody (typically, that would
be 'document_view'), and have them call a skin method (e.g.,
'document_well_done_body').  Write a PythonScript skin method of that
name, and do whatever processing you need there.  Register this skin
method with a cache manager, to get most of the caching benefits
normally provided by CookedBody.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com