You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gerry Kaplan <gk...@kaplansoftware.com> on 2005/09/19 20:57:45 UTC
XSL-FO Output document name
Is there a way to set the name of the document that gets created from the
output of the FOP transformer? I'd like to be able to set it to a meaningful
name.
Thanks
Gerry
Re: XSL-FO Output document name
Posted by Joose Vettenranta <jo...@iki.fi>.
Hi,
like this:
<map:act type="set-header">
<map:parameter name="Content-Disposition" value='attachment ;
filename="report-{2}.pdf"'/>
</map:act>
HTH, Joose
Gavin Carothers kirjoitti 19.9.2005 kello 22:53:
> Well, that's going to return a file named "print-report"
>
> something closer to what you want might be:
>
> <map:match pattern="**/print-report-*-*.pdf">
> <!-- Where *-* are the values that used to be */*/pr... -->
> <map:generate src="cocoon:/internal/get-report/{2}/{3}.fo"/>
> <map:serialize type="fo2pdf"/>
> </map:match>
>
> since in your case the file name is coming from the URL. The
> <source:source>
> tags are used when using the SourceWritingTransformer to write the
> stream OUT
> of the stream returned by cocoon. Generating a PDF file that is
> saved to
> another server or somewhere else for later use rather then being
> returned.
>
> Cheers,
> Gavin
>
>
> On Monday 19 September 2005 3:35 pm, Gerry Kaplan wrote:
>
>> This is exactly what I have:
>> <map:match pattern="*/*/print-report">
>> <map:generate src="cocoon:/internal/get-report/{1}/{2}.fo"/>
>> <map:serialize type="fo2pdf"/>
>> </map:match>
>>
>> What are the <source:source> tags? Where should they go and what
>> do they
>> belong to?
>> Thanks for your response!
>> Gerry
>>
>> -----Original Message-----
>> From: Gavin Carothers [mailto:gcarothers@amesondemand.com]
>> Sent: Monday, September 19, 2005 3:07 PM
>> To: users@cocoon.apache.org
>> Subject: Re: XSL-FO Output document name
>>
>> On Monday 19 September 2005 2:57 pm, Gerry Kaplan wrote:
>>
>>> Is there a way to set the name of the document that gets created
>>> from
>>> the output of the FOP transformer? I'd like to be able to set it
>>> to a
>>> meaningful name.
>>>
>>> Thanks
>>> Gerry
>>>
>>
>> I assume you have something like:
>>
>> <map:pipeline>
>> <map:match pattern="*.pdf">
>> <map:generate src="a-file.xml" type="file"/>
>> <map:transform src="to-fo.xsl"/>
>> <map:serialize type="fo2pdf"/>
>> </map:match>
>> </map:pipeline>
>>
>> In that case the name of the file should be whatever was specified
>> in the
>> URL.
>> If your using the SourceWritingTransformer then you can set it in the
>> <source:source></souce:source> tag. If your doing something else
>> perhaps
>> you could explain the situation?
>>
>> Cheers,
>> Gavin
>>
>>
>> --
>> This email is: [ ] actionable [x] fyi [ ] social Response needed:
>> [ ] yes
>> [x] up to you [ ] no
>> Time-sensitive: [ ] immediate [ ] soon [x] none
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>
> --
> This email is: [ ] actionable [X] fyi [ ] social
> Response needed: [ ] yes [X] up to you [ ] no
> Time-sensitive: [ ] immediate [ ] soon [X] none
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: XSL-FO Output document name
Posted by Gavin Carothers <gc...@amesondemand.com>.
Well, that's going to return a file named "print-report"
something closer to what you want might be:
<map:match pattern="**/print-report-*-*.pdf">
<!-- Where *-* are the values that used to be */*/pr... -->
<map:generate src="cocoon:/internal/get-report/{2}/{3}.fo"/>
<map:serialize type="fo2pdf"/>
</map:match>
since in your case the file name is coming from the URL. The <source:source>
tags are used when using the SourceWritingTransformer to write the stream OUT
of the stream returned by cocoon. Generating a PDF file that is saved to
another server or somewhere else for later use rather then being returned.
Cheers,
Gavin
On Monday 19 September 2005 3:35 pm, Gerry Kaplan wrote:
> This is exactly what I have:
> <map:match pattern="*/*/print-report">
> <map:generate src="cocoon:/internal/get-report/{1}/{2}.fo"/>
> <map:serialize type="fo2pdf"/>
> </map:match>
>
> What are the <source:source> tags? Where should they go and what do they
> belong to?
> Thanks for your response!
> Gerry
>
> -----Original Message-----
> From: Gavin Carothers [mailto:gcarothers@amesondemand.com]
> Sent: Monday, September 19, 2005 3:07 PM
> To: users@cocoon.apache.org
> Subject: Re: XSL-FO Output document name
>
> On Monday 19 September 2005 2:57 pm, Gerry Kaplan wrote:
> > Is there a way to set the name of the document that gets created from
> > the output of the FOP transformer? I'd like to be able to set it to a
> > meaningful name.
> >
> > Thanks
> > Gerry
>
> I assume you have something like:
>
> <map:pipeline>
> <map:match pattern="*.pdf">
> <map:generate src="a-file.xml" type="file"/>
> <map:transform src="to-fo.xsl"/>
> <map:serialize type="fo2pdf"/>
> </map:match>
> </map:pipeline>
>
> In that case the name of the file should be whatever was specified in the
> URL.
> If your using the SourceWritingTransformer then you can set it in the
> <source:source></souce:source> tag. If your doing something else perhaps
> you could explain the situation?
>
> Cheers,
> Gavin
>
>
> --
> This email is: [ ] actionable [x] fyi [ ] social Response needed: [ ] yes
> [x] up to you [ ] no
> Time-sensitive: [ ] immediate [ ] soon [x] none
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
--
This email is: [ ] actionable [X] fyi [ ] social
Response needed: [ ] yes [X] up to you [ ] no
Time-sensitive: [ ] immediate [ ] soon [X] none
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: XSL-FO Output document name
Posted by Gerry Kaplan <gk...@kaplansoftware.com>.
This is exactly what I have:
<map:match pattern="*/*/print-report">
<map:generate src="cocoon:/internal/get-report/{1}/{2}.fo"/>
<map:serialize type="fo2pdf"/>
</map:match>
What are the <source:source> tags? Where should they go and what do they
belong to?
Thanks for your response!
Gerry
-----Original Message-----
From: Gavin Carothers [mailto:gcarothers@amesondemand.com]
Sent: Monday, September 19, 2005 3:07 PM
To: users@cocoon.apache.org
Subject: Re: XSL-FO Output document name
On Monday 19 September 2005 2:57 pm, Gerry Kaplan wrote:
> Is there a way to set the name of the document that gets created from
> the output of the FOP transformer? I'd like to be able to set it to a
> meaningful name.
>
> Thanks
> Gerry
I assume you have something like:
<map:pipeline>
<map:match pattern="*.pdf">
<map:generate src="a-file.xml" type="file"/>
<map:transform src="to-fo.xsl"/>
<map:serialize type="fo2pdf"/>
</map:match>
</map:pipeline>
In that case the name of the file should be whatever was specified in the
URL.
If your using the SourceWritingTransformer then you can set it in the
<source:source></souce:source> tag. If your doing something else perhaps you
could explain the situation?
Cheers,
Gavin
--
This email is: [ ] actionable [x] fyi [ ] social Response needed: [ ] yes
[x] up to you [ ] no
Time-sensitive: [ ] immediate [ ] soon [x] none
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: XSL-FO Output document name
Posted by Gavin Carothers <gc...@amesondemand.com>.
On Monday 19 September 2005 2:57 pm, Gerry Kaplan wrote:
> Is there a way to set the name of the document that gets created from the
> output of the FOP transformer? I'd like to be able to set it to a
> meaningful name.
>
> Thanks
> Gerry
I assume you have something like:
<map:pipeline>
<map:match pattern="*.pdf">
<map:generate src="a-file.xml" type="file"/>
<map:transform src="to-fo.xsl"/>
<map:serialize type="fo2pdf"/>
</map:match>
</map:pipeline>
In that case the name of the file should be whatever was specified in the URL.
If your using the SourceWritingTransformer then you can set it in the
<source:source></souce:source> tag. If your doing something else perhaps you
could explain the situation?
Cheers,
Gavin
--
This email is: [ ] actionable [x] fyi [ ] social
Response needed: [ ] yes [x] up to you [ ] no
Time-sensitive: [ ] immediate [ ] soon [x] none
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org