#macro ( banner $id )
#if ( $siteDescriptor.getChild( $id ) )
#set ( $e = $siteDescriptor.getChild( $id ) )
#if( $e.getChild( "href" ) )
#set ( $link = $e.getChild( "href" ).getValue() )
#else
#end
#if( $e.getChild( "src" ) )
#set ( $src = $e.getChild( "src" ).getValue() )
#if ( ! ( $src.toLowerCase().startsWith("http") || $src.toLowerCase().startsWith("https") ) )
#set ( $src = $PathTool.calculateLink( $src, $relativePath ) )
#set ( $src = $src.replaceAll( "\\", "/" ) )
#end
#if ( $e.getChild( "alt" ) )
#set ( $alt = $e.getChild( "alt" ).getValue() )
#else
#set ( $alt = "" )
#end
#else
$e.getChild( "name" ).getValue()
#end
#if( $e.getChild( "href" ) )
#else
#end
#end
#end
#macro ( links )
#set ( $counter = 0 )
#set ( $links = $siteDescriptor.getChild( "body" ).getChild( "links" ) )
#foreach( $item in $links.getChildren() )
#set ( $counter = $counter + 1 )
$item.getAttribute( "name" )
#if ( $links.getChildCount() > $counter )
|
#end
#end
#end
#macro ( displayTree $display $item )
#if ( $item && $item.getChildren() && $item.getChildCount() > 0 )
#foreach( $subitem in $item.getChildren() )
#set ( $subitemHref = $PathTool.calculateLink( $subitem.getAttribute( "href" ), $relativePath ) )
#set ( $subitemHref = $subitemHref.replaceAll( "\\", "/" ) )
#if ( $currentFileName == $subitemHref )
#set ( $display = true )
#end
#displayTree( $display $subitem )
#end
#end
#end
#macro ( menuItem $item )
#set ( $collapse = "none" )
#set ( $currentItemHref = $PathTool.calculateLink( $item.getAttribute( "href" ), $relativePath ) )
#set ( $currentFileName = $currentFileName.replaceAll( "\\", "/" ) )
#set ( $currentItemHref = $currentItemHref.replaceAll( "\\", "/" ) )
#if ( $item && $item.getChildCount() > 0 )
#if ( ( $item.getAttribute( "collapse" ) ) && ( $item.getAttribute( "collapse" ).equalsIgnoreCase( "false" ) ) )
#set ( $collapse = "expanded" )
#else
## By default collapsed
#set ( $collapse = "collapsed" )
#end
#if ( $currentFileName == $currentItemHref )
#set ( $collapse = "expanded" )
#end
#end
#if ( $currentFileName == $currentItemHref )
$item.getAttribute( "name" )
#else
$item.getAttribute( "name" )
#end
#if ( $item && $item.getChildren() && $item.getChildCount() > 0 )
#set ( $display = false )
#set ( $itemTmp = $item )
#displayTree( $display $itemTmp )
#if ( $collapse == "expanded" || $display )
#foreach( $subitem in $item.getChildren() )
#menuItem( $subitem )
#end
#end
#end
#end
#macro ( mainMenu )
#set ( $menus = $siteDescriptor.getChild( "body" ).getChildren( "menu" ) )
#foreach( $menu in $menus )
$menu.getAttribute( "name" )
#foreach( $item in $menu.getChildren() )
#menuItem( $item )
#end
#end
#end
#macro ( copyright )
#if ( $project )
#set ( $currentYear = ${currentDate.year} + 1900 )
#if ( ${project.inceptionYear} && ( ${project.inceptionYear} != ${currentYear.toString()} ) )
${project.inceptionYear}-${currentYear}
#else
${currentYear}
#end
#if ( ${project.organization} && ${project.organization.name} )
${project.organization.name}
#end
#end
#end
#macro ( publishDate $position)
#if ( $siteDescriptor.getChild( "publishDate" ) )
#if ( $siteDescriptor.getChild( "publishDate" ).getAttribute( "format" ) )
#set ( $format = $siteDescriptor.getChild( "publishDate" ).getAttribute( "format" ) )
#end
#if ( $format )
$dateFormat.applyPattern( $format )
#end
##$dateFormat.applyPattern( "MM/dd/yyyy" )
##end
#set ( $dateToday = $dateFormat.format( $currentDate ) )
#set ( $datePosition = $siteDescriptor.getChild( "publishDate" ).getAttribute( "position" ) )
#if ( $datePosition.equalsIgnoreCase( $position ) )
#if ( $datePosition.equalsIgnoreCase( "right" ) || $datePosition.equalsIgnoreCase( "bottom" ) )
| $i18n.getString( "site-plugin", $locale, "template.lastpublished" ): $dateToday
#elseif ( $datePosition.equalsIgnoreCase( "navigation-bottom" ) || $datePosition.equalsIgnoreCase( "navigation-top" ) )
$i18n.getString( "site-plugin", $locale, "template.lastpublished" ): $dateToday
#elseif ( $datePosition.equalsIgnoreCase("left") )
$i18n.getString( "site-plugin", $locale, "template.lastpublished" ): $dateToday | Doc for
#if ( $siteDescriptor.getChild( "version" ))
$siteDescriptor.getChild( "version" ).getValue()
#else
${project.version}
#end
#end
#end
#end
#end
#macro ( poweredByLogo )
#if( $siteDescriptor.getChild( "powered-by" ) )
#foreach ($item in $siteDescriptor.getChild( "powered-by" ).getChildren() )
#if( $item.getAttribute( "href" ) )
#set ( $href = $item.getAttribute( "href" ) )
#else
#set ( $href="http://maven.apache.org/" )
#end
#if( $item.getAttribute( "name" ) )
#set ( $name = $item.getAttribute( "name" ) )
#else
#set ( $name = $i18n.getString( "site-plugin", $locale, "template.builtby" ) )
#set ( $name = "${name} Maven" )
#end
#if( $item.getAttribute( "img" ) )
#set ( $img = $item.getAttribute( "img" ) )
#else
#set ( $img = "maven-feather.png" )
#end
#end
#if( $siteDescriptor.getChild( "powered-by" ).getChildCount() == 0 )
#end
#else
#end
#end
$title
#foreach( $author in $authors )
#end
#if ( $siteDescriptor.getChild( "body" ).getChild( "head" ) )
#foreach( $item in $siteDescriptor.getChild( "body" ).getChild( "head" ).getChildren() )
$item
#end
#end
#set ( $banner = "bannerLeft" )
#banner( $banner )
#set ( $banner = "bannerRight" )
#banner( $banner )
#publishDate( "left" )
#links()#publishDate( "right" )
#publishDate( "navigation-top" )
#mainMenu()
#poweredByLogo()
#publishDate( "navigation-bottom" )