You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Skladov, Victor" <Sk...@his.de> on 2001/11/15 09:08:05 UTC

Cocoon: Few steps in sitemap?

Hello!

I am writing  to you all once more, because I can't find a solution up
to now.
Does anybody know how can I tell Cocoon2 to execute not one step
(XSP+XSL->and output in a format that Cocoon accept, for example HTML),
but a few steps:
1)generate from XSP with XSL a further file, say, TEX (it doesn't
matter!)
2) generate from that file (TEX in our case) a further format, for
example PDF?

OR:
Can Cocoon2 save output file? Can I force Cocoon execute my LINUX script
that lies on the server?

I would be very grateful for any ideas!

Regards,
Viktor

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Cocoon: Few steps in sitemap?

Posted by David Rosenstrauch <da...@dti.net>.
Yes.  2 options:

1) If the user won't need to access the intermediate doc:

   <map:serializer name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer" mime-type="application/pdf"/>

    <map:match pattern="yourpage">
     <map:generate type="serverpages" src="your.xsp"/>
     <map:transform src="generate_fo.xsl"/>      <!-- generate output as xsl:fo -->
     <map:serialize type="fo2pdf"/>
    </map:match>


2) If the user will need to access the intermediate doc:

<map:pipelines>
         <map:pipeline internal-only="true">
    <map:match pattern="yourpageastex">
     <map:generate type="serverpages" src="your.xsp"/>
     <map:transform src="generate_tex.xsl"/>
     <map:serialize type="text"/>
    </map:match>
         </map:pipeline>

         <map:pipeline>
         <map:match pattern="yourpageaspdf">
         <map:generate src="cocoon:/yourpageastex" type="text"/>
         <map:transform src="generate_fo_from_tex.xsl"/>
         <map:serialize type="fo2pdf"/>
         </map:match>
         </map:pipeline>
</map:pipelines>


At 09:08 AM 11/15/01 +0100, you wrote:
>Hello!
>
>I am writing  to you all once more, because I can't find a solution up
>to now.
>Does anybody know how can I tell Cocoon2 to execute not one step
>(XSP+XSL->and output in a format that Cocoon accept, for example HTML),
>but a few steps:
>1)generate from XSP with XSL a further file, say, TEX (it doesn't
>matter!)
>2) generate from that file (TEX in our case) a further format, for
>example PDF?
>
>OR:
>Can Cocoon2 save output file? Can I force Cocoon execute my LINUX script
>that lies on the server?
>
>I would be very grateful for any ideas!
>
>Regards,
>Viktor
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org> 


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Cocoon: Few steps in sitemap?

Posted by Luca Morandini <l....@tin.it>.
Viktor,

	I think this example may fit the first of your questions:

<map:pipeline>
	<map:match name="wildcard" pattern="select-resource-db.xml">
		<map:generate type="file" src="docs/all-parameters.xml"/>
      	<map:transform src="stylesheets/select-resource.xsl"/>
			<map:transform type="sql">
        		<map:parameter name="use-connection" value="noria-dev"/>
			</map:transform>
    	    	<map:serialize type="xml"/>
	</map:match>

	<map:match name="wildcard" pattern="*-resource.html">
		<map:aggregate element="page">
		<map:part src="docs/all-parameters.xml"/>
			<map:part src="docs/form-resource.xml"/>
			<map:part src="cocoon:/select-resource-db.xml"/>
		</map:aggregate>
     		<map:transform src="stylesheets/resource-{1}-html.xsl"/>
    	    	<map:serialize type="html"/>
	</map:match>
</map:pipeline>

	As you may notice the second <map:match> (the one actually being invoked
from the browser), calls the first one using <map:part
src="cocoon:/select-resource-db.xml"/> .

	The first <map:match> may be called from another <map:match> used to
deliver PDF instead of HTML, hence avoiding the need for the storage of
intermediate files.

	I use this for more complicated pipelines than the usual XML->XSL->HTML
stuff.

	I hope this helps,

---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------


> -----Original Message-----
> From: Skladov, Victor [mailto:Skladov@his.de]
> Sent: Thursday, November 15, 2001 9:08 AM
> To: cocoon-users@xml.apache.org
> Subject: Cocoon: Few steps in sitemap?
>
>
> Hello!
>
> I am writing  to you all once more, because I can't find a solution up
> to now.
> Does anybody know how can I tell Cocoon2 to execute not one step
> (XSP+XSL->and output in a format that Cocoon accept, for example HTML),
> but a few steps:
> 1)generate from XSP with XSL a further file, say, TEX (it doesn't
> matter!)
> 2) generate from that file (TEX in our case) a further format, for
> example PDF?
>
> OR:
> Can Cocoon2 save output file? Can I force Cocoon execute my LINUX script
> that lies on the server?
>
> I would be very grateful for any ideas!
>
> Regards,
> Viktor
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>