[Simple-support] Framework limitation? Session map, template system and the "class" attribute of el
Brought to you by:
niallg
|
From: Timo R. <cr...@ol...> - 2008-04-12 22:00:20
|
Hello,
I have a question regarding the persister callback session map and the
template system (appropriate documentation section is "Maintaining
state between persister callbacks").
I have a XML file, which looks like this:
-------------
<MyObjects>
<MyInterface class="net.test.lib.concurrent.theme.InterfaceImpl1"/>
<MyInterface class="net.test.lib.concurrent.theme.InterfaceImpl2"/>
<MyInterface class="net.test.lib.concurrent.theme.InterfaceImpl3"/>
</MyObjects>
-------------
The XML above is of course only a simplification of the real
structure. There are a lot of entries for "<MyInterface...", and every
entry has the same packge but a different class (it is always
"net.test.lib.concurrent.theme.").
Now it would be really nice to replace those package declarations with
a template variable, so the XML looks like this:
-------------
<MyObjects>
<property name="package" value="net.test.lib.concurrent.theme"/>
<MyInterface class="${package}.InterfaceImpl1"/>
<MyInterface class="${package}.InterfaceImpl2"/>
<MyInterface class="${package}.InterfaceImpl3"/>
</MyObjects>
-------------
That way I could easily change the package name and must not touch
every "<MyInterface..." line. In the documentation you write "The
templating engine has access to all details placed into the session
map object.", but this seems only to be true for other "normal"
elements, not the "class" attribute of an element.
Is this a real limitation, or even a bug?
(The framework just does not substitute ${package}, so it tries to
load the class "${package}.InterfaceImpl1" instead of
"net.test.lib.concurrent.theme.InterfaceImpl1").
I'm using the XML file to configure a rather complex system (like a
build system) and this feature would be extremely useful in many
cases for me (and for others, too, for sure).
If this is a limitation, may you think about implementing this feature
so the template system also works for those "class" attributes in the
XML elements? That would be great!
Best regards,
Timo
|