You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ev...@apache.org on 2005/09/26 18:41:56 UTC

svn commit: r291668 - /maven/components/trunk/maven-reporting/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java

Author: evenisse
Date: Mon Sep 26 09:41:53 2005
New Revision: 291668

URL: http://svn.apache.org/viewcvs?rev=291668&view=rev
Log:
PR: MNG-706
Submitted by: Siveton Vincent
Reviewed by:  Emmanuel Venisse
Comment: Correct the API to handle correctly the javadoc as HTML; Updated getValidHref() to handle relative path.

Modified:
    maven/components/trunk/maven-reporting/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java

Modified: maven/components/trunk/maven-reporting/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-reporting/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java?rev=291668&r1=291667&r2=291668&view=diff
==============================================================================
--- maven/components/trunk/maven-reporting/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java (original)
+++ maven/components/trunk/maven-reporting/maven-reporting-impl/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java Mon Sep 26 09:41:53 2005
@@ -190,9 +190,28 @@
      */
     protected void tableCell( String text )
     {
+        tableCell( text, false );
+    }
+
+    /**
+     * Add a cell in a table.
+     * <p>If <code>asHtml</code> is true, add the text as Html</p>
+     *
+     * @param text
+     * @param asHtml
+     */
+    protected void tableCell( String text, boolean asHtml )
+    {
         sink.tableCell();
 
-        linkPatternedText( text );
+        if ( asHtml )
+        {
+            sink.rawText( text );
+        }
+        else
+        {
+            linkPatternedText( text );
+        }
 
         sink.tableCell_();
     }
@@ -224,7 +243,9 @@
     protected void tableCaption( String caption )
     {
         sink.tableCaption();
+
         text( caption );
+
         sink.tableCaption_();
     }
 
@@ -422,7 +443,8 @@
 
     /**
      * Return a valid href.
-     * <p>A valid href could start by <code>mailto:</code></p>.
+     * <p>A valid href could start by <code>mailto:</code>.</p>
+     * <p>For a relative path, the href should start by <code>./</code> to be valid.</p>
      *
      * @param href an href
      * @return a valid href or null if the href is not valid.
@@ -451,7 +473,7 @@
             // TODO Waiting for new release of Validator
             // http://issues.apache.org/bugzilla/show_bug.cgi?id=30686
             String hrefTmp;
-            if ( !href.trim().endsWith( "/" ) )
+            if ( !href.endsWith( "/" ) )
             {
                 hrefTmp = href + "/index.html";
             }
@@ -465,6 +487,18 @@
                 return href;
             }
 
+            if ( href.startsWith( "./" ) )
+            {
+                if ( href.length() > 2 )
+                {
+                    return href.substring(2, href.length() );
+                }
+                else
+                {
+                    return ".";
+                }
+            }
+
             return null;
         }
     }
@@ -484,7 +518,7 @@
         }
 
         // Map defined by key/value name/href
-        // If href == null, it means 
+        // If href == null, it means
         Map segments = new LinkedHashMap();
 
         // TODO Special case http://jira.codehaus.org/browse/MEV-40



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