diff options
author | Adrian Cumiskey <acumiskey@apache.org> | 2008-07-09 16:53:01 +0000 |
---|---|---|
committer | Adrian Cumiskey <acumiskey@apache.org> | 2008-07-09 16:53:01 +0000 |
commit | ee77527091a08faefa4718d6887d87fe2d468e54 (patch) | |
tree | a986418b1e9602c3c7db8e50cb6a96ff8a82a17f | |
parent | 2fbf3f8dcddc463a4c92f957ac4f8dc0a6394768 (diff) | |
download | xmlgraphics-fop-ee77527091a08faefa4718d6887d87fe2d468e54.tar.gz xmlgraphics-fop-ee77527091a08faefa4718d6887d87fe2d468e54.zip |
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/trunk@675253 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | examples/fo/build.xml | 2 | ||||
-rw-r--r-- | src/documentation/content/xdocs/trunk/anttask.xml | 5 | ||||
-rw-r--r-- | src/java/org/apache/fop/tools/anttasks/Fop.java | 24 |
3 files changed, 29 insertions, 2 deletions
diff --git a/examples/fo/build.xml b/examples/fo/build.xml index 8ecfbee18..2c7c18259 100644 --- a/examples/fo/build.xml +++ b/examples/fo/build.xml @@ -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> diff --git a/src/documentation/content/xdocs/trunk/anttask.xml b/src/documentation/content/xdocs/trunk/anttask.xml index 44550c3d7..7b07802b1 100644 --- a/src/documentation/content/xdocs/trunk/anttask.xml +++ b/src/documentation/content/xdocs/trunk/anttask.xml @@ -148,6 +148,11 @@ (<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> diff --git a/src/java/org/apache/fop/tools/anttasks/Fop.java b/src/java/org/apache/fop/tools/anttasks/Fop.java index 6f9b2fc34..0f28d70e7 100644 --- a/src/java/org/apache/fop/tools/anttasks/Fop.java +++ b/src/java/org/apache/fop/tools/anttasks/Fop.java @@ -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. @@ -212,6 +213,24 @@ public class Fop extends Task { } /** + * 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(); |