From: Jeff J. <jef...@us...> - 2007-05-29 20:43:40
|
jeffjensen 07/05/29 13:43:33 Modified: findbugs/src/plugin-resources findbugs.jsl Log: Change from binary to ascii file mode. Revision Changes Path 1.4 +120 -120 maven-plugins/findbugs/src/plugin-resources/findbugs.jsl Index: findbugs.jsl =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/findbugs/src/plugin-resources/findbugs.jsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- findbugs.jsl 2 May 2006 05:37:11 -0000 1.3 +++ findbugs.jsl 29 May 2007 20:43:33 -0000 1.4 @@ -1,120 +1,120 @@ -<?xml version="1.0"?> - -<jsl:stylesheet - select="$doc" - xmlns:j="jelly:core" - xmlns:jsl="jelly:jsl" - xmlns:util="jelly:util" - xmlns:x="jelly:xml" - xmlns:doc="doc" - xmlns="dummy" trim="false"> - - <!-- This needs to be instantiated here to be available in the template matches --> - <j:useBean var="mavenTool" class="org.apache.maven.util.MavenTool"/> - <j:useBean var="htmlescape" class="org.apache.velocity.anakia.Escape"/> - <j:useBean var="fileutil" class="org.apache.velocity.texen.util.FileUtil"/> - <j:useBean var="pathtool" class="org.apache.maven.util.DVSLPathTool"/> - - <jsl:template match="BugCollection"> - <document> - - <properties> - <title>FindBugs Results</title> - </properties> - - <body> - <section name="FindBugs Results"> - <p> - The following document contains the results of - <a - href="http://findbugs.sourceforge.net/">FindBugs</a>. - </p> - </section> - - <section name="Summary"> - <j:set var="fileCount"><x:expr select="count(file)"/></j:set> - <j:set var="errorCount"><x:expr select="count(file/BugInstance)"/></j:set> - <table> - <tr> - <th>Files</th> - <th>Errors</th> - </tr> - <tr> - <td><doc:formatAsNumber string="${fileCount}" pattern="0"/></td> - <td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td> - </tr> - </table> - </section> - - <section name="Files"> - <table> - <tr> - <th>Files</th> - <th>Violations</th> - </tr> - <x:set var="files" select="file"/> - <!-- x:forEach is busted --> - <j:forEach var="file" items="${files}"> - - <j:set var="name" value="${file.attribute('classname').getValue()}"/> - <!--- +1 is for the trailing slash above --> - <j:set var="errorCount"><x:expr select="count($file/BugInstance)"/></j:set> - - <j:if test="${errorCount != 0}"> - <tr> - <td> - <a href="#${name}">${name}</a> - </td> - <td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td> - </tr> - </j:if> - </j:forEach> - </table> - - <j:forEach var="file" items="${files}"> - <x:set var="errorCount" select="count($file/BugInstance)"/> - <j:if test="${errorCount != 0}"> - <j:set var="name" value="${file.attribute('classname').getValue()}"/> - <subsection name="${name}"> - <table> - <tr> - <th>Violation</th> - <th>Line</th> - <th>Priority</th> - </tr> - <x:set var="errors" select="$file/BugInstance"/> - <j:forEach var="error" items="${errors}"> - <tr> - <td> - <j:set var="errorMessage" value="${error.attribute('message').getValue()}"/> - <a alt="Bug Description" title="Bug Description" target="_blank" - href="http://findbugs.sourceforge.net/bugDescriptions.html#${error.attribute('type').getValue()}"> - ${htmlescape.getText(errorMessage)} - </a> - </td> - <td> - <j:set var="line" value="${error.attribute('line').getValue()}"/> - <util:replace var="jxrName1" value="${name}" oldChar="." newChar="/"/> - <util:tokenize var="jxrName2" delim="\$">${jxrName1}</util:tokenize> - - <j:set var="loopOnceVar" value="TRUE"/> - <j:forEach var="jxrName3" items="${jxrName2}"> - <j:if test="${loopOnceVar=='TRUE'}"> - <a href="xref/${jxrName3}.html#${line}">${line}</a> - <j:set var="loopOnceVar" value="FALSE"/> - </j:if> - </j:forEach> - </td> - <td>${error.attribute('priority').getValue()} - </td> - </tr> - </j:forEach> - </table> - </subsection> - </j:if> - </j:forEach> - </section> - </body> - </document> - </jsl:template> -</jsl:stylesheet> +<?xml version="1.0"?> + +<jsl:stylesheet + select="$doc" + xmlns:j="jelly:core" + xmlns:jsl="jelly:jsl" + xmlns:util="jelly:util" + xmlns:x="jelly:xml" + xmlns:doc="doc" + xmlns="dummy" trim="false"> + + <!-- This needs to be instantiated here to be available in the template matches --> + <j:useBean var="mavenTool" class="org.apache.maven.util.MavenTool"/> + <j:useBean var="htmlescape" class="org.apache.velocity.anakia.Escape"/> + <j:useBean var="fileutil" class="org.apache.velocity.texen.util.FileUtil"/> + <j:useBean var="pathtool" class="org.apache.maven.util.DVSLPathTool"/> + + <jsl:template match="BugCollection"> + <document> + + <properties> + <title>FindBugs Results</title> + </properties> + + <body> + <section name="FindBugs Results"> + <p> + The following document contains the results of + <a + href="http://findbugs.sourceforge.net/">FindBugs</a>. + </p> + </section> + + <section name="Summary"> + <j:set var="fileCount"><x:expr select="count(file)"/></j:set> + <j:set var="errorCount"><x:expr select="count(file/BugInstance)"/></j:set> + <table> + <tr> + <th>Files</th> + <th>Errors</th> + </tr> + <tr> + <td><doc:formatAsNumber string="${fileCount}" pattern="0"/></td> + <td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td> + </tr> + </table> + </section> + + <section name="Files"> + <table> + <tr> + <th>Files</th> + <th>Violations</th> + </tr> + <x:set var="files" select="file"/> + <!-- x:forEach is busted --> + <j:forEach var="file" items="${files}"> + + <j:set var="name" value="${file.attribute('classname').getValue()}"/> + <!--- +1 is for the trailing slash above --> + <j:set var="errorCount"><x:expr select="count($file/BugInstance)"/></j:set> + + <j:if test="${errorCount != 0}"> + <tr> + <td> + <a href="#${name}">${name}</a> + </td> + <td><doc:formatAsNumber string="${errorCount}" pattern="0"/></td> + </tr> + </j:if> + </j:forEach> + </table> + + <j:forEach var="file" items="${files}"> + <x:set var="errorCount" select="count($file/BugInstance)"/> + <j:if test="${errorCount != 0}"> + <j:set var="name" value="${file.attribute('classname').getValue()}"/> + <subsection name="${name}"> + <table> + <tr> + <th>Violation</th> + <th>Line</th> + <th>Priority</th> + </tr> + <x:set var="errors" select="$file/BugInstance"/> + <j:forEach var="error" items="${errors}"> + <tr> + <td> + <j:set var="errorMessage" value="${error.attribute('message').getValue()}"/> + <a alt="Bug Description" title="Bug Description" target="_blank" + href="http://findbugs.sourceforge.net/bugDescriptions.html#${error.attribute('type').getValue()}"> + ${htmlescape.getText(errorMessage)} + </a> + </td> + <td> + <j:set var="line" value="${error.attribute('line').getValue()}"/> + <util:replace var="jxrName1" value="${name}" oldChar="." newChar="/"/> + <util:tokenize var="jxrName2" delim="\$">${jxrName1}</util:tokenize> + + <j:set var="loopOnceVar" value="TRUE"/> + <j:forEach var="jxrName3" items="${jxrName2}"> + <j:if test="${loopOnceVar=='TRUE'}"> + <a href="xref/${jxrName3}.html#${line}">${line}</a> + <j:set var="loopOnceVar" value="FALSE"/> + </j:if> + </j:forEach> + </td> + <td>${error.attribute('priority').getValue()} + </td> + </tr> + </j:forEach> + </table> + </subsection> + </j:if> + </j:forEach> + </section> + </body> + </document> + </jsl:template> +</jsl:stylesheet> |