[JIRA] Commented: (OFBIZ-848) FreeMarkerWorker.java flexibility

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (OFBIZ-848) FreeMarkerWorker.java flexibility

JIRA jira@ofbiz.org
     [ http://jira.undersunconsulting.com/browse/OFBIZ-848?page=comments#action_13880 ]
     
Jacopo Cappellato commented on OFBIZ-848:
-----------------------------------------

Can we commit this patch? I think it's a nice feature to have.



> FreeMarkerWorker.java flexibility
> ---------------------------------
>
>          Key: OFBIZ-848
>          URL: http://jira.undersunconsulting.com/browse/OFBIZ-848
>      Project: [OFBiz] Open For Business
>         Type: Improvement
>   Components: base
>     Versions: SVN
>     Reporter: Oleg Kozyrev
>     Assignee: Jira Administrator
>     Priority: Minor
>  Attachments: freemarkerworker.patch, freemarkerworker.properties
>
>
> Ftl transforms loading in org.ofbiz.base.util.template.FreeMarkerWorker is not really flexible at the moment.
> Now classes to load are hard-coded, like this:
>    ftlTransforms.put("ofbizUrl", loader.loadClass("org.ofbiz.webapp.ftl.OfbizUrlTransform").newInstance());
>    ftlTransforms.put("ofbizContentUrl", loader.loadClass("org.ofbiz.webapp.ftl.OfbizContentTransform").newInstance());
>    ftlTransforms.put("ofbizCurrency", loader.loadClass("org.ofbiz.webapp.ftl.OfbizCurrencyTransform").newInstance());
>    ftlTransforms.put("ofbizAmount", loader.loadClass("org.ofbiz.webapp.ftl.OfbizAmountTransform").newInstance());
> So, if we need to add new class we need to recompile all the component. This is not right way, I think.
> I suggest to create separate properties file, like:
> ofbizUrl=org.ofbiz.webapp.ftl.OfbizUrlTransform
> ofbizContentUrl=org.ofbiz.webapp.ftl.OfbizContentTransform
> ofbizCurrency=org.ofbiz.webapp.ftl.OfbizCurrencyTransform
> and load them using UtilProperties class.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.undersunconsulting.com/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira