Re: Pluggable template retrival/caching logic (Was: Template Loader Implementation that loads from a database (DataSource))

2017-06-08 Thread Daniel Dekany
Friday, June 9, 2017, 12:19:02 AM, Daniel Dekany wrote: [snip] > DefaultTemplateResolver happens to support them. If > Configuration.templateLoader is set to `new MyTemplateResolver()`, and I meant "If Configuration.templateResolver is set to `new MyTemplateResolver()`" of course... -- Thanks,

Re: Pluggable template retrival/caching logic (Was: Template Loader Implementation that loads from a database (DataSource))

2017-06-08 Thread Daniel Dekany
Now this mechanism is working in FM3. At the end I did this: http://freemarker.org/builds/fm3/api/freemarker-core/org/apache/freemarker/core/templateresolver/TemplateResolver.html Explanation: If you implement a custom TemplateResolver, then you are required to declare which of the Configuration

Re: Pluggable template retrival/caching logic (Was: Template Loader Implementation that loads from a database (DataSource))

2017-02-16 Thread Daniel Dekany
Note that there's quick draft of TemplateResolver committed in the "3" branch: https://github.com/apache/incubator-freemarker/blob/3/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java It's not integrated with the other parts of FM (it's assumed everywhere that we have

Re: Pluggable template retrival/caching logic (Was: Template Loader Implementation that loads from a database (DataSource))

2017-02-16 Thread Daniel Dekany
Thursday, February 16, 2017, 5:33:01 PM, David E Jones wrote: > On Thu, 2017-02-16 at 15:56 +0100, Daniel Dekany wrote: >> Thursday, February 16, 2017, 6:17:00 AM, David E Jones wrote: >> >> > >> > This is cleaner, more obvious what's going on underneath, but since >> > the

Re: Pluggable template retrival/caching logic (Was: Template Loader Implementation that loads from a database (DataSource))

2017-02-16 Thread David E Jones
On Thu, 2017-02-16 at 15:56 +0100, Daniel Dekany wrote: > Thursday, February 16, 2017, 6:17:00 AM, David E Jones wrote: > > > > > This is cleaner, more obvious what's going on underneath, but since > > the DefaultTemplateResolver will be the most commonly used you > > could just leave the

Re: Pluggable template retrival/caching logic (Was: Template Loader Implementation that loads from a database (DataSource))

2017-02-16 Thread Daniel Dekany
Thursday, February 16, 2017, 6:17:00 AM, David E Jones wrote: > > This is cleaner, more obvious what's going on underneath, but since > the DefaultTemplateResolver will be the most commonly used you > could just leave the current setting methods as they are and just > document that if you set a

Re: Pluggable template retrival/caching logic (Was: Template Loader Implementation that loads from a database (DataSource))

2017-02-15 Thread David E Jones
This is cleaner, more obvious what's going on underneath, but since the DefaultTemplateResolver will be the most commonly used you could just leave the current setting methods as they are and just document that if you set a different TemplateResolver they will be ignored. -David On Wed,

Re: Pluggable template retrival/caching logic (Was: Template Loader Implementation that loads from a database (DataSource))

2017-02-15 Thread Daniel Dekany
An interesting consequence of introducing the TemplateResolver concept is that it the earlier top-level configuration settings, like templateLoader, templateLookupStrategy, templateNameFormat, cacheStorage, and templateUpdateDelayMillisecond should now be the settings (JavaBean properties) of

Re: Template Loader Implementation that loads from a database (DataSource)

2017-02-07 Thread Roberto Benitez
I have only had the chance to look it on my phone, so have not read the thread thoroughly. I will go through it on my desktop later today. --Roberto Sent from Yahoo Mail on Android On Tue, Feb 7, 2017 at 8:14 AM, Daniel Dekany wrote: In case you have missed it in the

Re: Template Loader Implementation that loads from a database (DataSource)

2017-02-07 Thread Daniel Dekany
In case you have missed it in the other thread, note that it seems that there won't be a new alternative TemplateLoader interface in FM2, so this will have to be solved with the existing TemplateLoader there. -- Thanks, Daniel Dekany Wednesday, January 25, 2017, 4:17:10 AM, Roberto Benitez

Re: Pluggable template retrival/caching logic (Was: Template Loader Implementation that loads from a database (DataSource))

2017-02-07 Thread Daniel Dekany
Tuesday, February 7, 2017, 7:40:18 AM, David E Jones wrote: > On Tue, 2017-01-24 at 23:47 +0100, Daniel Dekany wrote: >> >> Should the TemplateResolver-s (the work name for the new interface) >> still get the template name already resolved to absolute and >> normalized? So when cfg.getTemplate

Re: Template Loader Implementation that loads from a database (DataSource)

2017-01-25 Thread Daniel Dekany
Wednesday, January 25, 2017, 4:17:10 AM, Roberto Benitez wrote: >>Also, I hope that freemarker-datasource-loader can be simplified over >>time, so it doesn't employ this many interfaces/classes. > > Currently, the only essential classes are: > 1) JdbcMetaData --A central place to store DB

Re: Template Loader Implementation that loads from a database (DataSource)

2017-01-24 Thread Roberto Benitez
>Also, I hope that freemarker-datasource-loader can be simplified over >time, so it doesn't employ this many interfaces/classes. Currently, the only essential classes are:  1)JdbcMetaData --A central place to store DB table/column names. 2) TemplateSourceDao --to perform the JDBC/CRUD work 3)

Re: Pluggable template retrival/caching logic (Was: Template Loader Implementation that loads from a database (DataSource))

2017-01-24 Thread Daniel Dekany
Tuesday, January 24, 2017, 9:27:37 PM, David E Jones wrote: > On Jan 24 2017, at 10:25 am, Daniel Dekany wrote: > >> Tuesday, January 24, 2017, 6:48:16 PM, David E Jones wrote: > >> > >> > but all other Configuration.getTemplate() methods call this method > >> > >> > so it

Re: Template Loader Implementation that loads from a database (DataSource)

2017-01-24 Thread David E Jones
On Jan 24 2017, at 10:25 am, Daniel Dekany wrote: > Tuesday, January 24, 2017, 6:48:16 PM, David E Jones wrote: > > > but all other Configuration.getTemplate() methods call this method > > > so it is an easy way to override all Template loading (assuming you >

Re: Template Loader Implementation that loads from a database (DataSource)

2017-01-24 Thread Daniel Dekany
Tuesday, January 24, 2017, 6:48:16 PM, David E Jones wrote: > A simpler TemplateLoader would be helpful. > > > > One approach I've used to simplify it is to override all loading by creating > an object that extends the freemarker.template.Configuration and override this > method: > > > >

Re: Template Loader Implementation that loads from a database (DataSource)

2017-01-24 Thread David E Jones
A simpler TemplateLoader would be helpful. One approach I've used to simplify it is to override all loading by creating an object that extends the freemarker.template.Configuration and override this method: Template getTemplate(final String name, Locale locale, Object

Re: Template Loader Implementation that loads from a database (DataSource)

2017-01-24 Thread Daniel Dekany
Tuesday, January 24, 2017, 6:27:38 AM, Roberto Benitez wrote: > I am working on a TemplateLoader implementation that loads from a > database.  From a previous e-mail with Daniel Dekany, he mentioned > that this is something you still need, and may be interested in integrating. > I have the source

Template Loader Implementation that loads from a database (DataSource)

2017-01-23 Thread Roberto Benitez
I am working on a TemplateLoader implementation that loads from a database.  From a previous e-mail with Daniel Dekany, he mentioned that this is something you still need, and may be interested in integrating. I have the source code on github: rbenitez22/freemarker-datasource-loader ||