You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Beat De Martin <be...@gmx.ch> on 2003/02/02 20:12:54 UTC

SourceWritingTransformer and redirect

Hi folks
Is it possible to use SourceWritingTransformer and then a redirect. Like
this:
...
<map:transformer name="filewriter"
src="org.apache.cocoon.transformation.SourceWritingTransformer"/>
...
<map:match pattern="bestellunguebermittlung.html">
<map:act type="controller">
  <map:generate type="serverpages" src="xml/bestellung_pdf.xml"/>
  <map:transform src="xsl/bestellung_fo.xsl"/>
  <map:transform type="filewriter">
   <map:parameter name="serializer" value="fo2pdf"/>
  </map:transform>
  <map:transform src="xsl/lieferadresse.xsl"/>
  <map:serialize type="xml"/>
  <!-- this works but SourceWritingTransformer does NOT write the file -->
  <!-- map:redirect-to uri="realbestellunguebermittlung.html"/-->
</map:act>
<map:redirect-to uri="logout.html"/>
</map:match>


With <map:serialize type="xml"/> it works, but when I use redirect, the file
is not written. The redirect itself works.
Any suggestions ?

Cheers
Beat De Martin

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


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

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


Re: SourceWritingTransformer and redirect

Posted by Beat De Martin <be...@gmx.ch>.
I guess a serializer is mandatory in a pipeline.
What I did now, I used a aggregation. One map:part just writes the files and
the other one prepares the html which I want to send to the client.

<map:match pattern="bestellung">
 <map:generate type="serverpages" src="xml/bestellung.xml"/>
  <map:serialize type="xml"/>
</map:match>
<map:match pattern="bestellungmail">
  <map:generate type="serverpages" src="xml/bestellung_pdf.xml"/>
  <map:transform src="xsl/bestellung_fo.xsl"/>
  <map:transform type="filewriter">
   <map:parameter name="serializer" value="fo2pdf"/>
  </map:transform>
<map:serialize type="xml"/>
</map:match>

<map:match pattern="bestellunguebermittlung.html">
 <map:act type="controller">
  <map:aggregate element="page">
   <map:part src="cocoon:/bestellung" strip-root="true"/>
   <map:part src="cocoon:/bestellungmail" strip-root="true"/>
 </map:aggregate>
<map:transform src="xsl/bestellunguebermittlung.xsl"/>
<map:serialize type="html"/>
</map:act>
<map:redirect-to uri="logout.html"/>
</map:match>




> Hi folks
> Is it possible to use SourceWritingTransformer and then a redirect. Like
> this:
> ...
> <map:transformer name="filewriter"
> src="org.apache.cocoon.transformation.SourceWritingTransformer"/>
> ...
> <map:match pattern="bestellunguebermittlung.html">
> <map:act type="controller">
>   <map:generate type="serverpages" src="xml/bestellung_pdf.xml"/>
>   <map:transform src="xsl/bestellung_fo.xsl"/>
>   <map:transform type="filewriter">
>    <map:parameter name="serializer" value="fo2pdf"/>
>   </map:transform>
>   <map:transform src="xsl/lieferadresse.xsl"/>
>   <map:serialize type="xml"/>
>   <!-- this works but SourceWritingTransformer does NOT write the file -->
>   <!-- map:redirect-to uri="realbestellunguebermittlung.html"/-->
> </map:act>
> <map:redirect-to uri="logout.html"/>
> </map:match>
> 
> 
> With <map:serialize type="xml"/> it works, but when I use redirect, the
> file
> is not written. The redirect itself works.
> Any suggestions ?
> 
> Cheers
> Beat De Martin
> 
> -- 
> +++ GMX - Mail, Messaging & more  http://www.gmx.net +++
> NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


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

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