db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r548783 - in /db/derby/code/branches/10.3/java/build/org/apache/derbyBuild: ReleaseNoteReader.java ReleaseNotesGenerator.java
Date Tue, 19 Jun 2007 16:17:06 GMT
Author: rhillegas
Date: Tue Jun 19 09:17:05 2007
New Revision: 548783

URL: http://svn.apache.org/viewvc?view=rev&rev=548783
Log:
DERBY-2570: Merge revision 548781 from trunk to 10.3 branch.

Modified:
    db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNoteReader.java
    db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java

Modified: db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNoteReader.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNoteReader.java?view=diff&rev=548783&r1=548782&r2=548783
==============================================================================
--- db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNoteReader.java (original)
+++ db/derby/code/branches/10.3/java/build/org/apache/derbyBuild/ReleaseNoteReader.java Tue
Jun 19 09:17:05 2007
@@ -105,7 +105,7 @@
 
         // here are the checks we perform
         Document                        doc = me.getReleaseNote( fis );
-        String                              summary = me.getReleaseNoteSummary( doc );
+        Element                           summary = me.getReleaseNoteSummary( doc );
         Element                         details = me.getReleaseNoteDetails( doc );
 
         // if you get this far, then everything worked
@@ -136,10 +136,10 @@
 
     /**
      * <p>
-     * Get the summary for a release note
+     * Get the summary paragraph for a release note
      * </p>
      */
-    public String   getReleaseNoteSummary( Document releaseNote )
+    public Element   getReleaseNoteSummary( Document releaseNote )
         throws Exception
     {
         //
@@ -152,9 +152,8 @@
         //
         Element     root = releaseNote.getDocumentElement();
         Element     summaryParagraph = getFirstChild( root, PARAGRAPH );
-        String          summaryText = squeezeText( summaryParagraph );
 
-        return summaryText;
+        return summaryParagraph;
     }
  
     /**

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=548783&r1=548782&r2=548783
==============================================================================
--- 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
Tue Jun 19 09:17:05 2007
@@ -477,11 +477,11 @@
         
         Element     toc = createList( body );
 
-        createSection( body, MAIN_SECTION_LEVEL, toc, OVERVIEW_SECTION, null );
-        createSection( body, MAIN_SECTION_LEVEL, toc, NEW_FEATURES_SECTION, null );
-        createSection( body, MAIN_SECTION_LEVEL, toc, BUG_FIXES_SECTION, null );
-        createSection( body, MAIN_SECTION_LEVEL, toc, ISSUES_SECTION, null );
-        createSection( body, MAIN_SECTION_LEVEL, toc, BUILD_ENVIRONMENT_SECTION, null );
+        createSection( body, MAIN_SECTION_LEVEL, toc, OVERVIEW_SECTION, OVERVIEW_SECTION
);
+        createSection( body, MAIN_SECTION_LEVEL, toc, NEW_FEATURES_SECTION, NEW_FEATURES_SECTION
);
+        createSection( body, MAIN_SECTION_LEVEL, toc, BUG_FIXES_SECTION, BUG_FIXES_SECTION
);
+        createSection( body, MAIN_SECTION_LEVEL, toc, ISSUES_SECTION, ISSUES_SECTION );
+        createSection( body, MAIN_SECTION_LEVEL, toc, BUILD_ENVIRONMENT_SECTION, BUILD_ENVIRONMENT_SECTION
);
     }
     
     /**
@@ -662,22 +662,25 @@
             }
             
             String          key = "Note for " + issue.getKey();
-            String          summary = null;
+            Node     summaryText = null;
 
             try {
-                summary = releaseNoteReader.getReleaseNoteSummary( releaseNote );
+                summaryText = releaseNoteReader.getReleaseNoteSummary( releaseNote );
             }
             catch (Throwable t)
             {
                 gs.addError( formatError( "Badly formatted summary for " + issue.getKey(),
t ) );
-                summary = "Unreadable summary line";
+                summaryText = pamphlet.createTextNode( "Unreadable summary line" );
             }
             
-            String          tocEntry = key + ": " + summary;
+            Element         paragraph = pamphlet.createElement( PARAGRAPH );
+
+            paragraph.appendChild(  pamphlet.createTextNode( key + ": ") );
+            cloneChildren( summaryText, paragraph );
 
             insertLine( issuesSection );
             
-            Element     issueSection = createSection( issuesSection, ISSUE_DETAIL_LEVEL,
toc, key, tocEntry );
+            Element     issueSection = createSection( issuesSection, ISSUE_DETAIL_LEVEL,
toc, key, paragraph );
 
             try {
                 Element     details = releaseNoteReader.getReleaseNoteDetails( releaseNote
);
@@ -947,7 +950,22 @@
         throws Exception
     {
         Document        doc = parent.getOwnerDocument();
-        Element             link = createLocalLink( doc, sectionName, tocEntry );
+        Text                textNode = doc.createTextNode( tocEntry );
+
+        return createSection( parent, sectionLevel, toc, sectionName, textNode );
+    }
+    
+    /**
+     * <p>
+     * Create a section at the end of a parent element and link to it from a
+     * table of contents.
+     * </p>
+     */
+    private Element createSection( Element parent, int sectionLevel, Element toc, String
sectionName, Node visibleText )
+        throws Exception
+    {
+        Document        doc = parent.getOwnerDocument();
+        Element             link = createLocalLink( doc, sectionName, visibleText );
 
         addListItem( toc, link );
 
@@ -1002,9 +1020,20 @@
     private Element createLocalLink( Document doc, String anchor, String text )
         throws Exception
     {
-        if ( text == null ) { text = anchor; }
-        
-        return createLink( doc, "#" + anchor, text );
+        Text        textNode = doc.createTextNode( text );
+
+        return createLocalLink( doc, anchor, textNode );
+    }
+    
+    /**
+     * <p>
+     * Create a standard link to a local label.
+     * </p>
+     */
+    private Element createLocalLink( Document doc, String anchor, Node visibleText )
+        throws Exception
+    {
+        return createLink( doc, "#" + anchor, visibleText );
     }
     
     /**
@@ -1015,11 +1044,23 @@
     private Element createLink( Document doc, String label, String text )
         throws Exception
     {
-        Element hotlink = doc.createElement( ANCHOR );
         Text        textNode = doc.createTextNode( text );
 
+        return createLink( doc, label, textNode );
+    }
+    
+    /**
+     * <p>
+     * Create a hotlink.
+     * </p>
+     */
+    private Element createLink( Document doc, String label, Node visibleText )
+        throws Exception
+    {
+        Element hotlink = doc.createElement( ANCHOR );
+
         hotlink.setAttribute( "href", label );
-        hotlink.appendChild( textNode );
+        hotlink.appendChild( visibleText );
 
         return hotlink;
     }
@@ -1267,7 +1308,7 @@
      * of a target node.
      * </p>
      */
-    private void cloneChildren( Element source, Element target )
+    private void cloneChildren( Node source, Node target )
         throws Exception
     {
         Document    targetDoc = target.getOwnerDocument();



Mime
View raw message