## Defined variables #set ($bodybg = "#ffffff") #set ($bodyfg = "#000000") #set ($bodylink = "#525D76") #set ($pagebannerbg = "#ffffff") #set ($pagebannerfg = "#625972") #set ($bannerbg = "#726982") #set ($bannerfg = "#ffffff") #set ($subbannerbg = "#9289A2") #set ($subbannerfg = "#ffffff") #set ($tablethbg = "#039acc") #set ($tabletdbg = "#a0ddf0") #document() ## This is where the macro's live #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.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.getText().length() != 0 || $value.hasChildren()) $value.getContent() #else   #end #end #macro ( projectanchor $name $value ) #if ($value.startsWith("http://")) $name #elseif($value.equals("#")) $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 #if ($value.getAttributeValue("usemap")) #set ($usemap=$value.getAttributeValue("usemap")) #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)
#projectanchor($section.getAttributeValue("name") "#")
#foreach ( $items in $section.getChildren() ) $items #end
#end #macro ( makeMenu ) #set ($menus = $project.getChild("body").getChildren("menu")) #foreach ( $menu in $menus )
$menu.getAttributeValue("name")
#foreach ( $item in $menu.getChildren() ) #set ($name = $item.getAttributeValue("name")) #projectanchor($name $item.getAttributeValue("href"))
#end
#end #end #macro ( makeTabs ) ##TODO Make this work! #set ($tabs = $project.getChild("body").getChildren("tab")) #foreach ($tab in $tabs)
#set ($pos = $tab.getAttributeValue("position").concat("px")) #set ($name =$tab.getAttributeValue("name")) #set ($label = $tab.getAttributeValue("label")) #set ($roll = $tab.getAttributeValue("rollover")) #if ($name.equals($root.getChild("properties").getChild("tab").getText())) #set ($label = $roll) #end
#end #end #macro (getProjectImage) #set ( $logoString = $project.getChild("logo").getAttributeValue("href") ) $project.getChild( #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 $pageBanner #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() ##makeTabs()
#makeMenu() #set ($allSections = $root.getChild("body").getChildren("section")) #foreach ( $section in $allSections ) #section ($section) #end
#end