Hi Supun,

Glad to hear you have picked this up again... thought you were lost for a
little while :-)

I'm not quite sure what is the purpose of the hash table you are
describing.  Is this intended to help cache the macros from merge to merge?

Remember, the intent is to load an the new macro file each time the template
merge is called.  Any caching is handled by the built in resource loading
facility.

Maybe it would be helpful to share some sample code?  It's probably not
useful to overwhelm the list with everything, but you could show what
happens with the method call:

template.merge(context, writer, macroFiles);

WILL



On 7/3/07, Supun Kamburugamuva <[EMAIL PROTECTED]> wrote:

hi,

This is the approach that I have being thinking about.

I'm keeping a hash table in the MacroFactory which has the mapping from
template to the macro files i.e test_macro.vm -> macro_library1.vm,
macro_library2.vm. When a user calls the template.merge with macro files I
keep the information in that structure.

Then I try to create a resource out of the macro library files, which
ultimately build the node tree and add the macros to the macro manager.

When macro is added in the MacroFactory I check whether the macro is in
one
of the macro library files (in the hash table). If it is in a macro
library
fie I'm replacing the macro library name with the main template name.

But it seems that this approach is not working – I have done a test
implementation, but it didn't work.

Regards,

Supun.
<http://www.forio.com/>




--
Forio Business Simulations

Will Glass-Husain
[EMAIL PROTECTED]
www.forio.com

Reply via email to