db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r548433 - in /db/derby/code/branches/10.3: java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java tools/release/templates/releaseSummaryTemplate.xml
Date Mon, 18 Jun 2007 18:26:39 GMT
Author: rhillegas
Date: Mon Jun 18 11:26:39 2007
New Revision: 548433

URL: http://svn.apache.org/viewvc?view=rev&rev=548433
Log:
DERBY-2570: Port 548432 from trunk to 10.3 branch.

Modified:
    db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java
    db/derby/code/branches/10.3/tools/release/templates/releaseSummaryTemplate.xml

Modified: db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java?view=diff&rev=548433&r1=548432&r2=548433
==============================================================================
--- db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java
(original)
+++ db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java
Mon Jun 18 11:26:39 2007
@@ -381,6 +381,7 @@
             buildBugList( gs );
             buildIssuesList( gs );
             buildEnvironment( gs );
+            replaceVariables( gs );
             endPamphlet( gs );
             
             printPamphlet( gs );
@@ -774,6 +775,26 @@
         addHeadlinedItem( list, JSR169_HEADLINE, jsr169Text );
     }
     
+    //////////////////////////////////
+    //
+    //  REPLACE VARIABLES
+    //
+    //////////////////////////////////
+
+    /**
+     * <p>
+     * Replace the known parameters with their corresponding text values.
+     * </p>
+     */
+    private void replaceVariables( GeneratorState gs )
+        throws Exception
+    {
+        Document    pamphlet = gs.getPamphlet();
+
+        replaceTag( pamphlet, SUM_RELEASE_ID, getReleaseID( gs ) );
+        replaceTag( pamphlet, SUM_PREVIOUS_RELEASE_ID, getPreviousReleaseID( gs ) );
+    }
+    
    //////////////////////////////////
     //
     //  Print the generated document.
@@ -1259,6 +1280,43 @@
             Node    targetChild = targetDoc.importNode( sourceChild, true );
 
             target.appendChild( targetChild );
+        }
+    }
+
+    /**
+     * <p>
+     * Replace all instances of the tag with the indicated text.
+     * </p>
+     */
+    private void replaceTag( Document doc, String tag, String replacementText )
+        throws Exception
+    {
+        NodeList        sourceChildren = doc.getElementsByTagName( tag );
+        int                 count = sourceChildren.getLength();
+
+        for ( int i = 0; i < count; i++ )
+        {
+            Node    oldChild = sourceChildren.item( i );
+            Node    newChild = doc.createTextNode( replacementText );
+
+            if ( oldChild != null )
+            {
+                Node    parent = oldChild.getParentNode();
+            
+                if ( parent != null ) { parent.insertBefore( newChild, oldChild ); }
+            }
+        }
+
+        for ( int i = count-1; i > -1; i-- )
+        {
+            Node    oldChild = sourceChildren.item( i );
+
+            if ( oldChild != null )
+            {
+                Node    parent = oldChild.getParentNode();
+            
+                if ( parent != null ) { parent.removeChild( oldChild ); }
+            }
         }
     }
 

Modified: db/derby/code/branches/10.3/tools/release/templates/releaseSummaryTemplate.xml
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/tools/release/templates/releaseSummaryTemplate.xml?view=diff&rev=548433&r1=548432&r2=548433
==============================================================================
--- db/derby/code/branches/10.3/tools/release/templates/releaseSummaryTemplate.xml (original)
+++ db/derby/code/branches/10.3/tools/release/templates/releaseSummaryTemplate.xml Mon Jun
18 11:26:39 2007
@@ -88,7 +88,11 @@
 </buildInfo>
 
 <!--
-    Here include a freeform section, describing the release. E.g.:
+    Here include a freeform section, describing the release. In this
+    section, all instances of the special tags <releaseID/> and
+    <previousReleaseID/> will be replaced with the values specified above.
+
+    E.g.:
 
 <p>
 Derby is a pure Java relational database engine using standard SQL and



Mime
View raw message