Atozed Forums
template processor html read question - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: template processor html read question (/thread-503.html)



template processor html read question - joel - 07-15-2018

I would like to store templates in a database and then use them with a tiwTemplateProcessHTML.    

Does anyone know if it is possible to load a template from a database directly to a stream and have a tiwTemplateProcessorHTML use it without having to first save the file to the template location on the disk?


RE: template processor html read question - kudzu - 07-15-2018

The template processor comes with full source and is pluggable. You can easily it to do as you wish with very little code required.


RE: template processor html read question - joel - 07-15-2018

(07-15-2018, 02:42 PM)kudzu Wrote: The template processor comes with full source and is pluggable. You can easily it to do as you wish with very little code required.

Thanks.   I am also looking forward to iw17.


RE: template processor html read question - kudzu - 07-16-2018

Thanks. We are working hard on 17 and will be shipping a limited alpha this month.


RE: template processor html read question - Alexandre Machado - 07-31-2018

(07-15-2018, 05:23 AM)joel Wrote: I would like to store templates in a database and then use them with a tiwTemplateProcessHTML.    

Does anyone know if it is possible to load a template from a database directly to a stream and have a tiwTemplateProcessorHTML use it without having to first save the file to the template location on the disk?

Yes, you can load your template from stream, using a correspondent event in template processor component.

I just can't *stress* enough how this is going to kill your application performance if you don't cache it externally. Rendering times will likely to double, even if your DB performance is outstanding.


RE: template processor html read question - joel - 08-01-2018

(07-31-2018, 10:39 PM)Alexandre Machado Wrote:
(07-15-2018, 05:23 AM)joel Wrote: I would like to store templates in a database and then use them with a tiwTemplateProcessHTML.    

Does anyone know if it is possible to load a template from a database directly to a stream and have a tiwTemplateProcessorHTML use it without having to first save the file to the template location on the disk?

Yes, you can load your template from stream, using a correspondent event in template processor component.

I just can't *stress* enough how this is going to kill your application performance if you don't cache it externally. Rendering times will likely to double, even if your DB performance is outstanding.

Thanks for the input.  I am making a page that dynamically uses a template that is stored in the database.   Since I don't want to kill the performance I will retrieve it from the database and then save it to a file and use it from there.    

Do you see any issues if I save the "temporary" file for the template to the "user" cache?   This way when the session is cleared it will be cleaned up.


RE: template processor html read question - Alexandre Machado - 08-01-2018

Actually I'd add it to ServerInternalFiles list so it is always in memory which makes loading mega fast and every time your application dies, the template goes along with it. You can use the event to load from ServerInternalFiles list.

If you prefer to save it to disk, I don't see any issues if you decide do save it to cache folder


RE: template processor html read question - joel - 08-01-2018

(08-01-2018, 02:50 AM)Alexandre Machado Wrote: Actually I'd add it to ServerInternalFiles list so it is always in memory which makes loading mega fast and every time your application dies, the template goes along with it. You can use the event to load from ServerInternalFiles list.

If you prefer to save it to disk, I don't see any issues if you decide do save it to cache folder.
Using the ServerInternalFiles sounds like the better way to go.   

How do I access the ServerInternalFiles?    I don't see them on the ServerController.