You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by vm...@apache.org on 2004/05/02 12:16:08 UTC

cvs commit: maven-plugins/xdoc/src/plugin-resources/templates downloads.jelly downloads.xml

vmassol     2004/05/02 03:16:08

  Modified:    xdoc/xdocs changes.xml properties.xml
               xdoc     plugin.properties plugin.jelly
               xdoc/src/plugin-resources navigation.jelly
  Added:       xdoc/src/plugin-resources/templates downloads.jelly
  Removed:     xdoc/src/plugin-resources/templates downloads.xml
  Log:
  - Added new download report along with a new link in the Maven generated documentation. This new link will only appear if you have defined the new <code>maven.xdoc.distributionUrl</code> property. There is also a new <code>maven.xdoc.distributionType</code> property that indicates what type of artifact your project is delivering. It defaults to "jar".
  - The xdoc plugin now supports generating custom reports using Jelly. It was previously only supporting Velocity. Simply name your report templates with a ".jelly" extension.
  
  Revision  Changes    Path
  1.44      +13 -0     maven-plugins/xdoc/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/xdoc/xdocs/changes.xml,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- changes.xml	30 Apr 2004 14:38:44 -0000	1.43
  +++ changes.xml	2 May 2004 10:16:08 -0000	1.44
  @@ -22,9 +22,22 @@
     <properties>
       <title>Changes</title>
       <author email="dion@multitask.com.au">dIon Gillard</author>
  +    <author email="vmassol@apache.org">Vincent Massol</author>
     </properties>
     <body>
       <release version="1.7-SNAPSHOT" date="in CVS">
  +      <action dev="vmassol" type="add">
  +        Added new download report along with a new link in the Maven
  +        generated documentation. This new link will only appear if you have
  +        defined the new <code>maven.xdoc.distributionUrl</code> property.
  +        There is also a new <code>maven.xdoc.distributionType</code> property
  +        that indicates what type of artifact your project is delivering. It
  +        defaults to "jar".
  +      <action dev="vmassol" type="add">
  +        The xdoc plugin now supports generating custom reports using Jelly. 
  +        It was previously only supporting Velocity. Simply name your report
  +        templates with a ".jelly" extension.
  +      </action>
         <action dev="brett" type="fix" issue="MPXDOC-98" due-to="fabrizio giustina">Allow reports to be generated even if they aren't linked from the "project reports" section by giving an empty link attribute to the register report tag.</action>
         <action dev="brett" type="fix" issue="MPXDOC-90" due-to="Corey Tripp">Only show "CVS Access Behind a Firewall" section if using CVS.</action>
         <action dev="brett" type="fix" issue="MPXDOC-96" due-to="fabrizio giustina">wrong lists generated for not expandable menu items. Some changes in patch were already put in place by brett.</action>
  
  
  
  1.12      +23 -0     maven-plugins/xdoc/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/xdoc/xdocs/properties.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- properties.xml	4 Mar 2004 18:39:50 -0000	1.11
  +++ properties.xml	2 May 2004 10:16:08 -0000	1.12
  @@ -22,6 +22,7 @@
     <properties>
       <title>Xdoc Properties</title>
       <author email="smor@apache.org">St�phane MOR</author>
  +    <author email="vmassol@apache.org">Vincent Massol</author>
     </properties>
   
     <body>
  @@ -496,6 +497,28 @@
             <td>
               The JSL stylesheet used to convert xdocs to HTML. To override, specify as a
               <code>file:</code> URL.
  +          </td>
  +        </tr>
  +        <tr>
  +          <td>maven.xdoc.distributionUrl</td>
  +          <td>Yes</td>
  +          <td>
  +            Location where the artifacts are distributed. This property is 
  +            optional. If it is not defined, then the Download report will 
  +            not be added to the navigation menu. NOTE: In the future this 
  +            information will be described in the POM. Usage example:
  +            <code>maven.xdoc.distributionUrl=http://www.ibiblio.org/maven/maven/plugins</code>.
  +          </td>
  +        </tr>
  +        <tr>
  +          <td>maven.xdoc.distributionType</td>
  +          <td>Yes</td>
  +          <td>
  +            Type of the distributed artifact. Override this property if
  +            your project is distributing artifacts of a type different
  +            that the default. NOTE: In the future 
  +            this information will be described in the POM.
  +            Default value: <code>maven.xdoc.distributionType=jar</code>
             </td>
           </tr>
         </table>
  
  
  
  1.18      +22 -7     maven-plugins/xdoc/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  RCS file: /home/cvs/maven-plugins/xdoc/plugin.properties,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- plugin.properties	4 Mar 2004 18:39:49 -0000	1.17
  +++ plugin.properties	2 May 2004 10:16:08 -0000	1.18
  @@ -26,12 +26,26 @@
   maven.xdoc.crumb.separator=|
   maven.xdoc.theme.url=
   
  +# Location where the artifacts are distributed. This property is optional. 
  +# If it is not defined, then the Download report will not be added to the 
  +# navigation menu.
  +# NOTE: In the future this information will be described in the POM
  +# Ex: maven.xdoc.distributionUrl=http://www.ibiblio.org/maven/maven/plugins
  +
  +# Type of the distributed artifact. Defaults to jar. Override this property if
  +# your project is distributing artifacts of a different type.
  +# NOTE: In the future this information will be described in the POM
  +maven.xdoc.distributionType=jar
  +
   #
   # DATE Preferences
   #
  +
   # The place of the date on the pages : choices are 'bottom', 'left', 'right', 'navigation-top', 'navigation-bottom'
   maven.xdoc.date = 
  +
   maven.xdoc.date.format = dd MMMM yyyy
  +
   # The date locale
   maven.xdoc.date.locale = en
   
  @@ -97,12 +111,13 @@
                             issue-tracking.xml,\
                             mail-lists.xml,\
                             project-info.xml,\
  -                          team-list.xml
  +                          team-list.xml,\
  +                          downloads.jelly
                             
   maven.xdoc.projectInfo = cvs-usage.xml,\
  -                          dependencies.xml,\
  -                          issue-tracking.xml,\
  -                          mail-lists.xml,\
  -                          project-info.xml,\
  -                          team-list.xml
  -
  +                         dependencies.xml,\
  +                         issue-tracking.xml,\
  +                         mail-lists.xml,\
  +                         project-info.xml,\
  +                         team-list.xml,\
  +                         downloads.jelly
  
  
  
  1.58      +30 -11    maven-plugins/xdoc/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/xdoc/plugin.jelly,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- plugin.jelly	21 Apr 2004 01:05:47 -0000	1.57
  +++ plugin.jelly	2 May 2004 10:16:08 -0000	1.58
  @@ -97,7 +97,7 @@
         <!--
          | Basic tag for performing arbitrary jsl transformations
          | on arbitrary jsl inputs.
  -       | @input
  +       | @input (optional)
          | @output
          | @stylesheet
          | @encoding
  @@ -111,9 +111,11 @@
           <j:set var="encoding" 
                  value="${plugin.getVariable('maven.docs.outputencoding')}"/>
         </j:if>
  -      
  -      <util:file name="${input}" var="inputFile" />
  -      <x:parse var="doc" xml="${inputFile}"/>
  +
  +      <j:if test="${input != null}">    
  +        <util:file name="${input}" var="inputFile" />
  +        <x:parse var="doc" xml="${inputFile}"/>
  +      </j:if>
         
         <j:set var="stylesheetURI" value="file:${stylesheet}"/>
         <j:file
  @@ -458,14 +460,31 @@
       </j:if>
       
       <j:forEach var="pomDocument" items="${pomDocuments}">
  -      <velocity:merge 
  -        name="${maven.gen.docs}/${pomDocument}"
  -        basedir="${plugin.resources}/templates"
  -        template="${pomDocument}"
  -        inputEncoding="${encoding}"
  -        outputEncoding="${encoding}" 
  -      />
   
  +      <!-- If the template ends with ".xml" use velocity to generate the 
  +           HTML. If it ends with ".jelly" use JSL. -->
  +      <j:choose>
  +        <j:when test="${pomDocument.endsWith('.xml')}">
  +          <velocity:merge 
  +            name="${maven.gen.docs}/${pomDocument}"
  +            basedir="${plugin.resources}/templates"
  +            template="${pomDocument}"
  +            inputEncoding="${encoding}"
  +            outputEncoding="${encoding}" 
  +          />
  +        </j:when>
  +        <j:when test="${pomDocument.endsWith('.jelly')}">
  +          <doc:jslFile
  +            output="${maven.gen.docs}/${pomDocument.substring(0,pomDocument.indexOf('.jelly'))}.xml"
  +            stylesheet="${plugin.resources}/templates/${pomDocument}"
  +            outputMode="xml"
  +            prettyPrint="true"/>
  +        </j:when>
  +        <j:otherwise>
  +          <fail>Unknown report format for report [${pomDocument}].</fail>
  +        </j:otherwise>
  +      </j:choose>
  +      
       </j:forEach>
   
     </goal>
  
  
  
  1.8       +7 -1      maven-plugins/xdoc/src/plugin-resources/navigation.jelly
  
  Index: navigation.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/xdoc/src/plugin-resources/navigation.jelly,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- navigation.jelly	28 Apr 2004 03:37:29 -0000	1.7
  +++ navigation.jelly	2 May 2004 10:16:08 -0000	1.8
  @@ -28,7 +28,13 @@
           <j:if test="${includeProjectDocumentation.equals('yes')}">
             <menu name="Project Documentation">
               <item name="About ${pom.name}" href="/index.html"/>   
  -            
  +
  +            <!-- Only display a "Downloads" menu link if the 
  +                 maven.xdoc.distributionUrl has been defined -->
  +            <j:if test="${context.getVariable('maven.xdoc.distributionUrl') != null}">
  +              <item name="Downloads" href="/downloads.html"/>
  +            </j:if>
  +                        
               <item name="Project Info" href="/project-info.html" collapse="true">
                 <item name="Mailing Lists" href="/mail-lists.html"/>
                 <item name="Project Team" href="/team-list.html"/>
  
  
  
  1.1                  maven-plugins/xdoc/src/plugin-resources/templates/downloads.jelly
  
  Index: downloads.jelly
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <!--
   * ========================================================================
   * 
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed 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.
   * 
   * ========================================================================
  -->
  
  <project
    xmlns:j="jelly:core"
    xmlns:maven="jelly:maven"
    xmlns:util="jelly:util"
    xmlns:x="jelly:xml">
  
    <document>
    
      <properties>
        <title>Downloads</title>
      </properties>
  
      <body>
        <section name="Downloads">
  
          <!-- Do not generate the report if the maven.xdoc.distributionUrl 
               property is not defined -->
          <j:choose>
  
            <j:when test="${context.getVariable('maven.xdoc.distributionUrl') == null}">
              <p>
                You must define the <code>maven.xdoc.distributionUrl</code> 
                property if you wish to generate the download report.
              </p>
            </j:when>
    
            <j:otherwise>
  
              <j:choose>
                <j:when test="${size(pom.versions) == 0}">
                  <p>
                    This project has not released any version yet.
                  </p>
                </j:when>
                <j:otherwise>
                  <!-- Find list of versions by looking up the <version> element 
                       in the POM -->
                  <p>
                    List of available downloads.
                  </p>
                  <table>
                    <tr>
                      <th>Download links</th>
                    </tr>
                    <j:forEach var="version" items="${pom.versions}">
                      <!-- Exclude the version being worked on (i.e. the one 
                           that has a HEAD tag -->
                      <j:if test="${!version.tag.equals('HEAD')}">
                        <tr>
                          <td>
                            <a href="${maven.xdoc.distributionUrl}/${pom.artifactId}-${version}.${maven.xdoc.distributionType}">${pom.name} v${version}</a>
                          </td>
                        </tr>
                      </j:if>
                    </j:forEach>
                  </table>
                </j:otherwise>
              </j:choose>
  
            </j:otherwise>
          </j:choose>
  
        </section>
      </body>
  
    </document>
  </project>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org