0

I'm using Apache Cocoon 2.2 and I want to change the default name of the generated pdf file when i try to download it from the browser. This part of the pipeline generates a PDF with pdf_parameter as its default name.

<map:match pattern="pdf_*">
   <map:generate src="data.xml"/>
   <map:transform src="file.xsl" type="xslt"/>              
   <map:serialize type="fo2pdf"/>
</map:match>

How can i do it?

Fernando Prieto
  • 520
  • 1
  • 6
  • 19

1 Answers1

0

You can use a reader to achieve this kind of purpose. E.g. :

<map:match pattern="renamed_*_file.pdf">    
  <map:read src="cocoon:/pdf_{1}" />
  <!--+
      !  modify the src attribute above so that it matches 
      !  the original pipeline's URL pattern 
      +-->
</map:match>

You can elaborate on this principle to meet your specific requirements

(the OP wants to "change the default filename", but didn't say to what).

Alain BECKER
  • 787
  • 5
  • 15