Tony Collen wrote:

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.


Note that the new class provides 3 outputs: stream, SAX and DOM. So the discussion isn't about which is of higher level, but if this feature belongs to the FOM core (my opinion is no).

Docs, docs, docs! :)


Write them, write them, write them ;-P

Sylvain

Regards,

Tony, almost done with the semester


Keep up 'till the end!

Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com




Reply via email to