## ## Content Stylesheet for Site ## ## Defined variables ## ## ## Start and end the processing ## #document ## ## This is where the macros live ## ## ** resource_table macro ** ## ## ## ## OR ## ## OR ## ## ## ## ## ## Project website, downloads, board minutes (unless subproject) ## and dev mailing list are added by default. ## #macro ( resource_table $elem) #set ($proj = $elem.getAttributeValue("project")) #if($elem.getAttributeValue("subproject")) #set ($subproj = $elem.getAttributeValue("subproject")) #set ($full_slash = "${proj}/${subproj}") #set ($full_dash = "${proj}-${subproj}") #set ($pluralize_user = "") #else #set ($subproj = '') #set ($full_slash = "$proj") #set ($full_dash = "$proj") #set ($pluralize_user = "s") #end #if($elem.getChild("no_website")) #else #end #if($elem.getChild("jira")) #if ($elem.getChild("jira").getAttributeValue("key")) #set ($keys = $elem.getChild("jira").getAttributeValue("key")) #foreach ($key in $keys.split(",")) #end #else #if ($elem.getAttributeValue("subproject")) #else #end #end #end #if($elem.getChild("bugzilla")) #if ($elem.getAttributeValue("subproject")) #else #end #end #if($elem.getChild("cwiki")) #if ($elem.getChild("cwiki").getAttributeValue("key")) #set ($keys = $elem.getChild("cwiki").getAttributeValue("key")) #foreach ($key in $keys.split(",")) #end #else #end #end #if($elem.getChild("svn")) #end #if($elem.getChild("git")) #end #if (!$elem.getAttributeValue("subproject")) #if ($elem.getAttributeValue("board_report_id")) #set ($br_id = $elem.getAttributeValue("board_report_id")) #else #end #end #if($elem.getChild("no_downloads")) #else #end
Read-only Resource Link(s)
Websiten/a${proj}.apache.org/${subproj}
Mailing List Archives #if($elem.getChild("no_lists")) n/a #elseif($elem.getAttributeValue("replace_dev")) #set ($replacedev = $elem.getAttributeValue("replace_dev")) ${replacedev} #else dev #end #set ($mail_links = $elem.getChildren("mail")) #foreach ( $mail_link in $mail_links ) #set ($mail_name = $mail_link.getAttributeValue('name')) #foreach ($name in $mail_name.split(",")) | ${name} #end #end
Issue Tracker (JIRA) ${key.toUpperCase()}
Issue Tracker (JIRA)${subproj.toUpperCase()}${proj.toUpperCase()}
Issue Tracker (Bugzilla)${subproj}${proj}
Wiki cwiki.apache.org: ${key}
Wiki cwiki.apache.org: ${proj}
Source Code (Subversion) svn.apache.org/repos/asf/${proj}/${subproj}
Source Code (Git) https://gitbox.apache.org/repos/asf#${proj}
Board ReportsMinutesMinutes
Downloadsn/aarchive.apache.org/dist/${full_slash}/ #if($elem.getAttributeValue("hide_keys")) #else | KEYS #end
#end ## ## #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("resource_table")) #resource_table($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


#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