## Defined variables #set ($bodybg = "#ffffff") #set ($bodyfg = "#000000") #set ($bodylink = "#525D76") #set ($titlebg = "#FFFFFF") #set ($titlefg = "#2222AA") #set ($bannerbg = "#FFFFFF") #set ($bannerfg = "#2222AA") #set ($subbannerbg = "#828DA6") #set ($subbannerfg = "#ffffff") #document() ## This is where the macro's live #macro ( projectanchor $name $value ) #if ($value.startsWith("http://")) $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")) #end #end ## ============================================ ## subsection macro ## ============================================ #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 ## =================================== ## titleSection macro ## =================================== #macro ( titleSection $titleSection) $titleSection.getAttributeValue("name") #end ## ================================ ## section macro ## ================================ #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("subsection")) #subsection ($items) #else $items #end #end #end ## =================================== ## make navigation bar ## =================================== #macro ( makeNavigationBar )
#set ($menus = $project.getChild("body").getChildren("menu")) #foreach ( $menu in $menus ) #foreach ($item in $menu.getChildren() ) #set ($name = $item.getAttributeValue("name")) #end #end
#end ## ==================================== ## getProjectImage ## ==================================== #macro (getProjectImage) ## #end #macro (printMeta $metaElement) #end #macro (faqIndex $root) #set( $section = 1 ) #foreach ( $s in $root.getChild("body").getChildren() ) #if ($s.getName().equals("faqSection")) #set( $counter = 1 )
Section $section. $s.getChild("title").getContent()
#foreach ( $q in $s.getChildren() ) #if ($q.getName().equals("question"))
Question $section.$counter $q.getChild("title").getContent()
#set( $counter = $counter + 1 ) #end #end #set( $section = $section + 1 ) #end #end #end #macro (faqContents $root)
#set( $section = 1 ) #foreach ( $s in $root.getChild("body").getChildren() ) #if ($s.getName().equals("faqSection")) #set( $counter = 1 )
Section $section. $s.getChild("title").getContent()
#foreach ( $i in $s.getChildren() ) #if ($i.getName().equals("question"))
$section.$counter $i.getChild("title").getContent()
#set( $counter = $counter + 1 ) $i.getChild("answer").getContent() #elseif ($i.getName().equals("text")) $i.getContent() #end #end #set( $section = $section + 1 ) #end #end #end #macro (messages $root) #foreach ( $m in $root.getChild("body").getChildren() ) #if ($m.getName().equals("message"))
Message: $m.getChild("title").getContent()
$m.getChild("explanation").getContent()
#end #end #end #macro (document) #set ($properties = $root.getChild("properties") ) #set ($authors = $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 ($properties.getChild("base")) #set ($url = $properties.getChild("base").getAttributeValue("href")) #end #set ($links = $properties.getChildren("link")) #foreach ( $l in $links ) #end $project.getChild("title").getText() - $properties.getChild("title").getText() #getProjectImage()

#foreach ( $item in $root.getChild("body").getChildren() ) #if ($item.getName().equals("img")) #image ($item) #elseif ($item.getName().equals("section")) #section ($item) #elseif ($item.getName().equals("faqSection")) ## do nothing, we'll handle the faq later #elseif ($item.getName().equals("message")) ## do nothing, we'll handle the faq later #else $item #end #end #faqIndex ($root) #faqContents ($root) #messages ($root) ## #if ($root.getChild("body").getChild("titleSection")) ## #set ($titleSection = $root.getChild("body").getChild("titleSection")) ## #titleSection($titleSection) ## #end ## ## #set ($allSections = $root.getChild("body").getChildren("section")) ## #foreach ( $section in $allSections ) ## #section ($section) ## #end
Copyright © 1999-2005, Apache Software Foundation
#makeNavigationBar() #end