## Defined variables #set ($menutablebg = "#FFFFFF") #set ($menutablefg = "#000000") #set ($bodybg = "#ffffff") #set ($bodyfg = "#000000") #set ($bodylink = "#123465") #set ($pagebannerbg = "#669AE6") #set ($pagebannerfg = "#000000") #set ($bannerbg = "#EEEEEE") #set ($bannerfg = "#000000") #set ($subbannerbg = "#EFEFEF") #set ($subbannerfg = "#000000") #set ($tablethbg = "#039acc") #set ($tabletdbg = "#a0ddf0") #set ($colorhrline = "#999999") #document() ## This is where the macro's live #macro ( feature $feature)

$feature.getAttributeValue("title")

#foreach ( $items in $feature.getChildren() ) #if ($items.getName().equals("image"))

#end #end

#foreach ( $items in $feature.getChildren() ) #if ($items.getName().equals("text")) $items.getChildren() #end #end
#end #macro ( table $table) #foreach ( $items in $table.getChildren() ) #if ($items.getName().equals("tr")) #tr ($items) #end #end
#end #macro ( tr $tr) #foreach ( $items in $tr.getChildren() ) #if ($items.getName().equals("td")) #td ($items) #elseif ($items.getName().equals("th")) #th ($items) #end #end #end #macro ( td $value) #if ($value.getAttributeValue("colspan")) #set ($colspan = $value.getAttributeValue("colspan")) #end #if ($value.getAttributeValue("rowspan")) #set ($rowspan = $value.getAttributeValue("rowspan")) #end #if ($value.getAttributeValue("class")) #set ($class = $value.getAttributeValue("class")) #end #if ($value.getText().length() != 0 || $value.hasChildren()) $value.getContent() #else   #end #end #macro ( th $value) #if ($value.getAttributeValue("colspan")) #set ($colspan = $value.getAttributeValue("colspan")) #end #if ($value.getAttributeValue("rowspan")) #set ($rowspan = $value.getAttributeValue("rowspan")) #end #if ($value.getAttributeValue("class")) #set ($class = $value.getAttributeValue("class")) #end #if ($value.getText().length() != 0 || $value.hasChildren()) $value.getContent() #else   #end #end #macro ( projectanchor $name $value ) #if ($value.startsWith("http://") || $value.startsWith("https://")) $name #elseif ($value.startsWith("/site")) $name #else $name #end #end #macro ( metaauthor $author $email ) #end #macro ( image $value ) #if ($value.getAttributeValue("width")) #set ($width=$value.getAttributeValue("width")) #end #if ($value.getAttributeValue("height")) #set ($height=$value.getAttributeValue("height")) #end #if ($value.getAttributeValue("align")) #set ($align=$value.getAttributeValue("align")) #else #set ($align="middle") #end #end #macro ( source $value)
$escape.getText($value.getText())
#end #macro ( subsection $subsection)
$subsection.getAttributeValue("name")
#foreach ( $items in $subsection.getChildren() ) #if ($items.getName().equals("img")) #image ($items) #elseif ($items.getName().equals("source")) #source ($items) #elseif ($items.getName().equals("table")) #table ($items) #else $items #end #end

#end #macro ( section $section)
$section.getAttributeValue("name")
#foreach ( $items in $section.getChildren() ) #if ($items.getName().equals("img")) #image ($items) #elseif ($items.getName().equals("source")) #source ($items) #elseif ($items.getName().equals("table")) #table ($items) #elseif ($items.getName().equals("feature")) #feature ($items) #elseif ($items.getName().equals("subsection")) #subsection ($items) #else $items #end #end

#end #macro ( makeProject )
#set ($menus = $project.getChild("body").getChildren("menu")) #foreach ( $menu in $menus )

$menu.getAttributeValue("name")

#foreach ( $item in $menu.getChildren() ) #set ($name = $item.getAttributeValue("name")) #if ( $item.getAttributeValue("href").length() > 0 ) #projectanchor($name $item.getAttributeValue("href"))
#else $name
#foreach ( $subitem in $item.getChildren() ) #set ($name = $subitem.getAttributeValue("name")) #projectanchor($name $subitem.getAttributeValue("href"))
#end #end #end
#end

#end #macro (getProjectImage) #if ($project.getChild("logo")) #set ( $logoString = $project.getChild("logo").getAttributeValue("href") ) #if ( $logoString.startsWith("/") ) $project.getChild( #else $project.getChild( #end #end #end #macro (getBannerTitle) #if ( $root.getChild("properties").getChild("bannertitle") ) #set ( $pageBanner = $root.getChild("properties").getChild("bannertitle") ) #else #set ( $pageBanner = $root.getChild("properties").getChild("title").getText() ) #end Demo | Download | Installation | Wiki   #end #macro (printMeta $metaElement) #end #macro (document) #set ($authors = $root.getChild("properties").getChildren("author")) #foreach ( $au in $authors ) #metaauthor ( $au.getText() $au.getAttributeValue("email") ) #end #set ($metas = $root.getChildren("meta")) ## Parse meta directives such as ## #foreach ($meta in $metas) #printMeta($meta) #end ## Support for tags. #if ($root.getChild("properties").getChild("base")) #set ($url = $root.getChild("properties").getChild("base").getAttributeValue("href")) #end $project.getChild("title").getText() - $root.getChild("properties").getChild("title").getText()
#getProjectImage() #getBannerTitle()

#makeProject() #set ($allSections = $root.getChild("body").getChildren("section")) #foreach ( $section in $allSections ) #section ($section) #end

Copyright © 2003-2014, The Apache Software Foundation
#end