I would just make a new engine when adding to the global velocimacro library. There is a merge method that allows you to specify macro libraries at merge time, but they don't stay in memory. You can set your properties so that inline macros are always registered as global, but that has obvious side effects. I'd recommend just init'ing a new engine for such a change. Yes, you will lose already cached templates, but hopefully this isn't something you do often.
On Mon, Jan 19, 2009 at 3:23 AM, Alessandro Novarini <[email protected]> wrote: > Hello everybody, it's me again > > After a lot of research I've found what I was looking for, but now there's > another problem... > > I can get an already inited VelocityEngine, now I have to add at runtime > another velocimacro file; how can I do that? Is it possible? > > Thank you in advance, > Ale > > On Jan 7, 2009, at 11:33 AM, Alessandro Novarini wrote: > >> Ok, I'll check also some JIRA ml, but I am quite sure you're right, there >> is another VelocityEngine (not singleton) that's doing the dirty job :| >> >> I think I need to get it someway, so I'm thinking to change my code >> >> Velocity.init(customVelocityFile); >> Velocity.getProperty(velocimacroLibrary); >> >> into >> >> VelocityEngine ve = >> someClass.getCurrentVelocityEngineOrWhateverThisMethodHasBeenNamed(); >> ve..getProperty(velocimacroLibrary); >> >> >> Any suggestion? >> >> Thanks again, you've been very helpful >> Ale >> >> >> >> On Jan 6, 2009, at 5:12 PM, Nathan Bubna wrote: >> >>> On Tue, Jan 6, 2009 at 1:04 AM, Alessandro Novarini >>> <[email protected]> wrote: >>>> >>>> Hello Nathan, >>>> >>>> On Mon, Jan 5, 2009 at 11:19 PM, Nathan Bubna <[email protected]> wrote: >>>> >>>>> Your properties look fine and the logs confirm that. >>>> >>>> >>>> Glad to read it, it means I'm not totally wrong >>>> >>>> >>>>> I can only guess >>>>> that whatever VelocityEngine or Velocity singleton that is processing >>>>> your template is not the same one that you are initializing. What >>>>> code/servlet/whatever are you using to process templates? >>>> >>>> >>>> This is a good point; unfortunately I don't know the answer :( >>>> I'm using the singleton in my Action class, as I said, this is a jira >>>> plugin, a sort of thing I'm not used to yet and worst of all something >>>> out >>>> of my control... >>>> Can you give me an adivice where to search for what you asked? Should >>>> there >>>> be a configuration file somewhere? >>> >>> I don't know anything about JIRA, so i'm totally guessing here: you >>> could check the web.xml and see if there is a VelocityViewServlet in >>> sight. You can also keep an eye out for any other velocity.properties >>> files, of course, then try editing that. >>> >>> if JIRA has a user list, they might have an answer to my question. >>> >>>> Thank you for your advices, I'll do further investigation >>>> >>>> Ale >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
