You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by wa...@philips.com on 2004/08/06 14:43:23 UTC
How to deal with multiple pages (meta-velocity?)
Hi,
How do you generate multiple pages from a single data structure with
Velocity?
To name a few possibilities:
- When there are multiple templates, that each lead to 1 target document:
run Velocity once for each template (Works well when generating J2EE
Remote / RemoteHome interfaces)
- When there is a single data structure, that leads to multiple documents:
iterate the data structure in java source, and run velocity using the same
template once for each iteration (Works fine, but requires java
programming)
- A velocimacro: #nestedMerge($rootObject $templateName $outputFileName),
that calls a Java method that performs the merge (No experience (yet, this
one came up while writing this question))
Any other possibilities, experiences, comments?
Thanks,
Walter
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: How to deal with multiple pages (meta-velocity?)
Posted by Daniel Dekany <dd...@freemail.hu>.
Friday, August 6, 2004, 2:43:23 PM, walter.van.iterson@philips.com wrote:
> Hi,
>
> How do you generate multiple pages from a single data structure with
> Velocity?
>
> To name a few possibilities:
> - When there are multiple templates, that each lead to 1 target document:
> run Velocity once for each template (Works well when generating J2EE
> Remote / RemoteHome interfaces)
> - When there is a single data structure, that leads to multiple documents:
> iterate the data structure in java source, and run velocity using the same
> template once for each iteration (Works fine, but requires java
> programming)
> - A velocimacro: #nestedMerge($rootObject $templateName $outputFileName),
> that calls a Java method that performs the merge (No experience (yet, this
> one came up while writing this question))
>
> Any other possibilities, experiences, comments?
What I did in a file generator utility that uses another similar
template engine (some of the readers will find out which... ;)), so it
possibly works with Velocity as well: there is a Writer where the output
goes. That Writer is a custom Writer subclass, that has a method to
switch the output file, and that method can be invoked from the
templates with a "tool".
--
Best regards,
Daniel Dekany
____________________________________________________________________
Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
Probald ki most! http://www.freestart.hu
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org