#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.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("width"))
#set ($width = $value.getAttributeValue("width"))
#end
#if ($value.getText().length() != 0 || $value.hasChildren())
$value.getContent()
#else
#end
#end
#macro ( projectanchor $name $value )
#if ($value.startsWith("http://"))
$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"))
#end
#end
#macro ( source $value)
$escape.getText($value.getText())
#end
#macro ( subsection $subsection)
#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 (docinclude $name)
#include($name)
#end
#macro ( section $section)
#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
Back to top
#end
#macro ( makeProject )
#set ($menus = $project.getChild("body").getChildren("menu"))
#foreach ( $menu in $menus )
#foreach ( $item in $menu.getChildren() )
#set ($name = $item.getAttributeValue("name"))
#foreach ( $subitem in $item.getChildren() )
#set ($name = $subitem.getAttributeValue("name"))
#end
#end
#end
#end
#macro (getProjectImage)
#if ($project.getChild("logo"))
#set ( $logoString = $project.getChild("logo").getAttributeValue("href") )
#if ( $logoString.startsWith("/") )
#else
#end
#end
#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()
#set ($links = $root.getChild("properties").getChildren("link"))
#foreach ( $link in $links )
$link
#end
#set ($csspath = "")
#if (!$relativePath.equals("."))
#set ($csspath = "${relativePath}/")
#end
#if ($root.getChild("properties").getChild("style"))
$root.getChild("properties").getChild("style")
#end
Apache Harmony is retired at the Apache Software Foundation since Nov 16, 2011.
The information on these pages may be out of date, or may refer to
resources that have moved or have been made read-only.
For more information please refer to the
Apache Attic
#set ($allSections = $root.getChild("body").getChildren("section"))
#foreach ( $section in $allSections )
#section ($section)
#end
#set ($allInclude = $root.getChild("body").getChildren("docinclude"))
#foreach($inc in $allInclude)
#docinclude($inc.getAttributeValue("name"))
#end
#end