[jira] Closed: (OFBIZ-273) 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] Closed: (OFBIZ-273) FreeMarkerWorker.java flexibility

Nicolas Malin (Jira)

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

Jacques Le Roux closed OFBIZ-273.
---------------------------------

       Resolution: Fixed
    Fix Version/s: SVN trunk

Thanks Adrian,

Your patch is ni trunk revision: 564914  


> FreeMarkerWorker.java flexibility
> ---------------------------------
>
>                 Key: OFBIZ-273
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-273
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Marco Risaliti
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: FreeMarkerWorker.patch, 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.
-
You can reply to this email to add a comment to the issue online.