You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2011/05/31 03:23:47 UTC

[jira] [Resolved] (SMX4-851) Velocity bundle - Add dynamic imports so the #parse macro can load the resource

     [ https://issues.apache.org/jira/browse/SMX4-851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Fang resolved SMX4-851.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 4.4.0

commit fix
http://svn.apache.org/viewvc?rev=1129449&view=rev

> Velocity bundle - Add dynamic imports so the #parse macro can load the resource
> -------------------------------------------------------------------------------
>
>                 Key: SMX4-851
>                 URL: https://issues.apache.org/jira/browse/SMX4-851
>             Project: ServiceMix 4
>          Issue Type: Task
>          Components: Bundles
>            Reporter: Claus Ibsen
>            Assignee: Freeman Fang
>             Fix For: 4.4.0
>
>
> Velocity templates can contain a macro which includes another template. And that template is loaded from the classpath.
> However with OSGi its not so easy to have this working as its VelocityEngine that loads that resource. And its classloader do not have imports to any end users packages where his/hers .vm template files reside. 
> So if possible maybe the SMX bundle of Velocity can have a dynamic import. So we have a chance of loading those template files using #macro
> For example you may have a .vm file in org/apache/camel/itest/osgi/velocity/example.vm which includes another .vm file from the classpath.
> {code}
> #parse("org/apache/camel/itest/osgi/velocity/header.vm")
> <hello>${headers.cheese}</hello>
> {code}
> When #parse is executed its VelocityEngine that takes over and load that resource. And this its a different classloader tree we end up taking.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira