Upgraded to plexus-site-renderer-1.0-alpha-2 and corrected a NPE

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@219253 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vincent Siveton 2005-07-15 22:55:33 +00:00
parent 21e050e5fa
commit 5f412ebb40
5 changed files with 36 additions and 34 deletions

View File

@ -48,7 +48,7 @@
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-site-renderer</artifactId>
<version>1.0-alpha-1</version>
<version>1.0-alpha-2-20050715.080727-2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>

View File

@ -548,6 +548,11 @@ public boolean accept(File file) {
}
});
if ( ( directories == null ) || ( directories.length == 0 ) )
{
return false;
}
List indexFound = new ArrayList();
for ( int i = 0; i < directories.length; i++ )
{

View File

@ -39,27 +39,26 @@
#end
#end
#macro ( displayTree $display $item)
#if ( $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( "\\", "/" ) )
#set ( $currentFileNameLastSlash = $currentFileName.lastIndexOf( "/" ) )
#if ( $currentFileNameLastSlash != -1)
#set ( $currentFileNameTmp = $currentFileName.substring( 0, $currentFileNameLastSlash ) )
#else
#set ( $currentFileNameTmp = $currentFileName.substring( 0, $currentFileName.lengh() ) )
#end
#set ( $currentItemHrefLastSlash = $currentItemHref.lastIndexOf( "/" ) )
#if ( $currentItemHrefLastSlash != -1)
#set ( $currentItemHrefTmp = $currentItemHref.substring( 0, $currentItemHrefLastSlash ) )
#else
#set ( $currentItemHrefTmp = $currentItemHref.substring( 0, $currentItemHref.lengh() ) )
#end
#set ( $tree = $currentFileNameTmp && $currentItemHrefTmp && $currentFileNameTmp.startsWith( $currentItemHrefTmp ) )
#if ( $item.getChildCount() > 0 )
#if ( ( $item.getAttribute( "collapse" ) ) && ( $item.getAttribute( "collapse" ).equalsIgnoreCase( "false" ) ) )
@ -68,31 +67,29 @@
## By default collapsed
#set ( $collapse = "collapsed" )
#end
#if ( $currentFileName == $currentItemHref )
#set ( $collapse = "expanded" )
#end
#if ( $tree )
#if ( $currentFileName == $currentItemHref )
#set ( $collapse = "expanded" )
#end
#end
<li class="$collapse" $currentFileName $currentItemHref>
<li class="$collapse">
#if ( $currentFileName == $currentItemHref )
<strong><a href="$currentItemHref">$item.getAttribute( "name" )</a></strong>
#else
<a href="$currentItemHref">$item.getAttribute( "name" )</a>
#end
</li>
#if ( $item.getChildren() )
#if ( $item.getChildCount() > 0 )
#if ( $collapse == "expanded" || $tree )
<ul>
#foreach( $subitem in $item.getChildren() )
#menuItem( $subitem )
#end
</ul>
#end
#if ( $item.getChildren() && $item.getChildCount() > 0 )
#set ( $display = false )
#set ( $itemTmp = $item )
#displayTree($display $itemTmp)
#if ( $collapse == "expanded" || $display )
<ul>
#foreach( $subitem in $item.getChildren() )
#menuItem( $subitem )
#end
</ul>
#end
#end
#end

View File

@ -9,4 +9,4 @@
Site Plugin Index
From /theta/index.apt
From /gamma/index.apt

View File

@ -9,4 +9,4 @@
Site Plugin Index
From /theta/two/index.apt
From /gamma/two/index.apt