kaz         02/04/27 08:45:20

  Modified:    src/dvsl/xdocs site.dvsl
               src/java/org/apache/maven MavenTool.java
               src/test/org/apache/maven MavenToolTest.java
  Log:
  Previously, the DVSL templates would gain access to the POM via a DVSL
  statement such as:
  
      $node.selectSingleNode("document('project.xml')/project")
  
  This would use DVSL/dom4j to traverse the POM.  This has been replaced
  because the POM may not always be supplied via an XML file.  In the
  future it may come from a database, etc ...
  
  Thus, the POM is now inserted into the DVSL templates via the toolbox
  using the MavenTool.
  
  Revision  Changes    Path
  1.32      +18 -19    jakarta-turbine-maven/src/dvsl/xdocs/site.dvsl
  
  Index: site.dvsl
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/dvsl/xdocs/site.dvsl,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- site.dvsl 27 Apr 2002 14:44:46 -0000      1.31
  +++ site.dvsl 27 Apr 2002 15:45:20 -0000      1.32
  @@ -16,7 +16,6 @@
     <!DOCTYPE html PUBLIC "-//CollabNet//DTD XHTML 1.0 Transitional//EN"
         "http://www.collabnet.com/dtds/collabnet_transitional_10.dtd";>
   
  -  #set( $projectDescriptorFilename = "project.xml")
     #set( $projectFilename = "$context.toolbox.docSrc/project.xml")
     #set( $anakiaProjectFilename = "$context.toolbox.docSrc/stylesheets/project.xml")
     
  @@ -25,10 +24,10 @@
     #set( $filename = $context.getAppValue("infilename"))
     #set( $relativePath = $context.toolbox.pathtool.getRelativePath($filename))
   
  -  ## Grab a reference to the project descriptor here so we can pull
  -  ## info from it such as the cvs web url, etc ...
  +  ## Grab a reference to the POM so we can pull info from it such as the
  +  ## cvs web url, etc ...
   
  -  #set( $projectDescriptor = 
$node.selectSingleNode("document('$projectDescriptorFilename')/project"))
  +  #set( $pom = $context.toolbox.maven.project )
   
     ## Check to see if an xdocs/projects.xml file exists, if so, use that
     ## as the navigation file; otherwise, check to see if someone is using
  @@ -80,8 +79,8 @@
                   #set( $alt = $project.organizationLogo )
                   #set( $src = $project.organizationLogo.attribute("href") )
   
  -                #if ( $projectDescriptor.organization.url )
  -                  #set( $home = $projectDescriptor.organization.url )
  +                #if ( $pom.organization.url )
  +                  #set( $home = $pom.organization.url )
                   #else
                     ## Fall back to the project url
                     #set( $home = $project.attribute( "href" ) )
  @@ -112,7 +111,7 @@
                     #if( $project.attribute("href") )
                       #set( $home = $project.attribute("href") )
                     #else
  -                    #set( $home = $projectDescriptor.url )
  +                    #set( $home = $pom.url )
                     #end
                     #set( $src = $project.logo.attribute( "href" ) )
   
  @@ -162,11 +161,11 @@
                   #if 
($context.toolbox.fileutil.file("$context.toolbox.docSrc/tasks.xml").exists())
                   <div><small><a 
href="$relativePath/tasks.html">Tasks</a></small></div>
                   #end
  -                #if ($projectDescriptor.cvsWebUrl)
  -                <div><small><a href="$projectDescriptor.cvsWebUrl">CVS 
Repository</a></small></div>
  +                #if ($pom.cvsWebUrl)
  +                <div><small><a href="$pom.cvsWebUrl">CVS 
Repository</a></small></div>
                   #end
  -                #if ($projectDescriptor.issueTrackingUrl)
  -                <div><small><a href="$projectDescriptor.issueTrackingUrl">Issue 
Tracking</a></small></div>
  +                #if ($pom.issueTrackingUrl)
  +                <div><small><a href="$pom.issueTrackingUrl">Issue 
Tracking</a></small></div>
                   #end
                   <div><small><a href="$relativePath/changelog.html">Change 
Log</a></small></div>
                   #if ($context.toolbox.testSrcPresent == "true")
  @@ -200,15 +199,15 @@
           <table border="0" cellspacing="0" cellpadding="4">
             <tr>
               <td>
  -              #if( $projectDescriptor.organization.name )
  -                #if( $projectDescriptor.inceptionYear )
  -                    #if( $projectDescriptor.inceptionYear.toString() == 
$context.toolbox.currentYear )
  -                &copy; ${context.toolbox.currentYear}, 
$projectDescriptor.organization.name
  +              #if( $pom.organization.name )
  +                #if( $pom.inceptionYear )
  +                    #if( $pom.inceptionYear == $context.toolbox.currentYear )
  +                &copy; ${context.toolbox.currentYear}, $pom.organization.name
                       #else
  -                &copy; 
${projectDescriptor.inceptionYear}-${context.toolbox.currentYear}, 
$projectDescriptor.organization.name
  +                &copy; ${pom.inceptionYear}-${context.toolbox.currentYear}, 
$pom.organization.name
                       #end
                   #else
  -                &copy; ${context.toolbox.currentYear}, 
$projectDescriptor.organization.name
  +                &copy; ${context.toolbox.currentYear}, $pom.organization.name
                   #end
                 #else
                   &copy; 1999-2002, Apache Software Foundation
  @@ -376,9 +375,9 @@
   #end
   
   #match("file")
  -  <a href="$projectDescriptor.cvsWebUrl$node.name.value()">
  +  <a href="$pom.cvsWebUrl$node.name.value()">
       $node.name.value()</a> - 
  -  <a 
href="$projectDescriptor.cvsWebUrl$node.name.value()?rev=$node.revision.value()&amp;content-type=text/vnd.viewcvs-markup">
  +  <a 
href="$pom.cvsWebUrl$node.name.value()?rev=$node.revision.value()&amp;content-type=text/vnd.viewcvs-markup">
       v$node.revision.value()</a> <br/>
   #end
   
  
  
  
  1.4       +4 -1      jakarta-turbine-maven/src/java/org/apache/maven/MavenTool.java
  
  Index: MavenTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/MavenTool.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MavenTool.java    5 Apr 2002 03:05:00 -0000       1.3
  +++ MavenTool.java    27 Apr 2002 15:45:20 -0000      1.4
  @@ -71,11 +71,14 @@
   
       /**
        * Creates a new instance.
  +     *
  +     * @throws Exception If the Maven POM cannot be loaded.
        */
       public MavenTool()
  +        throws Exception
       {
           // FIXME: Need a path to the project descriptor.
  -        //project = MavenUtils.getProject("project.xml");
  +        project = MavenUtils.getProject("project.xml");
       }
   
       /**
  
  
  
  1.4       +4 -1      
jakarta-turbine-maven/src/test/org/apache/maven/MavenToolTest.java
  
  Index: MavenToolTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/test/org/apache/maven/MavenToolTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MavenToolTest.java        5 Apr 2002 03:47:15 -0000       1.3
  +++ MavenToolTest.java        27 Apr 2002 15:45:20 -0000      1.4
  @@ -66,7 +66,7 @@
    * Unit test for <code>MavenTool</code>.
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Rall</a>
  - * @version $Id: MavenToolTest.java,v 1.3 2002/04/05 03:47:15 kaz Exp $
  + * @version $Id: MavenToolTest.java,v 1.4 2002/04/27 15:45:20 kaz Exp $
    */
   public class MavenToolTest extends TestCase 
   {
  @@ -92,8 +92,11 @@
     
       /** 
        * Tests {@link MavenTool.resolvePathFragment(String, String, String[])}.
  +     *
  +     * @throws Exception If the POM can't be loaded.
        */
       public void testResolvePathFragment()
  +        throws Exception
       {
           MavenTool tool = new MavenTool();
   
  
  
  


Reply via email to