cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: Woody/CForms: Extending bound XML through pipeline
Date Thu, 06 May 2004 16:56:42 GMT
On Thu, 2004-05-06 at 15:44, Askild Aaberg Olsen wrote:
> I have a document bound to a form, and whenewer a specific event occurs, I
> would like to:
>  * pass the bound document to a pipeline
>  * transform it
>  * redisplay the form again with the transformed document.
> 
> This is my current approach to the on-action in the model:
> 
> <wd:on-action>
> 	<javascript>
> 		form.save(document);
> 			...somthing that runs the document through the
> pipeline...
> 		form.load(document);
> 	</javascript>
> </wd:on-action>
> 
> This approach seems to work, e.g. the document is correctly redisplayed in
> the form, but I lack the part running the document through the pipeline.
> 
> Any clues or hints, or am I way off here conceptually?

Regardless of what you're trying to do makes sense (what do you want to
do with the document in the pipeline?), some hints:

org.apache.cocoon.components.flow.util.PipelineUtil.processToDOM(...)
will help you to execute a pipeline and capture the result in a DOM
tree.

To make the current document available to that pipeline, you can pass it
as 'viewData' (second argument of processToDOM method), and use the
xmodule source (see scratchpad) in combination with the flow-attribute
input module to let the pipeline's generator read from that document.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message