Sylvain Wallez wrote:

One more new feature ;-)

Following the thread "extending FOM" about extending processPipelineTo to SAX and DOM, I wrote a utility class that handles all this.

This class is totally decorrelated from the FOM and the "cocoon" object and provides the processToDOM(), processToSAX() and processToStream() methods. Here's a usage example to get a DOM:

var pipelineUtil = cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);

 var doc = pipelineUtil.processToDOM("my-pipeline", { foo:bar });
 // do something with "doc", such as binding to a woody form

This class replaces and extends "cocoon.processPipelineTo". Being implemented totally externally to the flow engine, it shows that this method isn't actually core to the FOM.

So what about deprecating "cocoon.processPipelineTo" from the official FOM and direct users to the new class ?

I'm +0 on this. I'm not sure where someone would specifically want an OutputStream rather than a DOM document, but the document seems higher-level.. the person can write the DOM to the disk or whatever.


Docs, docs, docs! :)


Sylvain




Regards,

Tony, almost done with the semester



Reply via email to