You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ad...@apache.org on 2005/09/28 22:41:44 UTC

svn commit: r292290 - in /xmlgraphics/fop/trunk: conf/fop.xconf src/java/org/apache/fop/apps/FOUserAgent.java

Author: adelmelle
Date: Wed Sep 28 13:41:38 2005
New Revision: 292290

URL: http://svn.apache.org/viewcvs?rev=292290&view=rev
Log:
Slight modification to user config file format

Modified:
    xmlgraphics/fop/trunk/conf/fop.xconf
    xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOUserAgent.java

Modified: xmlgraphics/fop/trunk/conf/fop.xconf
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/conf/fop.xconf?rev=292290&r1=292289&r2=292290&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/conf/fop.xconf (original)
+++ xmlgraphics/fop/trunk/conf/fop.xconf Wed Sep 28 13:41:38 2005
@@ -14,16 +14,16 @@
 <!-- NOTE: This is the version of the configuration -->
 <fop version="1.0">
 
-  <userAgent>
-    <base url="./"/>
-    <!-- pixel to millimeter to specify dpi, 72dpi -->
-    <pixelToMillimeter value="0.35277777777777777778"/>
-    <!-- default page-height and page-width, in case
-         value is specified as auto -->
+  <base url="./"/>
+  <!-- pixel to millimeter to specify dpi, 72dpi -->
+  <pixelToMillimeter value="0.35277777777777777778"/>
+  <pagesettings>
+  <!-- default page-height and page-width, in case
+       value is specified as auto -->
     <pageHeight value="11in"/>
     <pageWidth value="8.26in"/>
-  </userAgent>
-
+  </pagesettings>
+  
   <!-- Information for specific renderers -->
   <!-- Uses renderer mime type for renderers -->
   <renderers>

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOUserAgent.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOUserAgent.java?rev=292290&r1=292289&r2=292290&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOUserAgent.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/apps/FOUserAgent.java Wed Sep 28 13:41:38 2005
@@ -353,10 +353,9 @@
      */
     public void initUserConfig() throws ConfigurationException {
         log.info("Initializing User Agent Configuration");
-        Configuration cfgUserAgent = userConfig.getChild("userAgent");
-        if (cfgUserAgent.getChild("base", false) != null) {
+        if (userConfig.getChild("base", false) != null) {
             try {
-                String cfgBaseDir = cfgUserAgent.getChild("base")
+                String cfgBaseDir = userConfig.getChild("base")
                                     .getAttribute("url");
                 File dir = new File(cfgBaseDir);
                 if (dir.isDirectory()) {
@@ -372,18 +371,19 @@
             }
             log.info("Base URL set to: " + baseURL);
         }
-        if (cfgUserAgent.getChild("pixelToMillimeter", false) != null) {
-            this.px2mm = cfgUserAgent.getChild("pixelToMillimeter")
+        if (userConfig.getChild("pixelToMillimeter", false) != null) {
+            this.px2mm = userConfig.getChild("pixelToMillimeter")
                             .getAttributeAsFloat("value", DEFAULT_PX2MM);
             log.info("pixelToMillimeter set to: " + px2mm);
         }
-        if (cfgUserAgent.getChild("pageHeight", false) != null) {
-            setPageHeight(cfgUserAgent.getChild("pageHeight")
+        Configuration pageConfig = userConfig.getChild("pagesettings");
+        if (pageConfig.getChild("pageHeight", false) != null) {
+            setPageHeight(pageConfig.getChild("pageHeight")
                             .getAttribute("value"));
             log.info("Default page-height set to: " + pageHeight);
         }
-        if (cfgUserAgent.getChild("pageWidth", false) != null) {
-            setPageWidth(cfgUserAgent.getChild("pageWidth")
+        if (pageConfig.getChild("pageWidth", false) != null) {
+            setPageWidth(pageConfig.getChild("pageWidth")
                             .getAttribute("value"));
             log.info("Default page-width set to: " + pageWidth);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org