jvanzyl 2002/06/27 11:41:52
Modified: src/templates/build/plugins/xdoc plugin.jelly
Added: src/templates/build/plugins/xdoc site.dvsl
Log:
Trying to isolate the elements of each plugin.
Revision Changes Path
1.4 +6 -2
jakarta-turbine-maven/src/templates/build/plugins/xdoc/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/templates/build/plugins/xdoc/plugin.jelly,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- plugin.jelly 27 Jun 2002 17:16:41 -0000 1.3
+++ plugin.jelly 27 Jun 2002 18:41:52 -0000 1.4
@@ -53,7 +53,7 @@
extension=".html"
force="true"
toolboxfile="${maven.home}/stylesheets/toolbox.props"
- style="${maven.home}/stylesheets/site.dvsl"
+ style="${maven.home}/plugins/xdoc/site.dvsl"
excludes="**/project.xml,**/template.xml"
includes="**/*.xml"
outputencoding="${maven.docs.outputencoding}">
@@ -76,12 +76,16 @@
extension=".html"
force="true"
toolboxfile="${maven.home}/stylesheets/toolbox.props"
- style="${maven.home}/stylesheets/site.dvsl"
+ style="${maven.home}/plugins/xdoc/site.dvsl"
excludes="**/project.xml,**/template.xml"
includes="**/*.xml"
outputencoding="${maven.docs.outputencoding}">
<!-- Need to add the maven jar to load the toolbox -->
+
+ <!--
<classpath refid="maven-classpath"/>
+ -->
+
<tool name="toolbox.string.basedir" value="${basedir}"/>
<tool name="toolbox.string.docSrc" value="${maven.docs.src}"/>
<tool name="toolbox.string.srcDir" value="${maven.src.dir}"/>
1.1 jakarta-turbine-maven/src/templates/build/plugins/xdoc/site.dvsl
Index: site.dvsl
===================================================================
#######################################################################
## V E L O C I T Y M A C R O S ##
#######################################################################
## Alternator for row style in a table
##
#macro (printRow $count)
#if ($count % 2 > 0)
<tr class="a">
#else
<tr class="b">
#end
#end
## Sets the navigation file
##
#macro (loadNavigation $filename)
#set( $nav = $node.selectSingleNode("document('$filename')/project") )
#end
## Selects the appropriate navigation file to use for the navbar. The
## current search priority is:
##
## - navigation.xml in current directory
## - navigation.xml in xdocs directory
## - projext.xml in xdocs directory (deprecated)
## - project.xml in xdocs/stylesheets
##
#macro (selectNavigation $fileUtil $docSrc)
#if ($fileUtil.file("$docSrc/$currentDir/navigation.xml").exists())
#loadNavigation ("$docSrc/$currentDir/navigation.xml")
#elseif ($fileUtil.file("$docSrc/navigation.xml").exists())
#loadNavigation ("$docSrc/navigation.xml")
#elseif ($fileUtil.file("$docSrc/project.xml").exists())
#loadNavigation ("$docSrc/project.xml")
#elseif ($fileUtil.file("$docSrc/stylesheets/project.xml").exists())
#loadNavigation ("$docSrc/stylesheets/project.xml")
#end
#end
#######################################################################
## D V S L M A T C H I N G S T A R T S H E R E ##
#######################################################################
#match( "document" )
<!DOCTYPE html PUBLIC "-//CollabNet//DTD XHTML 1.0 Transitional//EN"
"http://www.collabnet.com/dtds/collabnet_transitional_10.dtd">
## Setup the relativePath using the toolbox.
#set( $infilename = $context.getAppValue("infilename"))
#set( $currentDir = $context.toolbox.pathtool.getDirectoryComponent($infilename))
#set( $relativePath = $context.toolbox.pathtool.getRelativePath($infilename))
## Grab a reference to the project descriptor here so we can pull
## info from it such as the cvs web url, etc ...
#set( $pomFilename = "$context.toolbox.basedir/project.xml")
#set( $pom = $node.selectSingleNode("document('$pomFilename')/project"))
## Selects the correct navigation file to use for this document.
#selectNavigation ($context.toolbox.fileutil $context.toolbox.docSrc)
<html>
<head>
<title>$!nav.title - $node.properties.title</title>
<style type="text/css">
@import url("$relativePath/style/tigris.css");
@import url("$relativePath/style/maven.css");
</style>
<script type="text/javascript">
if (document.layers) {
document.writeln('<link rel="stylesheet" type="text/css"
href="$relativePath/style/ns4_only.css" media="screen" /><link rel="stylesheet"
type="text/css" href="$relativePath/style/maven_ns4_only.css" media="screen" />')
}
</script>
<link rel="stylesheet" type="text/css" href="$relativePath/style/print.css"
media="print" />
#foreach( $n in $node.properties.selectNodes("author") )
<meta name="author" value="$n"/>
<meta name="email" value="$n.attribute("email")" />
#end
</head>
<body class="composite" marginwidth="0" marginheight="0">
<div id="banner">
<table border="0" cellspacing="0" cellpadding="8" width="100%">
<tr>
<td>
#if( $pom.organization.logo )
#set( $alt = $pom.organization.name )
#set( $src = $pom.organization.logo )
#if ( $pom.organization.url )
#set( $home = $pom.organization.url )
#else
## Fall back to the project url
#set( $home = $pom.url )
#end
<a href="$home">
#if( $src.toString().startsWith("http") )
<img src="$src" align="left" alt="$alt" border="0" />
#else
<img src="$relativePath$src" align="left" alt="$alt" border="0" />
#end
</a>
#else
## Default to the Jakarta logo if one has not been defined.
<a href="http://jakarta.apache.org/">
<img src="$relativePath/images/jakarta-logo-blue.gif" align="left"
alt="The Jakarta Project" border="0"/>
</a>
#end
</td>
<td>
<div align="right" id="login">
#if( $pom.logo )
#set( $alt = $pom.name )
#set( $home = $pom.url )
#set( $src = $pom.logo )
<a href="$home">
#if ( $src.toString().startsWith("http") )
<img src="$src" align="right" alt="$alt" border="0"/>
#else
<img src="$relativePath$src" align="right" alt="$alt"
border="0"/>
#end
</a>
#end
</div>
</td>
</tr>
</table>
</div>
<div id="breadcrumbs">
<table border="0" cellspacing="0" cellpadding="4" width="100%">
<tr>
<td>
#if ($nav.get("body/links/*"))
$context.applyTemplates( $nav, "body/links" )
#else
#end
</td>
</tr>
</table>
</div>
<table border="0" cellspacing="0" cellpadding="8" width="100%" id="main">
<tr valign="top">
<td id="leftcol" width="20%">
<div id="navcolumn">
#if ($nav)
$context.applyTemplates( $nav, "body/menu" )
#end
## Standard Maven Navigation
<div><strong>Project Documentation</strong>
<div><small><a href="$relativePath/index.html">Front
Page</a></small></div>
<div>
<small><a href="$relativePath/project-info.html">Project
Info</a></small>
#set ($projectInfoFiles = ["dependencies", "mail-lists",
"project-info", "team-list"])
#foreach ($infoFile in $projectInfoFiles)
#if ($currentDir == "." && $infilename == "${infoFile}.xml")
<div><small><a href="$relativePath/mail-lists.html">Mailing
Lists</a></small></div>
<div><small><a href="$relativePath/team-list.html">Project
Team</a></small></div>
<div><small><a
href="$relativePath/dependencies.html">Dependencies</a></small></div>
#if ($pom.repository.url)
<div><small><a
href="$pom.repository.url.toString().trim()">Source Repository</a></small></div>
#end
#if ($pom.issueTrackingUrl)
<div><small><a
href="$pom.issueTrackingUrl.toString().trim()">Issue Tracking</a></small></div>
#end
#end
#end
</div>
<div>
<small><a href="$relativePath/maven-reports.html">Project
Reports</a></small>
#set ($projectReportFiles = ["activity-log", "changelog",
"checkstyle-report", "file-activity-report", "jdepend-report", "junit-report",
"maven-reports", "task-list", "tasks"])
#foreach ($reportFile in $projectReportFiles)
#if ($currentDir == "." && $infilename == "${reportFile}.xml")
#if
($context.toolbox.fileutil.file("$context.toolbox.docSrc/tasks.xml").exists())
<div><small><a
href="$relativePath/tasks.html">Tasks</a></small></div>
#end
#if
($context.toolbox.fileutil.file("$context.toolbox.genDoc/task-list.xml").exists())
<div><small><a href="$relativePath/task-list.html">Task
List</a></small></div>
#end
#if ($pom.repository)
<div><small><a href="$relativePath/changelog.html">Change
Log</a></small></div>
<div><small><a
href="$relativePath/activity-log.html">Developer Activity</a></small></div>
<div><small><a
href="$relativePath/file-activity-report.html">File Activity</a></small></div>
#end
#if ($context.toolbox.testSrcPresent == "true")
<div><small><a href="$relativePath/junit-report.html">Unit
Tests</a></small></div>
#end
#if ($context.toolbox.srcPresent == "true")
<div><small><a href="$relativePath/jdepend-report.html">Metric
Results</a></small></div>
<div><small><a
href="$relativePath/checkstyle-report.html">Checkstyle Report</a></small></div>
#end
#if
($context.toolbox.fileutil.file("$context.toolbox.docDest/clover").exists())
<div><small><a href="$relativePath/clover/index.html">Clover
Test Coverage</a></small></div>
#end
#end
#end
</div>
#if ($context.toolbox.srcPresent == "true")
<div><small><a
href="$relativePath/apidocs/index.html">JavaDocs</a></small></div>
<div><small><a href="$relativePath/xref/index.html">Source
XReference</a></small></div>
#end
<div><small><a
href="http://jakarta.apache.org/turbine/maven/development-process.html">Development
Process</a></small></div>
</div>
</div>
</td>
<td>
<div id="bodycol">
## Insert MAIN body here
<div class="app">
$context.applyTemplates("body/section")
$context.applyTemplates("body/glossary")
$context.applyTemplates("body/changelog")
$context.applyTemplates("body/taskList")
</div>
</div>
</td>
</tr>
</table>
<div id="footer">
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td>
#if( $pom.organization.name )
#if( $pom.inceptionYear )
#if( $pom.inceptionYear.toString() ==
$context.toolbox.currentYear )
© ${context.toolbox.currentYear}, $pom.organization.name
#else
© ${pom.inceptionYear}-${context.toolbox.currentYear},
$pom.organization.name
#end
#else
© ${context.toolbox.currentYear}, $pom.organization.name
#end
#else
© 1999-2002, Apache Software Foundation
#end
</td>
</tr>
</table>
</div>
</body>
</html>
#end
#macro( itemLink $item )
#if( $item.attrib("href").startsWith("http") ||
$item.attrib("href").startsWith("/site") )
<a href="$item.attrib('href')">$item.attrib("name")</a>
#else
<a href="$relativePath$item.attrib('href')">$item.attrib("name")</a>
#end
#end
#*
* Process a menu for the navigation bar
*#
#match( "menu" )
<div>
<strong>$attrib.name</strong>
$context.applyTemplates( "item" )
</div>
#end
#match( "item" )
<div>
<small> #itemLink( $node ) </small>
$context.applyTemplates( "item" )
</div>
#end
#*
* Process the breadcrumb navbar
*#
#match ( "links" )
<div align="right">
#foreach ($item in $node.selectNodes("item"))
#if ($velocityCount != 1) | #end
#itemLink( $item )
#end
</div>
#end
#*
* process a documentation section
*#
#match( "section" )
<div class="h3">
#if ($attrib.name.length() > 0)
<h3><a name="$attrib.name">$attrib.name</a></h3>
#end
$context.applyTemplates("*")
</div>
#end
#match( "subsection" )
<div class="h4">
#if ($attrib.name.length() > 0)
<h4><a name="$attrib.name">$attrib.name</a></h4>
#end
$context.applyTemplates("*")
</div>
#end
#match( "source" )
<div id="source">
<pre>$toolbox.htmlescape.getText( $node.value() )</pre>
</div>
## <div id="helptext">
## <table border="0" cellspacing="0" cellpadding="3" width="100%">
## <tr>
## <td>
## <p/>
## <pre>$toolbox.htmlescape.getText( $node.value() )</pre>
## </td>
## </tr>
## </table>
## </div>
#end
#match("table")
#set ($rowcount = 0)
<table cellpadding="3" cellspacing="2" border="1" width="100%">
$context.applyTemplates("*")
</table>
#end
#match("tr")
#printRow ($rowcount)
#set ($rowcount = $rowcount + 1)
$context.applyTemplates("*")
</tr>
#end
#match( "td" )
<td
#if ($attrib.colspan)
#set ($colspan = $attrib.colspan)
colspan="$!colspan"
#end
#if ($attrib.rowspan)
#set ($rowspan = $attrib.rowspan)
rowspan="$!rowspan"
#end
>
$node.copy( $node.children() )
</td>
#end
#match( "th" )
<th
#if ($attrib.colspan)
#set ($colspan = $attrib.colspan )
colspan="$!colspan"
#end
#if ($attrib.rowspan)
#set ($rowspan = $attrib.rowspan )
rowspan="$!rowspan"
#end
>
$node.copy( $node.children())
</th>
#end
## -----------------------------------------------------
## G L O S S A R Y
## -----------------------------------------------------
#match ( "glossary" )
$context.applyTemplates("glossary-entries/glossary-entry")
#end
#*
#match ("glossary-entry")
<strong>$context.node.name</strong>
<br/>
$context.node.definition
<p/>
#end
*#
## -----------------------------------------------------
## C H A N G E L O G
## -----------------------------------------------------
#match("changelog")
#set ($rowcount = 0)
<table>
<tr>
<th>Date</th><th>Author</th><th>Files/Message</th>
</tr>
$context.applyTemplates("changelog-entry")
</table>
#end
#match( "changelog-entry" )
#printRow ($rowcount)
<td>$node.date.value() $node.time.value()</td>
<td>$context.toolbox.htmlescape.getText($node.author.value())</td>
<td>$context.applyTemplates("file")
<pre>$context.toolbox.htmlescape.getText($node.msg.value())</pre>
</td>
</tr>
#set ($rowcount = $rowcount + 1)
#end
#match("file")
<a href="$pom.repository.url.toString().trim()$node.name.value()">
$node.name.value()</a> -
<a
href="$pom.repository.url.toString().trim()$node.name.value()?rev=$node.revision.value()&content-type=text/vnd.viewcvs-markup">
v$node.revision.value()</a> <br/>
#end
## -----------------------------------------------------
## T A S K L I S T
## -----------------------------------------------------
#match( "taskList" )
#set ($rowcount = 0)
<table>
<tr>
<th>Filename / Tasks</th>
</tr>
$context.applyTemplates("taskEntry")
</table>
#end
#match( "taskEntry" )
#printRow ($rowcount)
<td>
$node.filename.value()
$context.applyTemplates("tasks/task")
</td>
</tr>
#set ($rowcount = $rowcount + 1)
#end
#match( "task" )
<ul>
<li> $node.description.value() </li>
</ul>
#end
## -----------------------------------------------------
## D E F A U L T C O P Y
## -----------------------------------------------------
#match("*")
$node.copy()
#end
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>