You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2015/06/07 10:05:25 UTC

svn commit: r1683998 - in /ofbiz/trunk/applications/party: webapp/partymgr/party/contactmechtemplates/ widget/partymgr/

Author: jleroux
Date: Sun Jun  7 08:05:25 2015
New Revision: 1683998

URL: http://svn.apache.org/r1683998
Log:
A patch from Martin Becker "Postal Address PDF Formatter Screen Problems" https://issues.apache.org/jira/browse/OFBIZ-6444

A couple updates are needed to the postalAddressPdfFormatter screen:
First, the screen template is set to use the HTML renderer which results in this error in the log:
    [java] 2015-06-03 13:44:53,400 |0.0.0.0-8009-exec-13 |ModelScreenWidget             |W| In platform-dependent could not find template for xsl-fo, using the one for html.

Second, the various PostalAddressXXXX.fo.ftl files do not escape XML properly, and addresses with an & in them end up causing a FreeMarker template error.

Test:  For number 1, just get a "Report" for a quote, and then look at your log file. For number 2, add an "General Correspondence" address to a party that contains an ampersand, like "5th & Oak Street", create a quote for that Party, and then get the "Report" for that quote.

Modified:
    ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress.fo.ftl
    ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress_DEU.fo.ftl
    ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress_USA.fo.ftl
    ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml

Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress.fo.ftl?rev=1683998&r1=1683997&r2=1683998&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress.fo.ftl (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress.fo.ftl Sun Jun  7 08:05:25 2015
@@ -16,12 +16,14 @@ KIND, either express or implied.  See th
 specific language governing permissions and limitations
 under the License.
 -->
-  <fo:block>${postalAddress.address1!}</fo:block>
-  <#if postalAddress.address2?has_content><fo:block>${postalAddress.address2!}</fo:block></#if>
-  <fo:block>${postalAddress.city!}<#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId}</#if> ${postalAddress.postalCode!}</fo:block>
+<#escape x as x?xml>
+  <fo:block>${postalAddress.address1?if_exists}</fo:block>
+  <#if postalAddress.address2?has_content><fo:block>${postalAddress.address2?if_exists}</fo:block></#if>
+  <fo:block>${postalAddress.city?if_exists}<#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId}</#if> ${postalAddress.postalCode?if_exists}</fo:block>
   <#if postalAddress.countryGeoId?has_content>
     <fo:block>
       <#assign country = postalAddress.getRelatedOne("CountryGeo", true)>
       ${country.get("geoName", locale)?default(country.geoId)}
     </fo:block>
   </#if>
+</#escape>

Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress_DEU.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress_DEU.fo.ftl?rev=1683998&r1=1683997&r2=1683998&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress_DEU.fo.ftl (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress_DEU.fo.ftl Sun Jun  7 08:05:25 2015
@@ -16,12 +16,14 @@ KIND, either express or implied.  See th
 specific language governing permissions and limitations
 under the License.
 -->
-  <fo:block>${postalAddress.address1!}</fo:block>
-  <#if postalAddress.address2?has_content><fo:block>${postalAddress.address2!}</fo:block></#if>
-  <fo:block>${postalAddress.postalCode!} ${postalAddress.city!}</fo:block>
+<#escape x as x?xml>
+  <fo:block>${postalAddress.address1?if_exists}</fo:block>
+  <#if postalAddress.address2?has_content><fo:block>${postalAddress.address2?if_exists}</fo:block></#if>
+  <fo:block>${postalAddress.postalCode?if_exists} ${postalAddress.city?if_exists}</fo:block>
   <#if postalAddress.countryGeoId?has_content>
     <fo:block>
       <#assign country = postalAddress.getRelatedOne("CountryGeo", true)>
       ${country.get("geoName", locale)?default(country.geoId)}
     </fo:block>
   </#if>
+</#escape>
\ No newline at end of file

Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress_USA.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress_USA.fo.ftl?rev=1683998&r1=1683997&r2=1683998&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress_USA.fo.ftl (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/party/contactmechtemplates/PostalAddress_USA.fo.ftl Sun Jun  7 08:05:25 2015
@@ -16,6 +16,7 @@ KIND, either express or implied.  See th
 specific language governing permissions and limitations
 under the License.
 -->
+<#escape x as x?xml>
   <fo:block>${postalAddress.address1!}</fo:block>
   <#if postalAddress.address2?has_content><fo:block>${postalAddress.address2!}</fo:block></#if>
   <fo:block>${postalAddress.city!}<#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId}</#if> ${postalAddress.postalCode!}</fo:block>
@@ -25,3 +26,5 @@ under the License.
       ${country.get("geoName", locale)?default(country.geoId)}
     </fo:block>
   </#if>
+</#escape>
+

Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml?rev=1683998&r1=1683997&r2=1683998&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml Sun Jun  7 08:05:25 2015
@@ -1298,9 +1298,9 @@ under the License.
             </actions>
             <widgets>
                 <platform-specific>
-                    <html>
+                    <xsl-fo>
                         <html-template location="component://party/webapp/partymgr/party/contactmechtemplates/${postalAddressTemplate}"/>
-                    </html>
+                    </xsl-fo>
                 </platform-specific>
             </widgets>
         </section>