Change ${...} to [=...] for freemarker template

2020-12-12 Thread James Yong
Hi all, Currently interpolation syntax used for freemarker template is ${...}. This is the same as the interpolation syntax for template literal in javascript. As a result, extra coding is needed to escape the interpolation expression for javascript coding with freemarker template. Propose to

Re: Change ${...} to [=...] for freemarker template

2020-12-12 Thread Jacques Le Roux
Hi James, I see no problems with that: +1 Jacques Le 12/12/2020 à 10:43, James Yong a écrit : Hi all, Currently interpolation syntax used for freemarker template is ${...}. This is the same as the interpolation syntax for template literal in javascript. As a result, extra coding is needed to

Re: Change ${...} to [=...] for freemarker template

2020-12-12 Thread Pawan Verma
Hi James, What is the scope of this effort? Are we talking about changing it to all the FTL code? AFAIK, When square bracket interpolation syntax is used, ${expression} and #{expression} in the template will be just static text, which is printed as-is. That means all the existing code will become

Re: Change ${...} to [=...] for freemarker template

2020-12-12 Thread James Yong
Hi Pawan, Yes, all FTL code in framework and plugins will be changed. Changes can be done using regular expression for the replacement. So migration for custom or existing code should be relatively simple. Regards, James On 2020/12/12 11:50:34, Pawan Verma wrote: > Hi James, > > What is the s

Re: Change ${...} to [=...] for freemarker template

2020-12-14 Thread Michael Brohl
Hi James, I cannot recall having any problems with that during the last 18 years of running OFBiz projects. Can you give us a real world example where this really is a problem? Besides this, I am not in favour of a forced change in all of the codebase. Wouldn't it be possible to use both way

Re: Change ${...} to [=...] for freemarker template

2020-12-15 Thread James Yong
Hi Michael, Please see my reply inline. Regards, James On 2020/12/14 08:12:26, Michael Brohl wrote: > Hi James, > > I cannot recall having any problems with that during the last 18 years > of running OFBiz projects. > > Can you give us a real world example where this really is a problem? [

Re: Change ${...} to [=...] for freemarker template

2020-12-19 Thread James Yong
Hi all, Thanks for the feedbacks. Plan to allow freemarker square interpolation syntax, i.e. [=...], when the template filename extension is '.sqi.ftl'. So it will not affect existing templates that doesn't use js template literal. sqi is abbreviation for square interpolation. Regards, James

Re: Change ${...} to [=...] for freemarker template

2020-12-20 Thread James Yong
Created OFBIZ-12099 for this new feature. On 2020/12/20 07:41:03, James Yong wrote: > Hi all, > > Thanks for the feedbacks. > > Plan to allow freemarker square interpolation syntax, i.e. [=...], > when the template filename extension is '.sqi.ftl'. > So it will not affect existing templates