svn commit: r564545 - in /ofbiz/trunk/framework/webapp: config/fop.xconf src/org/ofbiz/webapp/view/ApacheFopFactory.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r564545 - in /ofbiz/trunk/framework/webapp: config/fop.xconf src/org/ofbiz/webapp/view/ApacheFopFactory.java

jacopoc
Author: jacopoc
Date: Fri Aug 10 04:02:14 2007
New Revision: 564545

URL: http://svn.apache.org/viewvc?view=rev&rev=564545
Log:
Added fop config file (with unchanged default value to the webapp/config folder.
Also changed the ApacheFopFactory to load froom webapp/config instead of widget/config.
Thanks to Oleg Andreyev and Krzysztof Podejma for the config file and comments.
OFBIZ-1110

Added:
    ofbiz/trunk/framework/webapp/config/fop.xconf
Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java

Added: ofbiz/trunk/framework/webapp/config/fop.xconf
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/config/fop.xconf?view=auto&rev=564545
==============================================================================
--- ofbiz/trunk/framework/webapp/config/fop.xconf (added)
+++ ofbiz/trunk/framework/webapp/config/fop.xconf Fri Aug 10 04:02:14 2007
@@ -0,0 +1,155 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--
+
+This is an example configuration file for FOP.
+This file contains the same settings as the default values
+and will have no effect if used unchanged.
+
+Relative config url's will be resolved relative to
+the location of this file.
+
+-->
+
+<!-- NOTE: This is the version of the configuration -->
+<fop version="1.0">
+
+  <!-- Base URL for resolving relative URLs -->
+  <base>.</base>
+  
+  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
+  <source-resolution>72</source-resolution>
+  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
+  <target-resolution>72</target-resolution>
+  
+  <!-- Default page-height and page-width, in case
+       value is specified as auto -->
+  <default-page-settings height="11in" width="8.26in"/>
+  
+  <!-- Information for specific renderers -->
+  <!-- Uses renderer mime type for renderers -->
+  <renderers>
+    <renderer mime="application/pdf">
+      <filterList>
+        <!-- provides compression using zlib flate (default is on) -->
+        <value>flate</value>
+  
+        <!-- encodes binary data into printable ascii characters (default off)
+             This provides about a 4:5 expansion of data size -->
+        <!-- <value>ascii-85</value> -->
+  
+        <!-- encodes binary data with hex representation (default off)
+             This filter is not recommended as it doubles the data size -->
+        <!-- <value>ascii-hex</value> -->
+      </filterList>
+
+      <fonts>
+        <!-- embedded fonts -->
+        <!--
+        This information must exactly match the font specified
+        in the fo file. Otherwise it will use a default font.
+
+        For example,
+        <fo:inline font-family="Arial" font-weight="bold" font-style="normal">
+            Arial-normal-normal font
+        </fo:inline>
+        for the font triplet specified by:
+        <font-triplet name="Arial" style="normal" weight="bold"/>
+
+        If you do not want to embed the font in the pdf document
+        then do not include the "embed-url" attribute.
+        The font will be needed where the document is viewed
+        for it to be displayed properly.
+
+        possible styles: normal | italic | oblique | backslant
+        possible weights: normal | bold | 100 | 200 | 300 | 400
+                          | 500 | 600 | 700 | 800 | 900
+        (normal = 400, bold = 700)
+        -->
+
+        <!--
+        <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
+          <font-triplet name="Arial" style="normal" weight="normal"/>
+          <font-triplet name="ArialMT" style="normal" weight="normal"/>
+        </font>
+        <font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf">
+          <font-triplet name="Arial" style="normal" weight="bold"/>
+          <font-triplet name="ArialMT" style="normal" weight="bold"/>
+        </font>
+        -->
+      </fonts>
+
+      <!-- This option lets you specify additional options on an XML handler -->
+      <!--xml-handler namespace="http://www.w3.org/2000/svg">
+        <stroke-text>false</stroke-text>
+      </xml-handler-->
+
+    </renderer>
+
+    <renderer mime="application/postscript">
+      <!-- This option forces the PS renderer to rotate landscape pages -->
+      <!--auto-rotate-landscape>true</auto-rotate-landscape-->
+      
+      <!-- This option lets you specify additional options on an XML handler -->
+      <!--xml-handler namespace="http://www.w3.org/2000/svg">
+        <stroke-text>false</stroke-text>
+      </xml-handler-->
+    </renderer>
+
+    <renderer mime="application/vnd.hp-PCL">
+    </renderer>
+
+    <!-- MIF does not have a renderer
+    <renderer mime="application/vnd.mif">
+    </renderer>
+    -->
+
+    <renderer mime="image/svg+xml">
+      <format type="paginated"/>
+      <link value="true"/>
+      <strokeText value="false"/>
+    </renderer>
+
+    <renderer mime="application/awt">
+    </renderer>
+
+    <renderer mime="image/png">
+      <!--transparent-page-background>true</transparent-page-background-->
+    </renderer>
+
+    <renderer mime="image/tiff">
+      <!--transparent-page-background>true</transparent-page-background-->
+      <!--compression>CCITT T.6</compression-->
+    </renderer>
+
+    <renderer mime="text/xml">
+    </renderer>
+
+    <!-- RTF does not have a renderer
+    <renderer mime="text/rtf">
+    </renderer>
+    -->
+
+    <renderer mime="text/plain">
+      <pageSize columns="80"/>
+    </renderer>
+
+  </renderers>
+
+</fop>

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java?view=diff&rev=564545&r1=564544&r2=564545
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java Fri Aug 10 04:02:14 2007
@@ -44,14 +44,14 @@
         fopFactory.setStrictValidation(false);
         
         try {
-            String fopPath = UtilProperties.getPropertyValue("fop.properties", "fop.path","framework/widget/config");
+            String fopPath = UtilProperties.getPropertyValue("fop.properties", "fop.path", "framework/webapp/config");
             File userConfigFile = new File(fopPath + "/fop.xconf");
             fopFactory.setUserConfig(userConfigFile);
             String fopFontBaseUrl = fopFactory.getFontBaseURL();
             if (fopFontBaseUrl == null) {
                 String ofbizHome = System.getProperty("ofbiz.home");
                 fopFontBaseUrl = UtilProperties.getPropertyValue("fop.properties", "fop.font.base.url",
-                                    "file:///" + ofbizHome + "/framework/widget/config/");
+                                    "file://" + ofbizHome + "/framework/webapp/config/");
                 fopFactory.setFontBaseURL(fopFontBaseUrl);
             }
             Debug.logInfo("FOP-FontBaseURL: " + fopFontBaseUrl, module);