You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Dave Briccetti <da...@davebsoft.com> on 2004/04/04 01:33:04 UTC

$link with TurbineVelocity.getContext

Hi. I have created a turbine service which periodically sends off emails
using Velocity. I would like to use $link in the velocity templates, but
I don't think it's in the context returned by
TurbineVelocity.getContext().

I've tried creating a TemplateLink in a global scope, but the
initialization fails. 

Suggestions? Thanks.
-- 
Dave Briccetti Software Consulting
http://www.davebsoft.com, (925) 945-7565


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: $link with TurbineVelocity.getContext

Posted by Brian Lawler <br...@tribenetwork.com>.
You may need to just instantiate a TemplateLink object and pass in a 
ServerData object to fill out the right data for the URL's.  We do this 
for daily e-mail digests as well.  The code looks like this:

  [ ... ]

         logger.debug("Creating velocity context");
         VelocityContext ctxt = new VelocityContext();
         ServerData sd = new 
ServerData("www.tribe.net",80,"http","/tribe/servlet","");
         TemplateLink link = new TemplateLink(sd);

         ctxt.put("link",link);

   [ ... ]

Hope this helps...

-Brian

On Apr 3, 2004, at 3:33 PM, Dave Briccetti wrote:

> Hi. I have created a turbine service which periodically sends off 
> emails
> using Velocity. I would like to use $link in the velocity templates, 
> but
> I don't think it's in the context returned by
> TurbineVelocity.getContext().
>
> I've tried creating a TemplateLink in a global scope, but the
> initialization fails.
>
> Suggestions? Thanks.
> -- 
> Dave Briccetti Software Consulting
> http://www.davebsoft.com, (925) 945-7565
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: $link with TurbineVelocity.getContext

Posted by Eric Pugh <ep...@upstate.com>.
Check out the StaticLink object from scarab.tigris.org, which does that...

Eric

> -----Original Message-----
> From: Dave Briccetti [mailto:daveb@davebsoft.com]
> Sent: Sunday, April 04, 2004 1:33 AM
> To: turbine-user@jakarta.apache.org
> Subject: $link with TurbineVelocity.getContext
> 
> 
> Hi. I have created a turbine service which periodically sends off emails
> using Velocity. I would like to use $link in the velocity templates, but
> I don't think it's in the context returned by
> TurbineVelocity.getContext().
> 
> I've tried creating a TemplateLink in a global scope, but the
> initialization fails. 
> 
> Suggestions? Thanks.
> -- 
> Dave Briccetti Software Consulting
> http://www.davebsoft.com, (925) 945-7565
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org