cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Hoskens ...@schaubroeck.be>
Subject Re: Chaining
Date Thu, 06 Jan 2005 13:13:27 GMT
Mark Donnelly wrote:
> Sorry but my question was incorrectly stated.
> 
> A standard pipeline with a transform and a serialise will take care of the
> problem I originally posted.
> 
> What Im wondering is if I need to do multiple transformations, ie transform
> an XML doc using two or more different XSLT docs. and then
> feed the results into various serialisers, how this is done?
> 

What do you mean various serializers? You cannot send multiple responses 
back to a client. But if you want to be able to get the same page in 
different formats, you may want to use views (if I remember correctly):

<map:view from-label="pdf" name="pdf">
	<map:transform src="stylesheets/page2pdf.xsl"/>
	<map:serialize type="fo2pdf"/>
</map:view>

then in your pipe:

<map:match...

	<map:sometransformer label="pdf"/> <!-- this label says, you can have 
another view behind me using the from-label -->
	<map:serialize type="html"/>
</map:match>

and call this with "myURL?cocoon-view=pdf" to get the pdf version. (look 
at http://cocoon.apache.org/2.1/userdocs/concepts/views.html for more info)

If you want to have some other pipeline executed eg: write some document 
to disk and send a reply with another pipe, you can use the following in 
your flow:

var pipelineUtil = 
cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
var document = pipelineUtil.processToDOM("mypipe", null);
(or processToSAX/processToStream)
cocoon.sendPage("otherpipe");


Is this what you're referring to? Or can you give a concrete example of 
what you're trying to do?

Kind Regards,
Jan


> Mark
> 
> -----Original Message-----
> From: Mark Donnelly [mailto:mark.donnelly@strategixsoftware.com]
> Sent: 06 January 2005 12:54
> To: 'users@cocoon.apache.org'
> Subject: Chaining
> 
> 
> Hello,
> 
> Im looking to chain a number of 'actions' together:
> 
> 1. Transform an XML document using XSLT to get XSL:FO
> 2. Put this XSL:FO into FOP to get pdf.
> 
> Im new to Cocoon and whilst Ive read a fair bit of the documentation, I
> havent been able to fathom what a pipeline for this would look like. 
> Ive got an idea of how to create each one independantly but not sure how to
> take the output of 1. and feed it into 2. on the fly.
> 
> Any pointers would be appreciated.
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.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