####################################################################### ## 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) #else #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" ) ## 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( $mavenProject = $context.getAppValue("mavenProject") ) #set( $pomDocument = $mavenProject.createDocument() ) #set( $pom = $pomDocument.selectSingleNode("/project") ) ## Selects the correct navigation file to use for this document. #selectNavigation ($context.toolbox.fileutil $context.toolbox.docSrc) #if ( $!nav.title ) $!nav.title - $node.properties.title #else $mavenProject.name - $node.properties.title #end #foreach( $n in $node.properties.selectNodes("author") ) #end
## Insert MAIN body here
$context.applyTemplates("body/section") $context.applyTemplates("body/glossary") $context.applyTemplates("body/changelog") $context.applyTemplates("body/taskList")
#end #macro( itemLink $item ) #if( $item.attrib("href").startsWith("http") || $item.attrib("href").startsWith("/site") ) $item.attrib("name") #else $item.attrib("name") #end #end #* * Process a menu for the navigation bar *# #match( "menu" )
$attrib.name $context.applyTemplates( "item" )
#end #match( "item" )
#itemLink( $node ) $context.applyTemplates( "item" )
#end #* * Process the breadcrumb navbar *# #match ( "links" )
#if( $context.toolbox.date == "right" ) Last published: $context.toolbox.buildDate #if ($nav.get("body/links/*")) | #end #end #foreach ($item in $node.selectNodes("item")) #if ($velocityCount != 1) | #end #itemLink( $item ) #end
#end #* * process a documentation section *# #match( "section" )
#if ($attrib.name.length() > 0)

$attrib.name

#end $context.applyTemplates("*")
#end #match( "subsection" )
#if ($attrib.name.length() > 0)

$attrib.name

#end $context.applyTemplates("*")
#end #match( "source" )
$toolbox.htmlescape.getText( $node.value() )
##
## ## ## ## ##
##

##

$toolbox.htmlescape.getText( $node.value() )
##
##
#end #match("table") #set ($rowcount = 0) $context.applyTemplates("*")
#end #match("tr") #printRow ($rowcount) #set ($rowcount = $rowcount + 1) $context.applyTemplates("*") #end #match( "td" ) $node.copy( $node.children() ) #end #match( "th" ) $node.copy( $node.children()) #end ## ----------------------------------------------------- ## G L O S S A R Y ## ----------------------------------------------------- #match ( "glossary" ) $context.applyTemplates("glossary-entries/glossary-entry") #end #* #match ("glossary-entry") $context.node.name
$context.node.definition

#end *# ## ----------------------------------------------------- ## C H A N G E L O G ## ----------------------------------------------------- #match("changelog") #set ($rowcount = 0) $context.applyTemplates("changelog-entry")
DateAuthorFiles/Message
#end #match( "changelog-entry" ) #printRow ($rowcount) $node.date.value() $node.time.value() $context.toolbox.htmlescape.getText($node.author.value()) $context.applyTemplates("file")

$context.toolbox.htmlescape.getText($node.msg.value())
#set ($rowcount = $rowcount + 1) #end #match("file") $node.name.value() - v$node.revision.value()
#end ## ----------------------------------------------------- ## T A S K L I S T ## ----------------------------------------------------- #match( "taskList" ) #set ($rowcount = 0) $context.applyTemplates("taskEntry")
Filename / Tasks
#end #match( "taskEntry" ) #printRow ($rowcount) $node.filename.value() $context.applyTemplates("tasks/task") #set ($rowcount = $rowcount + 1) #end #match( "task" ) #end ## ----------------------------------------------------- ## D E F A U L T C O P Y ## ----------------------------------------------------- #match("*") #if ($node.name() == "source") $context.applyTemplates("source"); #else $node.copy() #end #end