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 ac...@apache.org on 2008/07/09 18:53:01 UTC
svn commit: r675253 - in /xmlgraphics/fop/trunk: examples/fo/build.xml
src/documentation/content/xdocs/trunk/anttask.xml
src/java/org/apache/fop/tools/anttasks/Fop.java
Author: acumiskey
Date: Wed Jul 9 09:53:01 2008
New Revision: 675253
URL: http://svn.apache.org/viewvc?rev=675253&view=rev
Log:
Added throwexceptions attribute to FOP ant task. This works around the problem with executing examples/fo/build.xml.
Modified:
xmlgraphics/fop/trunk/examples/fo/build.xml
xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/anttask.xml
xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/anttasks/Fop.java
Modified: xmlgraphics/fop/trunk/examples/fo/build.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/fo/build.xml?rev=675253&r1=675252&r2=675253&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/examples/fo/build.xml (original)
+++ xmlgraphics/fop/trunk/examples/fo/build.xml Wed Jul 9 09:53:01 2008
@@ -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>
Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/anttask.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/anttask.xml?rev=675253&r1=675252&r2=675253&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/anttask.xml (original)
+++ xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/anttask.xml Wed Jul 9 09:53:01 2008
@@ -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>
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/anttasks/Fop.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/anttasks/Fop.java?rev=675253&r1=675252&r2=675253&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/anttasks/Fop.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/tools/anttasks/Fop.java Wed Jul 9 09:53:01 2008
@@ -77,6 +77,7 @@
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 @@
}
/**
+ * 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 @@
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();
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org