You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Stephan <st...@gmx.de> on 2011/03/12 10:32:15 UTC

[camel-velocity] Additional context objects possible to inject?

Hi,

currently I'm playing arround with camel-velocity in order to decide,
whether we can easily introduce Camel and reuse our existing Velocity
templates (a lot).

Our current templates using many different context objects with names like
$config, $baseUrl and so on. These objects are "global" values and not part
of the message itself and therefore in term are not accessible in the
template, using the new Camel "way".

Havin read the documentation for camel-velocity so far, I found out, that
the message body will be set into the template context using the name $body,
but there seems to be no way in order to set additional objects (for example
spring beans).

I'm thinking of something like:

to("velocity://templatePath?config=${bean:configBean})

in order to set additional objects into the velocity template. Is there such
a mechanism available?

Thanks in advance.

Regards
Stephan

Re: [camel-velocity] Additional context objects possible to inject?

Posted by Claus Ibsen <cl...@gmail.com>.
On Sat, Mar 12, 2011 at 10:32 AM, Stephan <st...@gmx.de> wrote:
> Hi,
>
> currently I'm playing arround with camel-velocity in order to decide,
> whether we can easily introduce Camel and reuse our existing Velocity
> templates (a lot).
>
> Our current templates using many different context objects with names like
> $config, $baseUrl and so on. These objects are "global" values and not part
> of the message itself and therefore in term are not accessible in the
> template, using the new Camel "way".
>
> Havin read the documentation for camel-velocity so far, I found out, that
> the message body will be set into the template context using the name $body,
> but there seems to be no way in order to set additional objects (for example
> spring beans).
>
> I'm thinking of something like:
>
> to("velocity://templatePath?config=${bean:configBean})
>
> in order to set additional objects into the velocity template. Is there such
> a mechanism available?
>

No there is not.



> Thanks in advance.
>
> Regards
> Stephan
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/