FreeMarkerWorker.java flexibility
---------------------------------
Key: OFBIZ-273
URL: http://issues.apache.org/jira/browse/OFBIZ-273
Project: OFBiz (The Open for Business Project)
Issue Type: Improvement
Components: framework
Affects Versions: SVN trunk
Reporter: Marco Risaliti
Priority: Minor
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 :)
As suggested by Oleg I have copied the old-jira issue OFBIZ-848 to this new
issue.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira