You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2013/07/25 09:53:29 UTC

svn commit: r1506836 - in /ofbiz/trunk/framework: common/widget/CommonScreens.xml webapp/src/org/ofbiz/webapp/view/ApacheFopWorker.java

Author: hansbak
Date: Thu Jul 25 07:53:29 2013
New Revision: 1506836

URL: http://svn.apache.org/r1506836
Log:
be able to set a font for pdf generation

Modified:
    ofbiz/trunk/framework/common/widget/CommonScreens.xml
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopWorker.java

Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=1506836&r1=1506835&r2=1506836&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Thu Jul 25 07:53:29 2013
@@ -512,7 +512,7 @@ under the License.
             <actions>
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 <set field="logoImageUrl" value="/images/ofbiz_logo.gif"/>
-                <!--<set field="defaultFontFamily" value="Arial"/>-->
+                <property-to-field resource="fop.properties" field="defaultFontFamily" property="fop.font.family" default="Arial"/>
             </actions>
             <widgets>
                 <platform-specific><xsl-fo><html-template location="component://common/webcommon/includes/reportTemplate.fo.ftl"/></xsl-fo></platform-specific>

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopWorker.java?rev=1506836&r1=1506835&r2=1506836&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopWorker.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopWorker.java Thu Jul 25 07:53:29 2013
@@ -78,15 +78,15 @@ public class ApacheFopWorker {
 
                 try {
                     String ofbizHome = System.getProperty("ofbiz.home");
-                    String fopPath = UtilProperties.getPropertyValue("fop.properties", "fop.path", ofbizHome + "/framework/webapp/config");
-                    File userConfigFile = FileUtil.getFile(fopPath + "/fop.xconf");
+                    String fopPath = UtilProperties.getPropertyValue("fop.properties", "fop.path", "/framework/webapp/config");
+                    File userConfigFile = FileUtil.getFile(ofbizHome + fopPath + "/fop.xconf");
                     if (userConfigFile.exists()) {
                         fopFactory.setUserConfig(userConfigFile);
                     } else {
                         Debug.logWarning("FOP configuration file not found: " + userConfigFile, module);
                     }
-                    String fopFontBaseProperty = UtilProperties.getPropertyValue("fop.properties", "fop.font.base.url", ofbizHome + "/framework/webapp/config/");
-                    File fontBaseFile = FileUtil.getFile(fopFontBaseProperty);
+                    String fopFontBaseProperty = UtilProperties.getPropertyValue("fop.properties", "fop.font.base.url", "/framework/webapp/config/");
+                    File fontBaseFile = FileUtil.getFile(ofbizHome + fopFontBaseProperty);
                     if (fontBaseFile.isDirectory()) {
                         fopFactory.getFontManager().setFontBaseURL(fontBaseFile.toURI().toURL().toString());
                     } else {