vmassol     2004/11/11 05:46:58

  Modified:    changes  plugin.properties
               changes/xdocs properties.xml changes.xml
               changes/src/plugin-resources changes.jsl
  Log:
  MPCHANGES-14: Added sorting of <code>&lt;action&gt;</code> elements. It is 
controlled by 2 properties. The <code>maven.changes.sort</code> property 
decides whether sorting is enabled or not and the 
<code>maven.changes.sort.order</code> one decides the sort order.  Defaults to 
<code>add,fix,update,remove</code>.
  
  Revision  Changes    Path
  1.8       +6 -0      maven-plugins/changes/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  RCS file: /home/cvs/maven-plugins/changes/plugin.properties,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- plugin.properties 10 Jul 2004 16:32:50 -0000      1.7
  +++ plugin.properties 11 Nov 2004 13:46:58 -0000      1.8
  @@ -35,3 +35,9 @@
   
   # For Sourceforge, use the "aid" parameter. For example:
   # maven.changes.issue.template = 
http://sourceforge.net/support/tracker.php?aid=%ISSUE%
  +
  +# Decide whether to sort the change actions by type or not
  +maven.changes.sort = false
  +
  +# Decide the sort order for action types
  +maven.changes.sort.order = add,fix,update,remove
  
  
  
  1.6       +22 -0     maven-plugins/changes/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/changes/xdocs/properties.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- properties.xml    13 Jun 2004 16:16:48 -0000      1.5
  +++ properties.xml    11 Nov 2004 13:46:58 -0000      1.6
  @@ -45,6 +45,28 @@
               BugZilla: <code>%URL%/show_bug.cgi?id=%ISSUE%</code>
             </td>
           </tr>
  +        <tr>
  +          <td>maven.changes.sort</td>
  +          <td>Yes</td>
  +          <td>
  +            Decides whether to enable sorting the <code>&lt;action&gt;</code>
  +            elements or not.
  +          </td>
  +          <td>
  +            false
  +          </td>
  +        </tr>
  +        <tr>
  +          <td>maven.changes.sort.order</td>
  +          <td>Yes</td>
  +          <td>
  +            Decides sort ordering of <code>&lt;action&gt;</code> elements. 
  +            It is only used if sorting is enabled.
  +          </td>
  +          <td>
  +            add,fix,update,remove
  +          </td>
  +        </tr>
         </table>
       </section>
     </body>
  
  
  
  1.33      +7 -0      maven-plugins/changes/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/changes/xdocs/changes.xml,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- changes.xml       11 Nov 2004 11:53:54 -0000      1.32
  +++ changes.xml       11 Nov 2004 13:46:58 -0000      1.33
  @@ -25,6 +25,13 @@
     </properties>
     <body>
       <release version="1.6-SNAPSHOT" date="in CVS">
  +      <action dev="vmassol" type="fix" issue="MPCHANGES-14">
  +        Added sorting of <code>&lt;action&gt;</code> elements. It is 
controlled
  +        by 2 properties. The <code>maven.changes.sort</code> property decides
  +        whether sorting is enabled or not and the 
  +        <code>maven.changes.sort.order</code> one decides the sort order. 
  +        Defaults to <code>add,fix,update,remove</code>.
  +      </action>
       </release>
       <release version="1.5.1" date="2004-10-23">
         <action dev="vmassol" type="fix" issue="MPCHANGES-20">Fixed typo in 
changes.xml example on plugin web site.</action>
  
  
  
  1.14      +39 -2     maven-plugins/changes/src/plugin-resources/changes.jsl
  
  Index: changes.jsl
  ===================================================================
  RCS file: /home/cvs/maven-plugins/changes/src/plugin-resources/changes.jsl,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- changes.jsl       29 Jun 2004 20:39:56 -0000      1.13
  +++ changes.jsl       11 Nov 2004 13:46:58 -0000      1.14
  @@ -26,6 +26,8 @@
       xmlns:jsl="jelly:jsl"
       xmlns:x="jelly:xml"
       xmlns:doc="doc"
  +    xmlns:u="jelly:util"
  +    xmlns:ant="jelly:ant"
       xmlns="dummy" trim="false">
       
       <jsl:template match="document">
  @@ -66,8 +68,43 @@
           <j:set var="anchorName"><doc:escapeNameToken 
value="${version}"/></j:set>
           <a name="${anchorName}"/>
           <table>
  -          <tr><th style='width:50px'>Type</th><th>Changes</th><th 
style='width:70px'>By</th></tr>             
  -          <jsl:applyTemplates select="*"/>
  +          <tr><th style='width:50px'>Type</th><th>Changes</th><th 
style='width:70px'>By</th></tr>
  +          <j:choose>
  +            <j:when test="${maven.changes.sort}">
  +              <u:tokenize var="actionTypes" delim=", 
">${maven.changes.sort.order}</u:tokenize>
  +
  +              <!-- FIXME: Big hack here. Jelly looses the reference to the 
  +                   current node so we have to explicitely remember it for 
  +                   Jelly! -->
  +              <x:set var="current" select="."/>
  +
  +              <j:forEach var="actionType" items="${actionTypes}">
  +                <!-- FIXME: Find a way to pass the actionType value directly 
in the select
  +                     clause. This would remove the need for this ugly choose 
tag -->
  +                <j:choose>
  +                  <j:when test="${actionType.equals('add')}">
  +                    <jsl:applyTemplates select="$current/[EMAIL 
PROTECTED]'add']"/>
  +                  </j:when>
  +                  <j:when test="${actionType.equals('fix')}">
  +                    <jsl:applyTemplates select="$current/[EMAIL 
PROTECTED]'fix']"/>
  +                  </j:when>
  +                  <j:when test="${actionType.equals('update')}">
  +                    <jsl:applyTemplates select="$current/[EMAIL 
PROTECTED]'update']"/>
  +                  </j:when>
  +                  <j:when test="${actionType.equals('remove')}">
  +                    <jsl:applyTemplates select="$current/[EMAIL 
PROTECTED]'remove']"/>
  +                  </j:when>
  +                  <j:otherwise>
  +                    <ant:fail>Invalid type '${actionType}'</ant:fail>
  +                  </j:otherwise>
  +                </j:choose>
  +              </j:forEach>
  +
  +            </j:when>
  +            <j:otherwise>
  +              <jsl:applyTemplates select="*"/>            
  +            </j:otherwise>
  +          </j:choose>
           </table>
         </section>
       </jsl:template>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to