#* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *# #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 $alt #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 ) #end #end
  • #end #macro ( mainMenu ) #set ( $menus = $siteDescriptor.getChild( "body" ).getChildren( "menu" ) ) #foreach( $menu in $menus )
    $menu.getAttribute( "name" )
    #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 $title #foreach( $author in $authors ) #end
    $bodyContent