This was exactly the hint I was looking for! Thanx a lot, I got it to work with 
no problem at all.

@Tony Oslund: since the deadline is this week I will not be able to switch away 
from FOP. But I definitely will have a look at pd4ml, I just peeked a little 
inside the examples and it seems promising ...
Besides, your point with asynchronous generation is right, however, in my case 
(again, the close deadline make my skin rise with goose bumps) I'm better off 
with a synchronous solution. If performance should be a problem, I will offer 
the customer to switch to asynchr. generation, but beforehand I will have to 
spend a few thoughts on this (how to notifiy when the PDF is complete, ...).

Thank you all for your help!

Cheers,
Alex

-----Ursprüngliche Nachricht-----
Von: Thomas Vandahl [mailto:[EMAIL PROTECTED] 
Gesendet: Samstag, 19. Jänner 2008 18:42
An: Turbine Users List
Betreff: Re: AW: Using Turbine's tools for assembling PDF output (using 
FOP):how to?

Alexander Zimmer wrote:
> How can I use template functionality? The problem involved are:
> 1. I want to use the Velocity engine and capture its output in a 
> String/ByteArray. The output will be a valid FO file.
> 2. I want to be able to use all (at least: some) pull tools Turbine provides 
> for screen templates
> I think that I've solved the other problems (how to do the streaming, how to 
> convert into PDF, ...).
> I try to dive into the VelocityOnlyLayout (as Peter Courcoux pointed out), 
> but if you have additional clues for me, I would be very happy to hear from 
> you!

You have TurbineVelocity at your disposal. 
TurbineVelocity.handleRequest(Context context, String template) is 
probably what you want. The service is used by Turbine itself so the 
Velocity engine used is completely configured and ready to use.

The service will provide you with a new context 
(TurbineVelocity.getContext(RunData data)) which is already 
pre-populated with all the pull tools you configured, but you can also 
pass it an existing, pre-populated context.

Don't forget to call TurbineVelocity.requestFinished() when you're done.


Bye, Thomas.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to