Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
template processor html read question
#1
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?
Reply
#2
The template processor comes with full source and is pluggable. You can easily it to do as you wish with very little code required.
Reply
#3
(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.
Reply
#4
Thanks. We are working hard on 17 and will be shipping a limited alpha this month.
Reply
#5
(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.
Reply
#6
(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.
Reply
#7
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
Reply
#8
(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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)