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> <dependency>
<groupId>plexus</groupId> <groupId>plexus</groupId>
<artifactId>plexus-site-renderer</artifactId> <artifactId>plexus-site-renderer</artifactId>
<version>1.0-alpha-1</version> <version>1.0-alpha-2-20050715.080727-2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven.wagon</groupId> <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(); List indexFound = new ArrayList();
for ( int i = 0; i < directories.length; i++ ) for ( int i = 0; i < directories.length; i++ )
{ {

View File

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

View File

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

View File

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