## ## Content Stylesheet for Site ## ## Defined variables ## ## ## Start and end the processing ## #document ## ## This is where the macros live ## #macro ( relativise $elem ) #if ($elem.getAttribute("href")) #set ($href = $elem.getAttributeValue("href")) #if ($href.startsWith("/")) #set ($elem = $elem.setAttribute("href", "$relativePath$href")) #end #end #if ($elem.getAttribute("src")) #set ($href = $elem.getAttributeValue("src")) #if ($href.startsWith("/")) #set ($elem = $elem.setAttribute("src", "$relativePath$href")) #end #end #end ## ## #macro ( color_table $table ) #set ($table = $table.setAttribute("class", "colortable")) #foreach ( $tw in $treeWalk.allElements($table) ) #if ($tw.getName().equals("trh")) #set ($tw = $tw.setAttribute("align", "left")) #set ($tw = $tw.setName("th")) #end #end #if (! $table.getAttributeValue("width")) #set ($table = $table.setAttribute("width", "100%")) #end $table #end ## #macro ( make_toc ) #set ($allSections = $root.getChild("body").getChildren("section")) #end ## ## #macro ( make_note $note)
$note
#end ## ## #macro ( metaauthor $author $email ) #end ## ## #macro ( metaatom $title $url ) #end ## ## #macro ( source $value )
$escape.getText($value.getText())
#end ## ## #macro ( eccnmatrix $matrix ) #foreach ( $project in $matrix.getChildren('Project') ) #foreach ( $product in $project.getChildren('Product') ) #set ($prodspan = $product.getChildren("Version").size()) #foreach ( $version in $product.getChildren('Version') ) #set ($sources = '') #foreach ( $source in $version.getChildren('ControlledSource') ) #set ($itA = '') #set ($item = "$itA$source.getAttributeValue('href')$itB$source.getChild('Why').getText()$itC$source.getChild('Manufacturer').getText()") #if ($velocityCount == 1) #set ($sources = $item) #else #set ($sources = "$sources, $item") #end #end #if ($velocityCount == 1) #end #end #end #end
$project.getChild('Name').getText()
Product Name Versions ECCN Controlled Source
$product.getChild('Name').getText()$version.getChild('Names').getText() $version.getChild('ECCN').getText() $sources
#end ## ## #macro ( section $section $level ) #if ($section.getChild("title")) #set ($heading = $section.getChildText("title")) #elseif ($section.getAttributeValue("id")) #set ($heading = $section.getAttributeValue("id")) #else #set ($heading = "") #end #if ($level == 0) #set ($foo = "bar") #elseif ($level == 1) #if ($section.getAttributeValue("id"))

$heading #else

$heading #end

#elseif ($level == 2) #if ($section.getAttributeValue("id"))
$heading #else
$heading #end
#else #if ($section.getAttributeValue("id"))
$heading #else
$heading #end
#end
## First, walk the tree and relativise any absolute path URI references ##foreach ( $tw in $treeWalk.allElements($section) ) ##relativise ($tw) ##end ## Second, output the section-level children with transformers #foreach ( $items in $section.getChildren() ) #if ($items.getName().equals("source")) #source ($items) #elseif ($items.getName().equals("table")) #color_table ($items) #elseif ($items.getName().equals("note")) #make_note ($items) #elseif ($items.getName().equals("toc")) #make_toc () #elseif ($items.getName().equals("eccnmatrix")) #eccnmatrix ($items) #elseif ($items.getName().equals("section")) #set ($sublevel = $level + 1) #section ($items $sublevel) #elseif ($items.getName().equals("title")) ## we already handled this one #else $items #end #end
#end ## ## #macro ( makeProject ) #set ($menus = $project.selectNodes("body/menu")) #foreach ( $menu in $menus ) ##foreach ( $tw in $menu.selectNodes("//*") ) ##relativise ($tw) ##end #set ($title = $menu.getChild("title")) #if ($title.getAttributeValue("href"))
$menu.getChildText("title")
#else
$menu.getChildText("title")
#end #end #end ## ## #macro ( listProjects ) #set ($menus = $project.selectNodes("body/projects")) #foreach ( $menu in $menus ) ##foreach ( $tw in $menu.selectNodes("//*") ) ##relativise ($tw) ##end #set ($title = $menu.getChild("title")) #if ($title.getAttributeValue("href")) #else #end #end #end ## ## #macro ( getProjectImage ) #if ($project.getChild("logo")) The Apache Software Foundation #set ( $logoString = $project.getChild("logo").getAttributeValue("href") ) #if ( $logoString.startsWith("/") ) $project.getChild( #else $project.getChild( #end #else The Apache Software Foundation ## ##

Mirrored
## Worldwide

## #end #end ## ## #macro ( document ) #set ($base = $root.getChild("properties").getChild("base")) #if ( $base ) $base #end #set ($refresh = $root.getChild("properties").getChild("refresh").getText()) #if ( $refresh ) #end #set ($is_dynpage = 0) #if ($root.getAttributeValue("id") == "closer") #set ($is_dynpage = 1) #end #if ($is_dynpage == 1) #else #end #set ($atoms = $root.getChild("properties").getChildren("atom")) #foreach ( $atom in $atoms ) #metaatom ( $atom.getText() $atom.getAttributeValue("url") ) #end #set ($authors = $root.getChild("properties").getChildren("author")) #foreach ( $au in $authors ) #metaauthor ( $au.getText() $au.getAttributeValue("email") ) #end $root.getChild("properties").getChild("title").getText() - $project.getChild("title").getText() #set ($scripts = $root.getChild("properties").getChildren("script")) #if ( $scripts ) $scripts #end #set ($isHomePage = 0) #set ($headerSection = $root.getChild("body").getChild("header_section")) #if ( $headerSection ) #set ($isHomePage = 1) #end #if ($isHomePage == 1) #else #end


#if ($isHomePage == 1)

#set ($allSections = $root.getChild("body").getChildren("section")) #if ($allSections.get(0).getChild('title').getText()) $allSections.get(0).getChild('title').getText() #end

#set ($allSections = $root.getChild("body").getChildren("section")) #foreach ( $section in $allSections ) #set ($level = 1) #if ( $section.getChild('title').getText() == $allSections.get(0).getChild('title').getText()) #set ($level = 0) #end #section ($section $level) #end
#end