]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Merged revisions 675253 via svnmerge from
authorAdrian Cumiskey <acumiskey@apache.org>
Wed, 9 Jul 2008 17:04:05 +0000 (17:04 +0000)
committerAdrian Cumiskey <acumiskey@apache.org>
Wed, 9 Jul 2008 17:04:05 +0000 (17:04 +0000)
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk

........
  r675253 | acumiskey | 2008-07-09 17:53:01 +0100 (Wed, 09 Jul 2008) | 2 lines

  Added throwexceptions attribute to FOP ant task. This works around the problem with executing examples/fo/build.xml.
........

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@675257 13f79535-47bb-0310-9956-ffa450edef68

examples/fo/build.xml
src/documentation/content/xdocs/trunk/anttask.xml
src/java/org/apache/fop/tools/anttasks/Fop.java

index 8ecfbee186406146abd6351b7cc01d065ff268da..2c7c182596bf15a0c7febbe127d4d6a817550f2f 100644 (file)
@@ -45,7 +45,7 @@
   <!-- Produces new test files (function)                                  -->
   <!-- =================================================================== -->
   <target name="newTestFiles">
-    <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" relativebase="true">
+    <fop format="${mimetype}" outdir="${outDir}" messagelevel="${msglevel}" relativebase="true" throwexceptions="false">
       <fileset dir="basic">
         <include name="**/*.fo"/>
       </fileset>
index 44550c3d7e9d4d1dc3769ff181c1766c63135234..7b07802b14dbd570b3322eb4c11b5917fe77bc09 100644 (file)
             (<code>true</code>) or not (<code>false</code>). <strong>Currently doesn't work in FOP Trunk!!!</strong></td> 
        <td>No, default is <code>true</code></td> 
       </tr> 
+      <tr> 
+       <td>throwexceptions</td> 
+       <td>Controls whether or not an exception is thrown if an error occurs during rendering.</strong></td> 
+       <td>Default is <code>true</code></td> 
+      </tr> 
      </table>
      <p/>
      <table><caption>Parameters specified as nested elements</caption>
index 6f9b2fc340b01c0eb03b3c3ce93198bb8a6e6504..0f28d70e743b2807c6c59d8a682b0259dd510ca4 100644 (file)
@@ -77,6 +77,7 @@ public class Fop extends Task {
     private boolean logFiles = true;
     private boolean force = false;
     private boolean relativebase = false;
+    private boolean throwExceptions = false;
 
     /**
      * Sets the filename for the userconfig.xml.
@@ -211,6 +212,24 @@ public class Fop extends Task {
         return this.format;
     }
 
+    /**
+     * Set whether exceptions are thrown.
+     * default is false.
+     *
+     * @param force true if always generate.
+     */
+    public void setThrowexceptions(boolean throwExceptions) {
+        this.throwExceptions = throwExceptions;
+    }
+
+    /**
+     * Gets the throw exceptions attribute
+     * @return the throw exceptions attribute
+     */
+    public boolean getThrowexceptions() {
+        return this.throwExceptions;
+    }
+
     /**
      * Sets the message level to be used while processing.
      * @param messageLevel (error | warn| info | verbose | debug)
@@ -558,7 +577,10 @@ class FOPTaskStarter {
             inputHandler.renderTo(userAgent, outputFormat, out);
             success = true;
         } catch (Exception ex) {
-            throw new BuildException(ex);
+            if (task.getThrowexceptions()) {
+                throw new BuildException(ex);
+           }
+            logger.error("Error rendering fo file: " + foFile, ex);
         } finally {
             try {
                 out.close();