db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1090326 - in /db/derby/code/branches/10.8/java/build/org/apache/derbyBuild: GeneratorBase.java ReleaseNoteReader.java ReleaseNotesGenerator.java
Date Fri, 08 Apr 2011 16:25:13 GMT
Author: rhillegas
Date: Fri Apr  8 16:25:13 2011
New Revision: 1090326

URL: http://svn.apache.org/viewvc?rev=1090326&view=rev
Log:
DERBY-5181: Port revision 1090322 to the 10.8 branch.

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

Modified: db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/GeneratorBase.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/GeneratorBase.java?rev=1090326&r1=1090325&r2=1090326&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/GeneratorBase.java (original)
+++ db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/GeneratorBase.java Fri Apr
 8 16:25:13 2011
@@ -56,7 +56,7 @@ public class GeneratorBase extends Task 
     private static final String COLUMN = "td";
     private static final String HORIZONTAL_LINE = "hr";
     protected static final String HTML = "html";
-    private static final String INDENT = "blockquote";
+    private static final String DIVISION = "div";
     private static final String LIST = "ul";
     private static final String LIST_ELEMENT = "li";
     private static final String NAME = "name";
@@ -286,7 +286,7 @@ public class GeneratorBase extends Task 
         Text textNode = doc.createTextNode(text);
         Element header = doc.createElement(makeHeaderTag(headerLevel));
         Element anchor = doc.createElement(ANCHOR);
-        Element block = doc.createElement(INDENT);
+        Element block = doc.createElement(DIVISION);
 
         parent.appendChild(header);
         anchor.setAttribute(NAME, text);

Modified: db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/ReleaseNoteReader.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/ReleaseNoteReader.java?rev=1090326&r1=1090325&r2=1090326&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/ReleaseNoteReader.java (original)
+++ db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/ReleaseNoteReader.java Fri
Apr  8 16:25:13 2011
@@ -101,6 +101,8 @@ public class ReleaseNoteReader
         Element                           summary = me.getReleaseNoteSummary( doc );
         Element                         details = me.getReleaseNoteDetails( doc );
 
+        me.forbidBlockQuotes( doc );
+
         // if you get this far, then everything worked
 
         println( "\n" + fileName + " passes the currently known checks performed by the release
note generator.\n" );
@@ -163,6 +165,28 @@ public class ReleaseNoteReader
         return details;
     }
 
+    /**
+     * <p>
+     * Forbid BLOCKQUOTEs for accessibility reasons. See http://www.w3.org/TR/WCAG10/#gl-structure-presentation
+     * </p>
+     */
+    private void    forbidBlockQuotes( Document releaseNote )   throws Exception
+    {
+        Element     root = releaseNote.getDocumentElement();
+        String          errorMessage = "For accessibility reasons, blockquotes are not allowed.
Please remove the blockquote tags.";
+
+        forbid( root, "BLOCKQUOTE", errorMessage );
+        forbid( root, "blockquote", errorMessage );
+    }
+    private void    forbid( Element root, String tag, String errorMessage ) throws Exception
+    {
+        NodeList    tags = root.getElementsByTagName( tag );
+
+        if ( (tags != null) && (tags.getLength() > 0) )
+        {
+            throw new Exception( errorMessage );
+        }
+    }
 
     ////////////////////////////////////////////////////////
     //

Modified: db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java?rev=1090326&r1=1090325&r2=1090326&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java
(original)
+++ db/derby/code/branches/10.8/java/build/org/apache/derbyBuild/ReleaseNotesGenerator.java
Fri Apr  8 16:25:13 2011
@@ -219,6 +219,12 @@ public class ReleaseNotesGenerator exten
         Element title = createTextElement(outputDoc, "title", titleText);
         Element body = outputDoc.createElement(BODY);
 
+        //
+        // Set language attribute for accessibility reasons.
+        // See http://www.w3.org/TR/WCAG10/#gl-abbreviated-and-foreign
+        //
+        html.setAttribute( "lang", "en" );
+
         outputDoc.appendChild(html);
         html.appendChild(title);
         html.appendChild(body);



Mime
View raw message