adding a new template to an existing FreeMarker system

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

adding a new template to an existing FreeMarker system

spornitz
Hi;

We are using a vendor's system that uses FreeMarker. We would like to add a couple templates to their existing system; they can't seem to tell us what we would have to change to have the templating engine pick them up, however.

Generally: what do you have to change in a FreeMarker-based application to have the template engine pick up brand new templates?

thanks for any clues...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: adding a new template to an existing FreeMarker system

Daniel Dekany
Hi,

FreeMarker is very configurable on this regard, an it doesn't even
have a default location for templates, so everyone has to configure it
to something explicitly. But you can try a few things:

- See if there's something like templateLoader or template_loader or
  maybe templatePath or templatePaths around. This is what specifies
  from where the templates are loaded from. But maybe they do it from
  compiled Java code, in which case you can't easily modify it.

- Find the existing templates (usually files with "ftl" file
  extension). If they are inside jar-s, then maybe you can just add
  your own jar-s which put further templates into the same
  subdirectory.

- If they are using a well known framework (like Spring), chances are
  that it has its own conventions for configuring FreeMarker, and
  knowing that maybe you can refine it.

- Start the JVM in debug mode, and put a breakpoint on
  freemarker.cache.TemplateCache.findTemplateSource(String). You will
  see a TemplateLoader field referred there. That's the object that's
  responsible for actually loading the template files, so from its
  concrete class and fields you can extract this information.

And please in the future use [hidden email], as
this is list was retired!


Wednesday, June 8, 2016, 9:26:53 PM, spornitz wrote:

> Hi;
>
> We are using a vendor's system that uses FreeMarker. We would like to add a
> couple templates to their existing system; they can't seem to tell us what
> we would have to change to have the templating engine pick them up, however.
>
> Generally: what do you have to change in a FreeMarker-based application to
> have the template engine pick up brand new templates?
>
> thanks for any clues...

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: adding a new template to an existing FreeMarker system

spornitz-2
Thanks very much! Maybe when I figure this out, I'll inform the vendor so they can tell their customers LOL.

-Bill

----- Original Message -----
From: "Daniel Dekany" <[hidden email]>
To: "spornitz" <[hidden email]>
Cc: [hidden email]
Sent: Wednesday, June 8, 2016 5:48:49 PM
Subject: Re: [FreeMarker-user] adding a new template to an existing FreeMarker system

Hi,

FreeMarker is very configurable on this regard, an it doesn't even
have a default location for templates, so everyone has to configure it
to something explicitly. But you can try a few things:

- See if there's something like templateLoader or template_loader or
  maybe templatePath or templatePaths around. This is what specifies
  from where the templates are loaded from. But maybe they do it from
  compiled Java code, in which case you can't easily modify it.

- Find the existing templates (usually files with "ftl" file
  extension). If they are inside jar-s, then maybe you can just add
  your own jar-s which put further templates into the same
  subdirectory.

- If they are using a well known framework (like Spring), chances are
  that it has its own conventions for configuring FreeMarker, and
  knowing that maybe you can refine it.

- Start the JVM in debug mode, and put a breakpoint on
  freemarker.cache.TemplateCache.findTemplateSource(String). You will
  see a TemplateLoader field referred there. That's the object that's
  responsible for actually loading the template files, so from its
  concrete class and fields you can extract this information.

And please in the future use [hidden email], as
this is list was retired!


Wednesday, June 8, 2016, 9:26:53 PM, spornitz wrote:

> Hi;
>
> We are using a vendor's system that uses FreeMarker. We would like to add a
> couple templates to their existing system; they can't seem to tell us what
> we would have to change to have the templating engine pick them up, however.
>
> Generally: what do you have to change in a FreeMarker-based application to
> have the template engine pick up brand new templates?
>
> thanks for any clues...

--
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
FreeMarker-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
Loading...