velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christoph Reck (JIRA)" <>
Subject [jira] Updated: (VELOCITY-441) Provide class to be called from command-line to translate any file with special suffix.
Date Mon, 29 May 2006 07:50:30 GMT
     [ ]

Christoph Reck updated VELOCITY-441:


find attached a tool using anakia for transformations. It may also take CSV or just run a
plain VTL file against the context.

It may use a CSV tool, Anakia, DOM reader and/or a XmlConfiguration reader.
The setup of these tools should be replaced by the VelocityToolbox manager (Nathan there was
a thread on this...). Use examples:
#set( $now = $date.clone() )
#set( $LF = $Context.formDecode("%0A") )
#set( $Integer = 1 )
#set( $Long = $Integer.longValue() )
#set( $cdLimit = $Long.valueOf("640000000") )

I also used a ClassTool to setup e.g. a FileWriter:
## ------------------------------------------------------------------------
## Macro to write a text to a file.
## ------------------------------------------------------------------------
#macro( fileWrite $filename $text )
  #set( $out = $Class.newInstance("", $filename) )
  #set( $data = $text.getBytes() )
  #call( $out.write($data) )
  #call( $out.close() )

It would also be sensible to add a command line parameter to define the VelociMacro file
to load at startup (maybe via ToolboxManager?).


> Provide class to be called from command-line to translate any file with special suffix.
> ---------------------------------------------------------------------------------------
>          Key: VELOCITY-441
>          URL:
>      Project: Velocity
>         Type: Improvement

>   Components: Build
>     Versions: 1.4
>  Environment: WindowsXP
>     Reporter: Colbert Philippe
>  Attachments:
> This is a simple but important feature to have.   To standadize the use of Velocity,
provide a class that can be called from the command-line that will do the translation from
*.vm ---> final-file.   The class will look for any file that has one of the special suffixes
(specified by as parameters) and will translate it.
> The name convention for the translation would like this that:
> someFileName.velocity ---> someFileName
> someFileName.vm ---> someFileName
> Example:
> myFile.html.velocity ---> myFile.html
> The user would specify the list of suffixes as parameter in Java (like String[] suffixes
= { ".velocity", ".vm" }.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message