Posted by
Nicolas Malin (Jira) on
URL: http://ofbiz.116.s1.nabble.com/jira-Created-OFBIZ-203-Freemarker-postal-address-formatter-macro-tp171329p171340.html
[
http://issues.apache.org/jira/browse/OFBIZ-203?page=comments#action_12434244 ]
David E. Jones commented on OFBIZ-203:
--------------------------------------
This is interesting. I'm guessing that you're asking for review because there is something about it you're not comfortable with...
There are a few things I can see that are small issues with it as I read through the patch, but the one big issue I see is that it's a bit of a pain to change and perhaps a bit of overkill as a solution to this problem. The easiest way to have a common address formatting mechanism would be to drop a screen definition into the common component that renders an FTL file that could support all of the formatting now done in the Java code in this patch.
I can see that this must have required a fair amount of work, and that's exactly my concern. For those wanting different formatting it is quite a bit to dig through and requires a larger skill set than would be required to change an FTL file that does common formatting.
Those are my thoughts on it... I'd really rather hear the thoughts of other OFBiz users and committers though...
> Freemarker postal address formatter macro
> -----------------------------------------
>
> Key: OFBIZ-203
> URL:
http://issues.apache.org/jira/browse/OFBIZ-203> Project: OFBiz (The Open for Business Project)
> Issue Type: New Feature
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Leon Torres
> Priority: Minor
> Attachments: ofbizPostalAddress.patch, test.bsh, test.ftl
>
>
> Define a macro <@ofbizPostalAddress address=inputMapOrGenericValue/> to format postal addresses in a consistent, flexible way with attention to country postal formats. The output should support both HTML and Text formats. It should be easily extensible, with future XSL:Fo support in mind.
> I created an implementation as an exercise to learn the freemarker template system. It was designed with future macros in mind. Currently implemented are rules for generating US, German and Royal Mail format postal addresses. (The address country determines the format.) Also provided are test.bsh and test.ftl so people may try them out.
--
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