cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Burton" <>
Subject AbstractProcessor
Date Tue, 14 Mar 2000 13:48:35 GMT

This morning I started to write another Cocoon processor (which generates
directory listings basically) and realised that I was writing the same code
again and again and....

All of my processors have been modelled after the process() method in the
SQL and LDAP processors supplied with Cocoon, after some dumbing-down as
what I've been writing has been fairly simple (the most useful was a bridge
to a XQL engine).  I decided to create an AbstractProcessor class which does
this for you - it will take all instances of a specified node, create a
Dictionary of the attributes, override this with parameters in the request
URL, and get the text contained within the nodes.  This is passed to an
abstract method which returns a DocumentFragment, which is then replaced for
the original node.

Also attached is a test processor, basically it will take all <dummy>this is
a test</dummy> nodes and replace them with <dummy>tset a si siht</dummy>.

Comments, critism, flames and proposals all welcome (yes, when Cocoon 2
comes out I'll probably rework it in SAX)

Ross Burton

View raw message