Files
maven-plugins/tasklist/src/plugin-resources/templates/tasklist.vm
aheritier c3e6ad8894 MPTASKLIST-9 : Show todos for fields
reviewed by aheritier

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@185092 13f79535-47bb-0310-9956-ffa450edef68
2005-06-06 23:05:46 +00:00

167 lines
5.6 KiB
XML

<?xml version="1.0" encoding="$encoding"?>
<document>
<properties>
<author email="turbine-maven-user@jakarta.apache.org">Maven</author>
<title>Todos</title>
</properties>
<body>
<section name="Todos">
<table summary="todo summary">
<thead>
<tr>
<th>Class</th>
<th>Class Todos Count</th>
<th>Method Todos Count</th>
<th>Field Todos Count</th>
</tr>
</thead>
<tbody>
#set ($classesCount = 0)
#foreach ($class in $docInfo.classes)
#set ($classTodosCount = $class.getTags($jellyContext.taskTag).size() )
#set ($methodTodosCount = 0)
#foreach ($m in $class.methods)
#set ($methodTodoTags = $m.getTags($jellyContext.taskTag))
#if ($methodTodoTags.size() > 0)
#set ($methodTodosCount = $methodTodosCount + $methodTodoTags.size())
#end
#end
#set ($fieldTodosCount = 0)
#foreach ($f in $class.fields)
#set ($fieldTodoTags = $f.getTags($jellyContext.taskTag))
#if ($fieldTodoTags.size() > 0)
#set ($fieldTodosCount = $fieldTodosCount + $fieldTodoTags.size())
#end
#end
#if ($classTodosCount > 0 || $methodTodosCount > 0 || $fieldTodosCount > 0)
#set ($classesCount = $classesCount + 1 )
<tr>
<td>
<a href="#$class.name">$class.name</a>
</td>
<td>
#if ($classTodosCount > 0)
<a href="#${class.name}.class.todos">$classTodosCount</a>
#else
0
#end
</td>
<td>
#if ($methodTodosCount > 0)
<a href="#${class.name}.method.todos">$methodTodosCount</a>
#else
0
#end
</td>
<td>
#if ($fieldTodosCount > 0)
<a href="#${class.name}.field.todos">$fieldTodosCount</a>
#else
0
#end
</td>
</tr>
#end
#end
#if ($classesCount == 0)
<tr>
<td colspan="4"><em>No class, method or field todo found</em></td>
</tr>
#end
</tbody>
</table>
#foreach ($class in $docInfo.classes)
#set ($todoTags = $class.getTags($jellyContext.taskTag))
#set ($hasMethodTodos = false)
#foreach ($m in $class.methods)
#set ($methodTodoTags = $m.getTags($jellyContext.taskTag))
#if ($methodTodoTags.size() > 0)
#set ($hasMethodTodos = true)
#end
#end
#set ($hasFieldTodos = false)
#foreach ($f in $class.fields)
#set ($fieldTodoTags = $f.getTags($jellyContext.taskTag))
#if ($fieldTodoTags.size() > 0)
#set ($hasFieldTodos = true)
#end
#end
#if ($todoTags.size() > 0 || $hasMethodTodos || $hasFieldTodos)
<subsection name="$class.name">
#if ($todoTags.size() > 0)
<table summary="$class.name todos">
<thead>
<tr>
<th><a name="${class.name}.class.todos">Class Todos</a></th>
</tr>
</thead>
<tbody>
#foreach ($tag in $todoTags)
<tr>
<td>
<![CDATA[$tag.value]]>
</td>
</tr>
#end
</tbody>
</table>
#end
#if ($hasMethodTodos)
<table summary="${class.name} method todos">
<thead>
<tr>
<th><a name="${class.name}.method.todos">Method Todos</a></th>
</tr>
</thead>
<tbody>
#foreach ($m in $class.methods)
#set ($methodTodoTags = $m.getTags($jellyContext.taskTag))
#if ($methodTodoTags.size() > 0)
#foreach ($tag in $methodTodoTags)
<tr>
<td>
<![CDATA[${m.name}(): $tag.value]]>
</td>
</tr>
#end
#end
#end
</tbody>
</table>
#end
#if ($hasFieldTodos)
<table summary="${class.name} field todos">
<thead>
<tr>
<th><a name="${class.name}.field.todos">Field Todos</a></th>
</tr>
</thead>
<tbody>
#foreach ($f in $class.fields)
#set ($fieldTodoTags = $f.getTags($jellyContext.taskTag))
#if ($fieldTodoTags.size() > 0)
#foreach ($tag in $fieldTodoTags)
<tr>
<td>
<![CDATA[${f.name}: $tag.value]]>
</td>
</tr>
#end
#end
#end
</tbody>
</table>
#end
</subsection>
#end
#end
</section>
</body>
</document>