From doxia-commitsyhunt@example.com Wed Jul 15 14:33:54 2009
Return-Path: <doxia-commitsyhunt@example.com>
Delivered-To: yhunt@example.com
Received: (qmail 33953 invoked from network); 15 Jul 2009 14:33:53 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 15 Jul 2009 14:33:53 -0000
Received: (qmail 95357 invoked by uid 500); 15 Jul 2009 14:34:03 -0000
Delivered-To: yhunt@example.com
Received: (qmail 95316 invoked by uid 500); 15 Jul 2009 14:34:03 -0000
Mailing-List: contact yhunt@example.com; run by ezmlm
Precedence: bulk
List-Help: <mailto:yhunt@example.com>
List-Unsubscribe: <mailto:yhunt@example.com>
List-Post: <mailto:yhunt@example.com>
List-Id: <doxia-commits.maven.apache.org>
Reply-To: yhunt@example.com
Delivered-To: mailing list yhunt@example.com
Received: (qmail 95307 invoked by uid 99); 15 Jul 2009 14:34:03 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2009 14:34:03 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2009 14:34:00 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 195AE23889B8; Wed, 15 Jul 2009 14:33:39 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r794284 -
 /maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
Date: Wed, 15 Jul 2009 14:33:38 -0000
To: yhunt@example.com
From: yhunt@example.com
X-Mailer: svnmailer-1.0.8
Message-Id: <yhunt@example.com>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: ltheussl
Date: Wed Jul 15 14:33:38 2009
New Revision: 794284

URL: http://svn.apache.org/viewvc?rev=794284&view=rev
Log:
log parse exception

Modified:
    maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java?rev=794284&r1=794283&r2=794284&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java Wed Jul 15 14:33:38 2009
@@ -482,11 +482,12 @@
             try
             {
                 // we support only ISO-8601 date
-                context.put( "dateCreation", sdf.format( new SimpleDateFormat( "yyyy-MM-dd" ).parse( sink.getDate() ) ) );
+                context.put( "dateCreation",
+                        sdf.format( new SimpleDateFormat( "yyyy-MM-dd" ).parse( sink.getDate() ) ) );
             }
-            catch ( Exception e )
+            catch ( java.text.ParseException e )
             {
-                // nop
+                getLogger().debug( "Could not parse date: " + sink.getDate() + ", ignoring!", e );
             }
         }
         context.put( "dateRevision", sdf.format( new Date() ) );



From doxia-commitsyhunt@example.com Fri Jul 17 10:45:42 2009
Return-Path: <doxia-commitsyhunt@example.com>
Delivered-To: yhunt@example.com
Received: (qmail 69755 invoked from network); 17 Jul 2009 10:45:41 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 17 Jul 2009 10:45:41 -0000
Received: (qmail 87541 invoked by uid 500); 17 Jul 2009 10:46:47 -0000
Delivered-To: yhunt@example.com
Received: (qmail 87498 invoked by uid 500); 17 Jul 2009 10:46:47 -0000
Mailing-List: contact yhunt@example.com; run by ezmlm
Precedence: bulk
List-Help: <mailto:yhunt@example.com>
List-Unsubscribe: <mailto:yhunt@example.com>
List-Post: <mailto:yhunt@example.com>
List-Id: <doxia-commits.maven.apache.org>
Reply-To: yhunt@example.com
Delivered-To: mailing list yhunt@example.com
Received: (qmail 87489 invoked by uid 99); 17 Jul 2009 10:46:47 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jul 2009 10:46:47 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jul 2009 10:46:43 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 0B6152388892; Fri, 17 Jul 2009 10:46:22 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r795033 - in
 /maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src:
 main/java/org/apache/maven/doxia/module/latex/LatexSink.java
 test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java
Date: Fri, 17 Jul 2009 10:46:21 -0000
To: yhunt@example.com
From: yhunt@example.com
X-Mailer: svnmailer-1.0.8
Message-Id: <yhunt@example.com>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: ltheussl
Date: Fri Jul 17 10:46:21 2009
New Revision: 795033

URL: http://svn.apache.org/viewvc?rev=795033&view=rev
Log:
Implement all methods with SinkEventAttributes

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java?rev=795033&r1=795032&r2=795033&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java Fri Jul 17 10:46:21 2009
@@ -22,6 +22,7 @@
 import org.apache.maven.doxia.sink.AbstractTextSink;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.SinkEventAttributes;
+import org.apache.maven.doxia.sink.SinkEventAttributeSet;
 import org.apache.maven.doxia.util.DoxiaUtils;
 import org.apache.maven.doxia.util.LineBreaker;
 
@@ -65,8 +66,6 @@
 
     private boolean verbatimFlag;
 
-    private boolean boxFlag;
-
     private boolean figureFlag;
 
     private boolean tableFlag;
@@ -172,10 +171,15 @@
      */
     public void head()
     {
+        head( null );
+    }
+
+    /** {@inheritDoc} */
+    public void head( SinkEventAttributes attributes )
+    {
         titleFlag = false;
         numberedListNesting = 0;
         verbatimFlag = false;
-        boxFlag = false;
         figureFlag = false;
         tableFlag = false;
         gridFlag = false;
@@ -199,6 +203,12 @@
      */
     public void body()
     {
+        body( null );
+    }
+
+    /** {@inheritDoc} */
+    public void body( SinkEventAttributes attributes )
+    {
         if ( titleFlag )
         {
             if ( fragmentDocument  )
@@ -231,6 +241,12 @@
      */
     public void title()
     {
+        title( null );
+    }
+
+    /** {@inheritDoc} */
+    public void title( SinkEventAttributes attributes )
+    {
         if ( !fragmentDocument )
         {
             titleFlag = true;
@@ -262,6 +278,12 @@
      */
     public void author()
     {
+        author( null );
+    }
+
+    /** {@inheritDoc} */
+    public void author( SinkEventAttributes attributes )
+    {
         if ( !fragmentDocument )
         {
             markup( "\\author{" );
@@ -292,6 +314,12 @@
      */
     public void date()
     {
+        date( null );
+    }
+
+    /** {@inheritDoc} */
+    public void date( SinkEventAttributes attributes )
+    {
         if ( !fragmentDocument )
         {
             markup( "\\date{" );
@@ -317,6 +345,47 @@
         }
     }
 
+    /** {@inheritDoc} */
+    public void sectionTitle( int level, SinkEventAttributes attributes )
+    {
+        isTitle = true;
+    }
+
+    /** {@inheritDoc} */
+    public void sectionTitle_( int level )
+    {
+        String command = "";
+        switch ( level )
+        {
+            case SECTION_LEVEL_1:
+                command = "section";
+                break;
+            case SECTION_LEVEL_2:
+                command = "subsection";
+                break;
+            case SECTION_LEVEL_3:
+                command = "subsubsection";
+                break;
+            case SECTION_LEVEL_4:
+                command = "paragraph";
+                break;
+            case SECTION_LEVEL_5:
+                command = "subparagraph";
+                break;
+            default:
+                throw new IllegalArgumentException( "Not a section level: " + level );
+        }
+
+        isTitle = false;
+
+        if ( StringUtils.isNotEmpty( title ) )
+        {
+            markup( EOL + "\\" + command + "{" + title + "}" + EOL );
+
+            title = null;
+        }
+    }
+
     // ----------------------------------------------------------------------
     // Section Title 1
     // ----------------------------------------------------------------------
@@ -326,7 +395,7 @@
      */
     public void sectionTitle1()
     {
-        isTitle = true;
+        sectionTitle( SECTION_LEVEL_1, null );
     }
 
     /**
@@ -334,14 +403,7 @@
      */
     public void sectionTitle1_()
     {
-        isTitle = false;
-
-        if ( StringUtils.isNotEmpty( title ) )
-        {
-            markup( EOL + "\\section{" + title + "}" + EOL );
-
-            title = null;
-        }
+        sectionTitle_( SECTION_LEVEL_1 );
     }
 
     // ----------------------------------------------------------------------
@@ -353,7 +415,7 @@
      */
     public void sectionTitle2()
     {
-        isTitle = true;
+        sectionTitle( SECTION_LEVEL_2, null );
     }
 
     /**
@@ -361,14 +423,7 @@
      */
     public void sectionTitle2_()
     {
-        isTitle = false;
-
-        if ( StringUtils.isNotEmpty( title ) )
-        {
-            markup( EOL + "\\subsection{" + title + "}" + EOL );
-
-            title = null;
-        }
+        sectionTitle_( SECTION_LEVEL_2 );
     }
 
     // ----------------------------------------------------------------------
@@ -380,7 +435,7 @@
      */
     public void sectionTitle3()
     {
-        isTitle = true;
+        sectionTitle( SECTION_LEVEL_3, null );
     }
 
     /**
@@ -388,14 +443,7 @@
      */
     public void sectionTitle3_()
     {
-        isTitle = false;
-
-        if ( StringUtils.isNotEmpty( title ) )
-        {
-            markup( EOL + "\\subsubsection{" + title + "}" + EOL );
-
-            title = null;
-        }
+        sectionTitle_( SECTION_LEVEL_3 );
     }
 
     // ----------------------------------------------------------------------
@@ -407,7 +455,7 @@
      */
     public void sectionTitle4()
     {
-        isTitle = true;
+        sectionTitle( SECTION_LEVEL_4, null );
     }
 
     /**
@@ -415,14 +463,7 @@
      */
     public void sectionTitle4_()
     {
-        isTitle = false;
-
-        if ( StringUtils.isNotEmpty( title ) )
-        {
-            markup( EOL + "\\paragraph{" + title + "}" + EOL );
-
-            title = null;
-        }
+        sectionTitle_( SECTION_LEVEL_4 );
     }
 
     // ----------------------------------------------------------------------
@@ -434,7 +475,7 @@
      */
     public void sectionTitle5()
     {
-        isTitle = true;
+        sectionTitle( SECTION_LEVEL_5, null );
     }
 
     /**
@@ -442,14 +483,7 @@
      */
     public void sectionTitle5_()
     {
-        isTitle = false;
-
-        if ( StringUtils.isNotEmpty( title ) )
-        {
-            markup( EOL + "\\subparagraph{" + title + "}" + EOL );
-
-            title = null;
-        }
+        sectionTitle_( SECTION_LEVEL_5 );
     }
 
     // ----------------------------------------------------------------------
@@ -461,6 +495,12 @@
      */
     public void list()
     {
+        list( null );
+    }
+
+    /** {@inheritDoc} */
+    public void list( SinkEventAttributes attributes )
+    {
         markup( EOL + "\\begin{itemize}" );
     }
 
@@ -477,6 +517,12 @@
      */
     public void listItem()
     {
+        listItem( null );
+    }
+
+    /** {@inheritDoc} */
+    public void listItem( SinkEventAttributes attributes )
+    {
         markup( EOL + "\\item " );
     }
 
@@ -485,6 +531,12 @@
      */
     public void numberedList( int numbering )
     {
+        numberedList( numbering, null );
+    }
+
+    /** {@inheritDoc} */
+    public void numberedList( int numbering, SinkEventAttributes attributes )
+    {
         ++numberedListNesting;
 
         String counter;
@@ -542,6 +594,12 @@
      */
     public void numberedListItem()
     {
+        numberedListItem( null );
+    }
+
+    /** {@inheritDoc} */
+    public void numberedListItem( SinkEventAttributes attributes )
+    {
         markup( "\\item " );
     }
 
@@ -550,6 +608,12 @@
      */
     public void definitionList()
     {
+        definitionList( null );
+    }
+
+    /** {@inheritDoc} */
+    public void definitionList( SinkEventAttributes attributes )
+    {
         markup( EOL + "\\begin{description}" );
     }
 
@@ -566,6 +630,12 @@
      */
     public void definedTerm()
     {
+        definedTerm( null );
+    }
+
+    /** {@inheritDoc} */
+    public void definedTerm( SinkEventAttributes attributes )
+    {
         markup( EOL + "\\item[\\mbox{" );
     }
 
@@ -577,6 +647,42 @@
         markup( "}] " );
     }
 
+    /** {@inheritDoc} */
+    public void definitionListItem()
+    {
+        definitionListItem( null );
+    }
+
+    /** {@inheritDoc} */
+    public void definitionListItem( SinkEventAttributes attributes )
+    {
+        // nop
+    }
+
+    /** {@inheritDoc} */
+    public void definitionListItem_()
+    {
+        // nop
+    }
+
+    /** {@inheritDoc} */
+    public void definition()
+    {
+        definition( null );
+    }
+
+    /** {@inheritDoc} */
+    public void definition( SinkEventAttributes attributes )
+    {
+        // nop
+    }
+
+    /** {@inheritDoc} */
+    public void definition_()
+    {
+        // nop
+    }
+
     // ----------------------------------------------------------------------
     // Figure
     // ----------------------------------------------------------------------
@@ -586,6 +692,12 @@
      */
     public void figure()
     {
+        figure( null );
+    }
+
+    /** {@inheritDoc} */
+    public void figure( SinkEventAttributes attributes )
+    {
         figureFlag = true;
         markup( EOL + "\\begin{figure}[htb]" + EOL );
     }
@@ -604,13 +716,19 @@
      */
     public void figureGraphics( String name )
     {
-        if ( !name.toLowerCase( Locale.ENGLISH ).endsWith( ".eps" ) )
+        figureGraphics( name, null );
+    }
+
+    /** {@inheritDoc} */
+    public void figureGraphics( String src, SinkEventAttributes attributes )
+    {
+        if ( !src.toLowerCase( Locale.ENGLISH ).endsWith( ".eps" ) )
         {
             getLog().warn( "[Latex Sink] Found non-eps figure graphics!" );
         }
 
         markup( "\\begin{center}" + EOL );
-        markup( "\\includegraphics{" + name + "}" + EOL );
+        markup( "\\includegraphics{" + src + "}" + EOL );
         markup( "\\end{center}" + EOL );
     }
 
@@ -619,6 +737,12 @@
      */
     public void figureCaption()
     {
+        figureCaption( null );
+    }
+
+    /** {@inheritDoc} */
+    public void figureCaption( SinkEventAttributes attributes )
+    {
         markup( "\\caption{" );
     }
 
@@ -639,6 +763,12 @@
      */
     public void table()
     {
+        table( null );
+    }
+
+    /** {@inheritDoc} */
+    public void table( SinkEventAttributes attributes )
+    {
         tableFlag = true;
         markup( EOL + "\\begin{table}[htp]" + EOL );
     }
@@ -712,6 +842,12 @@
      */
     public void tableRow()
     {
+        tableRow( null );
+    }
+
+    /** {@inheritDoc} */
+    public void tableRow( SinkEventAttributes attributes )
+    {
         cellCount = 0;
     }
 
@@ -734,6 +870,21 @@
      */
     public void tableCell()
     {
+        tableCell( (SinkEventAttributes) null );
+    }
+
+    /** {@inheritDoc} */
+    public void tableCell( String width )
+    {
+        SinkEventAttributeSet att = new SinkEventAttributeSet();
+        att.addAttribute( javax.swing.text.html.HTML.Attribute.WIDTH, width );
+
+        tableCell( att );
+    }
+
+    /** {@inheritDoc} */
+    public void tableCell( SinkEventAttributes attributes )
+    {
         tableCell( false );
     }
 
@@ -742,7 +893,8 @@
      */
     public void tableCell_()
     {
-        tableCell_( false );
+        markup( "\\end{tabular}" );
+        ++cellCount;
     }
 
     /**
@@ -750,6 +902,21 @@
      */
     public void tableHeaderCell()
     {
+        tableCell( (SinkEventAttributes) null );
+    }
+
+    /** {@inheritDoc} */
+    public void tableHeaderCell( String width )
+    {
+        SinkEventAttributeSet att = new SinkEventAttributeSet();
+        att.addAttribute( javax.swing.text.html.HTML.Attribute.WIDTH, width );
+
+        tableHeaderCell( att );
+    }
+
+    /** {@inheritDoc} */
+    public void tableHeaderCell( SinkEventAttributes attributes )
+    {
         tableCell( true );
     }
 
@@ -758,7 +925,7 @@
      */
     public void tableHeaderCell_()
     {
-        tableCell_( true );
+        tableCell_();
     }
 
     private boolean lastCellWasHeader = false;
@@ -795,20 +962,15 @@
     }
 
     /**
-     * Ends a table cell.
-     *
-     * @param header True if this is a header cell.
+     * {@inheritDoc}
      */
-    private void tableCell_( boolean header )
+    public void tableCaption()
     {
-        markup( "\\end{tabular}" );
-        ++cellCount;
+        tableCaption( null );
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    public void tableCaption()
+    /** {@inheritDoc} */
+    public void tableCaption( SinkEventAttributes attributes )
     {
         markup( "\\caption{" );
     }
@@ -826,6 +988,12 @@
      */
     public void paragraph()
     {
+        paragraph( null );
+    }
+
+    /** {@inheritDoc} */
+    public void paragraph( SinkEventAttributes attributes )
+    {
         markup( EOL + EOL );
     }
 
@@ -842,6 +1010,20 @@
      */
     public void verbatim( boolean boxed )
     {
+        verbatim( boxed ? SinkEventAttributeSet.BOXED : null );
+    }
+
+    /** {@inheritDoc} */
+    public void verbatim( SinkEventAttributes attributes )
+    {
+        boolean boxed = false;
+
+        if ( attributes != null && attributes.isDefined( SinkEventAttributes.DECORATION ) )
+        {
+            boxed = "boxed".equals(
+                (String) attributes.getAttribute( SinkEventAttributes.DECORATION ) );
+        }
+
         markup( EOL + "\\begin{small}" + EOL );
 
         if ( boxed )
@@ -854,7 +1036,6 @@
         }
 
         verbatimFlag = true;
-        boxFlag = boxed;
     }
 
     /**
@@ -866,7 +1047,6 @@
         markup( "\\end{small}" + EOL );
 
         verbatimFlag = false;
-        boxFlag = false;
     }
 
     /**
@@ -874,6 +1054,12 @@
      */
     public void horizontalRule()
     {
+        horizontalRule( null );
+    }
+
+    /** {@inheritDoc} */
+    public void horizontalRule( SinkEventAttributes attributes )
+    {
         markup( EOL + "\\begin{center}\\rule[0.5ex]{\\linewidth}{1pt}\\end{center}" + EOL );
     }
 
@@ -890,6 +1076,12 @@
      */
     public void anchor( String name )
     {
+        anchor( name, null );
+    }
+
+    /** {@inheritDoc} */
+    public void anchor( String name, SinkEventAttributes attributes )
+    {
         markup( "\\hypertarget{" + name + "}{" );
     }
 
@@ -906,6 +1098,12 @@
      */
     public void link( String name )
     {
+        link( name, null );
+    }
+
+    /** {@inheritDoc} */
+    public void link( String name, SinkEventAttributes attributes )
+    {
         // TODO: use \\url for simple links
         if ( DoxiaUtils.isExternalLink( name ) )
         {
@@ -978,6 +1176,12 @@
      */
     public void lineBreak()
     {
+        lineBreak( null );
+    }
+
+    /** {@inheritDoc} */
+    public void lineBreak( SinkEventAttributes attributes )
+    {
         markup( ( figureFlag || tableFlag || titleFlag || verbatimFlag ) ? EOL : "\\newline" + EOL );
     }
 
@@ -994,6 +1198,12 @@
      */
     public void text( String text )
     {
+        text( text, null );
+    }
+
+    /** {@inheritDoc} */
+    public void text( String text, SinkEventAttributes attributes )
+    {
         if ( ignoreText )
         {
             return;
@@ -1012,6 +1222,18 @@
         }
     }
 
+    /** {@inheritDoc} */
+    public void rawText( String text )
+    {
+        verbatimContent( text );
+    }
+
+    /** {@inheritDoc} */
+    public void comment( String comment )
+    {
+        rawText( EOL + "% " + comment );
+    }
+
     /**
      * {@inheritDoc}
      *
@@ -1211,5 +1433,4 @@
             return "";
         }
     }
-
 }

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java?rev=795033&r1=795032&r2=795033&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java Fri Jul 17 10:46:21 2009
@@ -70,9 +70,9 @@
     /** {@inheritDoc} */
     protected String getHeadBlock()
     {
-        return ((LatexSink) getSink()).defaultSinkCommands()
+        return ( (LatexSink) getSink() ).defaultSinkCommands()
             + "\\documentclass[a4paper]{article}" + EOL + EOL
-            + ((LatexSink) getSink()).defaultPreamble()
+            + ( (LatexSink) getSink() ).defaultPreamble()
             + "\\begin{document}" + EOL + EOL;
     }
 
@@ -134,7 +134,8 @@
     /** {@inheritDoc} */
     protected String getDefinitionListBlock( String definum, String definition )
     {
-        return EOL + "\\begin{description}" + EOL + "\\item[\\mbox{" + definum + "}] " + definition + EOL + "\\end{description}" + EOL;
+        return EOL + "\\begin{description}" + EOL + "\\item[\\mbox{" + definum + "}] "
+                + definition + EOL + "\\end{description}" + EOL;
     }
 
     /** {@inheritDoc} */
@@ -223,19 +224,19 @@
     protected String getTextBlock( String text )
     {
         // TODO: how to retrieve those outside the sink?
-        return "\\textasciitilde" + EOL + ",\\_=,\\_\\symbol{45},\\_+,\\_*,\\_[,\\_],\\_\\symbol{60},\\_\\symbol{62},\\_\\{,\\_\\},\\_\\textbackslash";
+        return "\\textasciitilde" + EOL + ",\\_=,\\_\\symbol{45},\\_+,\\_*,\\_[,\\_],"
+                + "\\_\\symbol{60},\\_\\symbol{62},\\_\\{,\\_\\},\\_\\textbackslash";
     }
 
     /** {@inheritDoc} */
     protected String getRawTextBlock( String text )
     {
-        // TODO: not implemented
-        return "";
+        return "~,_=,_-,_+,_*,_[,_],_<,_>,_{,_},_\\";
     }
 
     /** {@inheritDoc} */
     protected String getCommentBlock( String text )
     {
-        return "";
+        return EOL + "% Simple comment with ----";
     }
 }



From doxia-commitsyhunt@example.com Mon Jul 27 14:17:17 2009
Return-Path: <doxia-commitsyhunt@example.com>
Delivered-To: yhunt@example.com
Received: (qmail 40389 invoked from network); 27 Jul 2009 14:17:17 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 27 Jul 2009 14:17:17 -0000
Received: (qmail 29077 invoked by uid 500); 27 Jul 2009 14:18:21 -0000
Delivered-To: yhunt@example.com
Received: (qmail 29034 invoked by uid 500); 27 Jul 2009 14:18:21 -0000
Mailing-List: contact yhunt@example.com; run by ezmlm
Precedence: bulk
List-Help: <mailto:yhunt@example.com>
List-Unsubscribe: <mailto:yhunt@example.com>
List-Post: <mailto:yhunt@example.com>
List-Id: <doxia-commits.maven.apache.org>
Reply-To: yhunt@example.com
Delivered-To: mailing list yhunt@example.com
Received: (qmail 29025 invoked by uid 99); 27 Jul 2009 14:18:21 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 14:18:21 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 14:18:17 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 47A26238889C; Mon, 27 Jul 2009 14:17:56 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r798146 - in
 /maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance:
 DecorationModelInheritenceAssemblerTest.java Doxia91Test.java
 PathDescriptorTest.java
Date: Mon, 27 Jul 2009 14:17:56 -0000
To: yhunt@example.com
From: yhunt@example.com
X-Mailer: svnmailer-1.0.8
Message-Id: <yhunt@example.com>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: ltheussl
Date: Mon Jul 27 14:17:55 2009
New Revision: 798146

URL: http://svn.apache.org/viewvc?rev=798146&view=rev
Log:
formatting, javadocs. One more test for PathDescriptorTest.

Modified:
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/Doxia91Test.java
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.java

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java?rev=798146&r1=798145&r2=798146&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java Mon Jul 27 14:17:55 2009
@@ -48,6 +48,7 @@
 
     private static final String NAME = "Name";
 
+    /** @throws Exception */
     public void testInheritence()
         throws IOException, XmlPullParserException
     {

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/Doxia91Test.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/Doxia91Test.java?rev=798146&r1=798145&r2=798146&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/Doxia91Test.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/Doxia91Test.java Mon Jul 27 14:17:55 2009
@@ -31,6 +31,7 @@
 public class Doxia91Test
     extends TestCase
 {
+    /** @throws Exception */
     public void testOldPathNull()
         throws Exception
     {
@@ -42,6 +43,7 @@
         assertEquals( diff, oldPath );
     }
 
+    /** @throws Exception */
     public void testNewPathNull()
         throws Exception
     {
@@ -53,6 +55,7 @@
         assertEquals( diff, oldPath );
     }
 
+    /** @throws Exception */
     public void testBothPathNull()
         throws Exception
     {

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.java?rev=798146&r1=798145&r2=798146&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.java Mon Jul 27 14:17:55 2009
@@ -35,6 +35,7 @@
 public class PathDescriptorTest
     extends TestCase
 {
+    /** @throws Exception */
     public void testAbsPath()
         throws Exception
     {
@@ -52,6 +53,7 @@
         assertEquals( "wrong location", path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testRelPath()
         throws Exception
     {
@@ -69,6 +71,7 @@
         assertEquals( "wrong location", path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testEmptyAbsPath()
         throws Exception
     {
@@ -86,6 +89,7 @@
         assertEquals( "wrong location", path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testEmptyRelPath()
         throws Exception
     {
@@ -103,6 +107,7 @@
         assertEquals( "wrong location", path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testNullPath()
         throws Exception
     {
@@ -120,6 +125,7 @@
         assertEquals( "wrong location", path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testNullBaseAbsPath()
         throws Exception
     {
@@ -138,6 +144,7 @@
         assertEquals( "wrong location", path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testNullBaseRelPath()
         throws Exception
     {
@@ -156,6 +163,7 @@
         assertEquals( "wrong location", path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testNullBaseEmptyAbsPath()
         throws Exception
     {
@@ -174,6 +182,7 @@
         assertEquals( "wrong location", path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testNullBaseEmptyRelPath()
         throws Exception
     {
@@ -192,6 +201,7 @@
         assertEquals( "wrong location", path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testNullBaseNullPath()
         throws Exception
     {
@@ -210,6 +220,7 @@
         assertEquals( "wrong location", path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testUrlBaseAbsPath()
         throws Exception
     {
@@ -228,6 +239,7 @@
         assertEquals( "wrong location", base + path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testUrlBaseRelPath()
         throws Exception
     {
@@ -246,6 +258,7 @@
         assertEquals( "wrong location", base + path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testUrlBaseEmptyAbsPath()
         throws Exception
     {
@@ -264,6 +277,7 @@
         assertEquals( "wrong location", base + path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testUrlBaseEmptyRelPath()
         throws Exception
     {
@@ -282,6 +296,7 @@
         assertEquals( "wrong location", base + path, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testUrlBaseNullPath()
         throws Exception
     {
@@ -300,6 +315,7 @@
         assertEquals( "wrong location", base, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testFileBaseAbsPath()
         throws Exception
     {
@@ -316,7 +332,7 @@
         assertNotNull( desc.getLocation() );
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
         {
-            String s = StringUtils.replace( new File( base + "/" + path ).toURL().toString(), "file:", "" );
+            String s = StringUtils.replace( new File( base + "/" + path ).toURI().toURL().toString(), "file:", "" );
             assertEquals( "wrong path", s, desc.getPath() );
             assertEquals( "wrong location", s, desc.getLocation() );
         }
@@ -327,6 +343,7 @@
         }
     }
 
+    /** @throws Exception */
     public void testFileBaseRelPath()
         throws Exception
     {
@@ -343,7 +360,7 @@
         assertNotNull( desc.getLocation() );
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
         {
-            String s = StringUtils.replace( new File( base + "/" + path ).toURL().toString(), "file:", "" );
+            String s = StringUtils.replace( new File( base + "/" + path ).toURI().toURL().toString(), "file:", "" );
             assertEquals( "wrong path", s, desc.getPath() );
             assertEquals( "wrong location", s, desc.getLocation() );
         }
@@ -354,6 +371,7 @@
         }
     }
 
+    /** @throws Exception */
     public void testFileBaseEmptyAbsPath()
         throws Exception
     {
@@ -370,7 +388,7 @@
         assertNotNull( desc.getLocation() );
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
         {
-            String s = StringUtils.replace( new File( base ).toURL().toString(), "file:", "" );
+            String s = StringUtils.replace( new File( base ).toURI().toURL().toString(), "file:", "" );
             assertEquals( "wrong path", s, desc.getPath() );
             assertEquals( "wrong location", s, desc.getLocation() );
         }
@@ -381,6 +399,7 @@
         }
     }
 
+    /** @throws Exception */
     public void testFileBaseEmptyRelPath()
         throws Exception
     {
@@ -397,7 +416,7 @@
         assertNotNull( desc.getLocation() );
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
         {
-            String s = StringUtils.replace( new File( base ).toURL().toString(), "file:", "" );
+            String s = StringUtils.replace( new File( base ).toURI().toURL().toString(), "file:", "" );
             assertEquals( "wrong path", s, desc.getPath() );
             assertEquals( "wrong location", s, desc.getLocation() );
         }
@@ -408,6 +427,7 @@
         }
     }
 
+    /** @throws Exception */
     public void testFileBaseNullPath()
         throws Exception
     {
@@ -426,6 +446,7 @@
         assertEquals( "wrong location", base, desc.getLocation() );
     }
 
+    /** @throws Exception */
     public void testPathBaseAbsPath()
         throws Exception
     {
@@ -442,7 +463,7 @@
         assertNotNull( desc.getLocation() );
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
         {
-            String s = StringUtils.replace( new File( base + "/" + path ).toURL().toString(), "file:", "" );
+            String s = StringUtils.replace( new File( base + "/" + path ).toURI().toURL().toString(), "file:", "" );
             assertEquals( "wrong path", s, desc.getPath() );
             assertEquals( "wrong location", s, desc.getLocation() );
         }
@@ -453,6 +474,7 @@
         }
     }
 
+    /** @throws Exception */
     public void testPathBaseRelPath()
         throws Exception
     {
@@ -469,7 +491,7 @@
         assertNotNull( desc.getLocation() );
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
         {
-            String s = StringUtils.replace( new File( base + "/" + path ).toURL().toString(), "file:", "" );
+            String s = StringUtils.replace( new File( base + "/" + path ).toURI().toURL().toString(), "file:", "" );
             assertEquals( "wrong path", s, desc.getPath() );
             assertEquals( "wrong location", s, desc.getLocation() );
         }
@@ -480,6 +502,7 @@
         }
     }
 
+    /** @throws Exception */
     public void testPathBaseEmptyAbsPath()
         throws Exception
     {
@@ -496,7 +519,7 @@
         assertNotNull( desc.getLocation() );
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
         {
-            String s = StringUtils.replace( new File( base ).toURL().toString(), "file:", "" );
+            String s = StringUtils.replace( new File( base ).toURI().toURL().toString(), "file:", "" );
             assertEquals( "wrong path", s, desc.getPath() );
             assertEquals( "wrong location", s, desc.getLocation() );
         }
@@ -507,6 +530,7 @@
         }
     }
 
+    /** @throws Exception */
     public void testPathBaseEmptyRelPath()
         throws Exception
     {
@@ -523,7 +547,7 @@
         assertNotNull( desc.getLocation() );
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
         {
-            String s = StringUtils.replace( new File( base ).toURL().toString(), "file:", "" );
+            String s = StringUtils.replace( new File( base ).toURI().toURL().toString(), "file:", "" );
             assertEquals( "wrong path", s, desc.getPath() );
             assertEquals( "wrong location", s, desc.getLocation() );
         }
@@ -534,6 +558,7 @@
         }
     }
 
+    /** @throws Exception */
     public void testPathBaseNullPath()
         throws Exception
     {
@@ -550,7 +575,7 @@
         assertNotNull( desc.getLocation() );
         if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
         {
-            String s = StringUtils.replace( new File( base ).toURL().toString(), "file:", "" );
+            String s = StringUtils.replace( new File( base ).toURI().toURL().toString(), "file:", "" );
             assertEquals( "wrong path", s, desc.getPath() );
             assertEquals( "wrong location", s, desc.getLocation() );
         }
@@ -560,4 +585,23 @@
             assertEquals( "wrong location", base, desc.getLocation() );
         }
     }
+
+    /** @throws Exception */
+    public void testPathRelBase()
+        throws Exception
+    {
+        String base = "../msite-404";
+        String path = "index.html";
+
+        PathDescriptor desc = new PathDescriptor( base, path );
+
+        assertTrue( desc.isFile() );
+        assertFalse( desc.isRelative() );
+        assertNotNull( desc.getBaseUrl() );
+        assertNotNull( desc.getPathUrl() );
+        assertNotNull( desc.getPath() );
+        assertNotNull( desc.getLocation() );
+        assertEquals( desc.getPath(), desc.getLocation() );
+        assertEquals( desc.getPathUrl().toString(), desc.getBaseUrl().toString() + "/" + path );
+    }
 }



From doxia-commitsyhunt@example.com Mon Jul 27 14:19:01 2009
Return-Path: <doxia-commitsyhunt@example.com>
Delivered-To: yhunt@example.com
Received: (qmail 41408 invoked from network); 27 Jul 2009 14:19:01 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 27 Jul 2009 14:19:01 -0000
Received: (qmail 31284 invoked by uid 500); 27 Jul 2009 14:20:06 -0000
Delivered-To: yhunt@example.com
Received: (qmail 31247 invoked by uid 500); 27 Jul 2009 14:20:06 -0000
Mailing-List: contact yhunt@example.com; run by ezmlm
Precedence: bulk
List-Help: <mailto:yhunt@example.com>
List-Unsubscribe: <mailto:yhunt@example.com>
List-Post: <mailto:yhunt@example.com>
List-Id: <doxia-commits.maven.apache.org>
Reply-To: yhunt@example.com
Delivered-To: mailing list yhunt@example.com
Received: (qmail 31238 invoked by uid 99); 27 Jul 2009 14:20:06 -0000
Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 14:20:06 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 14:20:04 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id CB5E823888DC; Mon, 27 Jul 2009 14:19:43 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r798148 - in
 /maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src:
 main/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtils.java
 test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java
Date: Mon, 27 Jul 2009 14:19:43 -0000
To: yhunt@example.com
From: yhunt@example.com
X-Mailer: svnmailer-1.0.8
Message-Id: <yhunt@example.com>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: ltheussl
Date: Mon Jul 27 14:19:43 2009
New Revision: 798148

URL: http://svn.apache.org/viewvc?rev=798148&view=rev
Log:
[DOXIASITETOOLS-29] PathUtils.getRelativePath returns different results on Windows and Linux

Added:
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java   (with props)
Modified:
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtils.java

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtils.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtils.java?rev=798148&r1=798147&r2=798148&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtils.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtils.java Mon Jul 27 14:19:43 2009
@@ -90,6 +90,15 @@
                 // The old path is not relative. Bail out.
                 return null;
             }
+            else
+            {
+                // both are files, if either of them is relative, bail out
+                // see DOXIASITETOOLS-29, MSITE-404, PLXUTILS-116
+                if ( oldPathDescriptor.isRelative() || newPathDescriptor.isRelative() )
+                {
+                    return null;
+                }
+            }
         }
 
         // Don't optimize to else. This might also be old.isFile && new.isFile ...
@@ -121,7 +130,7 @@
             return null;
         }
 
-        // Both Descriptors point to a path. We can build a relative path.
+        // Both Descriptors point to an absolute path. We can build a relative path.
         String oldPath = oldPathDescriptor.getPath();
         String newPath = newPathDescriptor.getPath();
 

Added: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java?rev=798148&view=auto
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java (added)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java Mon Jul 27 14:19:43 2009
@@ -0,0 +1,63 @@
+package org.apache.maven.doxia.site.decoration.inheritance;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+/**
+ *
+ * @author ltheussl
+ * @version $Id$
+ */
+public class PathUtilsTest
+        extends TestCase
+{
+    private static final String SLASH = File.separator;
+
+    /** @throws Exception */
+    public void testConvertPath()
+            throws Exception
+    {
+        PathDescriptor oldPath = new PathDescriptor( (String) null, "base" );
+        PathDescriptor newPath = new PathDescriptor( "/tmp", "target" );
+        assertEquals( oldPath, PathUtils.convertPath( oldPath, newPath ) );
+        assertEquals( newPath, PathUtils.convertPath( newPath, oldPath ) );
+    }
+
+    /** @throws Exception */
+    public void testGetRelativePath()
+            throws Exception
+    {
+        PathDescriptor oldPath = new PathDescriptor( "/tmp/foo", "base" );
+        PathDescriptor newPath = new PathDescriptor( "/tmp", "target" );
+        assertEquals( ".." + SLASH + ".." + SLASH + "target",
+                PathUtils.getRelativePath( oldPath, newPath ) );
+
+        oldPath = new PathDescriptor( (String) null, "base" );
+        assertNull( PathUtils.getRelativePath( oldPath, newPath ) );
+        assertNull( PathUtils.getRelativePath( newPath, oldPath ) );
+
+        oldPath = new PathDescriptor( "/tmp/foo", null );
+        assertEquals( ".." + SLASH + "target", PathUtils.getRelativePath( oldPath, newPath ) );
+        assertEquals( ".." + SLASH + "foo", PathUtils.getRelativePath( newPath, oldPath ) );
+    }
+}

Propchange: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



From doxia-commitsyhunt@example.com Mon Jul 27 22:02:11 2009
Return-Path: <doxia-commitsyhunt@example.com>
Delivered-To: yhunt@example.com
Received: (qmail 75279 invoked from network); 27 Jul 2009 22:02:11 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 27 Jul 2009 22:02:11 -0000
Received: (qmail 79407 invoked by uid 500); 27 Jul 2009 22:03:16 -0000
Delivered-To: yhunt@example.com
Received: (qmail 79368 invoked by uid 500); 27 Jul 2009 22:03:16 -0000
Mailing-List: contact yhunt@example.com; run by ezmlm
Precedence: bulk
List-Help: <mailto:yhunt@example.com>
List-Unsubscribe: <mailto:yhunt@example.com>
List-Post: <mailto:yhunt@example.com>
List-Id: <doxia-commits.maven.apache.org>
Reply-To: yhunt@example.com
Delivered-To: mailing list yhunt@example.com
Received: (qmail 79359 invoked by uid 99); 27 Jul 2009 22:03:15 -0000
Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 22:03:15 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2009 22:03:13 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 9860E2388872; Mon, 27 Jul 2009 22:02:53 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r798303 -
 /maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
Date: Mon, 27 Jul 2009 22:02:53 -0000
To: yhunt@example.com
From: yhunt@example.com
X-Mailer: svnmailer-1.0.8
Message-Id: <yhunt@example.com>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: vsiveton
Date: Mon Jul 27 22:02:53 2009
New Revision: 798303

URL: http://svn.apache.org/viewvc?rev=798303&view=rev
Log:
DOXIA-338: Section numbering and links

o fix it as described

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java?rev=798303&r1=798302&r2=798303&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java Mon Jul 27 22:02:53 2009
@@ -69,7 +69,7 @@
  * @author <a href="mailto:yhunt@example.com">Vincent Siveton</a>
  * @version $Id$
  */
-public final class ITextSink
+public class ITextSink
     extends SinkAdapter
 {
     /** This is the place where the iText DTD is located. IMPORTANT: this DTD is not uptodate! */
@@ -104,7 +104,7 @@
     /** The font object */
     private ITextFont font;
 
-    private int numberDepth = 0;
+    private int numberDepth = 1;
 
     private int depth = 0;
 
@@ -1320,6 +1320,10 @@
         font.addUnderlined();
 
         writeStartElement( ElementTags.ANCHOR );
+        if ( StringUtils.isNotEmpty( name )&& name.startsWith( "#" ) && StringUtils.isNotEmpty( header.getTitle() ))
+        {
+            name = "#" + DoxiaUtils.encodeId( header.getTitle(), true ) + "_" + name.substring( 1 );
+        }
         writeAddAttribute( ElementTags.REFERENCE, HtmlTools.escapeHTML( name ) );
         writeAddAttribute( ElementTags.FONT, font.getFontName() );
         writeAddAttribute( ElementTags.SIZE, font.getFontSize() );
@@ -1359,6 +1363,10 @@
             throw new NullPointerException( "Anchor name cannot be null!" );
         }
 
+        if ( StringUtils.isNotEmpty( header.getTitle() ) )
+        {
+            name = header.getTitle() + "_" + name;
+        }
         String id = name;
 
         if ( !DoxiaUtils.isValidId( id ) )




{'source': 'Apache Software Foundation Public Mail Archives'}