velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bluejoe2008" <bluejoe2...@gmail.com>
Subject Re: Re: Re: velocimacro.library options
Date Wed, 05 May 2010 01:03:16 GMT
yes, i agree
i do not want to call template.merge(context, writer, "macro.vm") every time when parsing
every template
and i am finding a way to load all global macros on startup

now i am turnning to constructing a long string of macro file paths and calling VelocityEngine.setProperty("velocimacro.library",
 myMacrosPathList)
maybe it will help me, although it is not a way to load macro library dynamically

2010-05-05 



bluejoe2008 



发件人: Nathan Bubna 
发送时间: 2010-05-04  23:42:27 
收件人: Velocity Users List 
抄送: 
主题: Re: Re: velocimacro.library options 
 
oh yeah, i forgot about that.  of course, it is a little different
than loading more global macros for all templates.
2010/5/4 Will Glass-Husain <wglasshusain@gmail.com>:
> Actually, it does.  When merging, you can pass in a macro file.
>
> template.merge(context, writer, "macro.vm");
>
> 2010/5/4 Nathan Bubna <nbubna@gmail.com>
>
>> That method doesn't exist, but patches are welcome. :)
>>
>> On Tue, May 4, 2010 at 1:26 AM, bluejoe2008 <bluejoe2008@gmail.com> wrote:
>> > by the way, i ask a question: how to load velomacro library dynamically
>> in my programs?
>> > is there a method such as VelocityEngine.loadMacroLibrary("mymacro.vm")?
>> >
>> > 2010-05-04
>> >
>> >
>> >
>> > bluejoe2008
>> >
>> >
>> >
>> > 发件人: Nathan Bubna
>> > 发送时间: 2010-05-01  03:44:09
>> > 收件人: Velocity Users List
>> > 抄送:
>> > 主题: Re: velocimacro.library options
>> >
>> > You have to specify files.  Given the diversity of ResourceLoader
>> > implementations, wildcards and directories are completely impossible
>> > to support.
>> > On Fri, Apr 30, 2010 at 11:29 AM, ChadDavis <chadmichaeldavis@gmail.com>
>> wrote:
>> >> What are the valid options for setting the locations of my libraries?
>> >> Do I have to specify files?  Can I specify directories?  Can I use any
>> >> wildcards, etc.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> >> For additional commands, e-mail: user-help@velocity.apache.org
>> >>
>> >>
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> > For additional commands, e-mail: user-help@velocity.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message