You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2007/01/13 21:00:27 UTC

[jira] Commented: (OFBIZ-273) FreeMarkerWorker.java flexibility

    [ https://issues.apache.org/jira/browse/OFBIZ-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464519 ] 

Jacques Le Roux commented on OFBIZ-273:
---------------------------------------

Hi Oleg,

Still there ?

> FreeMarkerWorker.java flexibility
> ---------------------------------
>
>                 Key: OFBIZ-273
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-273
>             Project: Apache OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>         Assigned To: Jacques Le Roux
>            Priority: Minor
>         Attachments: freemarkerworker.patch, freemarkerworker.properties
>
>
> Copy of the old Jira issue http://jira.undersunconsulting.com/browse/OFBIZ-848 from  Oleg Kozyrev
> =================================================
> 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.
> FreeMarkerWorker.java patch 
> Comment by Oleg Kozyrev [18/Apr/06 01:05 AM] [ Permlink ] 
> freemarkerworker.properties file is attached 
> This could live in frameworker/webapp/config as a suggession. 
> Comment by Oleg Kozyrev [18/Apr/06 01:06 AM] [ Permlink ] 
> I have tested all this stuff. I works fine here. 
> Could someone test it too? 
> Thanks, 
> Oleg. 
> Comment by Jacopo Cappellato [12/Sep/06 01:54 PM] [ Permlink ] 
> Can we commit this patch? I think it's a nice feature to have. 
> Comment by Oleg Kozyrev [13/Sep/06 10:45 PM] [ Permlink ] 
> Surely we can commit the patch. 
> It was waiting for ages to be commited :) 

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