velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodrigo Reyes" <rodr...@instaservi.com>
Subject Re: Character precision...
Date Wed, 13 Aug 2003 17:26:00 GMT
Thanx Dave... I will give this a try...

Rodrigo

----- Original Message ----- 
From: "Dave Newton" <dave@solaraccess.com>
To: "Velocity Users List" <velocity-user@jakarta.apache.org>
Sent: Wednesday, August 13, 2003 11:52 AM
Subject: Re: Character precision...


> On Wed, 2003-08-13 at 12:15, Rodrigo Reyes wrote:
> > Mmmm... Interesting... Please, give me an example...
> > > Liberal sprinklings of the ## (double comment character) really spruce
> > > things up a bit. I generate text emails with velocity all the time; as
> > > long as I ## lots of places I'm ok.
>
> Here's an example of the top of one of my really old template files. The
> interesting bit for you may be the trailing ## so that the output of the
> macro doesn't get a newline.
>
> Hope this helps!
>
> Dave
>
> ##--------------------------------------------------------------------
> ## Macros and misc
> ##--------------------------------------------------------------------
> #macro(cdval $cd)
> #if (${cd.quote})
> #if(${cd.sqlified})
> "'" + StringUtils.sqlify(${cd.name.lower()}) + "'"##
> #else
> "'" + ${cd.name.lower()} + "'"##
> #end
> #else
> ${cd.name.lower()}##
> #end
> #end
> ##
> ##
> #macro(tscast $col)
> #if (${col.isdate})
> (FigTimestamp) ##
> #end
> #end
> ##
> ##--------------------------------------------------------------------
> ## Header stuff
> ##--------------------------------------------------------------------
> ##
> package ${beaninfo.packagename};
>
> import java.sql.*;
>
> import com.solaraccess.util.StringUtils;
> import com.solaraccess.util.SolarException;
> #if (${beaninfo.havetimestamp})
> import com.solaraccess.util.FigTimestamp;
> #end
>
> /**
>  * ${beaninfo.tablename} row bean
>  */
>
> public class ${classname} extends DBRow {
>
> [... snip ...]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org



Mime
View raw message