You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by vs...@apache.org on 2009/06/05 14:20:00 UTC

svn commit: r781994 - /maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java

Author: vsiveton
Date: Fri Jun  5 12:20:00 2009
New Revision: 781994

URL: http://svn.apache.org/viewvc?rev=781994&view=rev
Log:
o fixed compName due to r781989

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java?rev=781994&r1=781993&r2=781994&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java Fri Jun  5 12:20:00 2009
@@ -935,7 +935,7 @@
 
         writeCoverHead( cover );
         writeCoverBody( cover, meta );
-        writeCoverFooter( cover );
+        writeCoverFooter( cover, meta );
 
         writeEndTag( TABLE_BODY_TAG );
         writeEndTag( TABLE_TAG );
@@ -1004,7 +1004,7 @@
         if ( cover == null )
         {
             // aleady checked that meta != null
-            getLog().debug( "The DocumentCover is not defined, using the DocumentMeta title." );
+            getLog().debug( "The DocumentCover is not defined, using the DocumentMeta title as cover title." );
             title = meta.getTitle();
         }
         else
@@ -1090,24 +1090,35 @@
         writeEndTag( TABLE_ROW_TAG );
     }
 
-    private void writeCoverFooter( DocumentCover cover )
+    private void writeCoverFooter( DocumentCover cover, DocumentMeta meta  )
     {
-        if ( cover == null )
+        if ( cover == null && meta == null )
         {
             return;
         }
 
         String date = null;
-        String compName = cover.getCompanyName();
-        if ( cover.getCoverDate_() == null )
+        String compName = null;
+        if ( cover == null )
         {
-            cover.setCoverDate( new Date() );
-            date = cover.getCoverDate_();
-            cover.setCoverDate( null );
+            // aleady checked that meta != null
+            getLog().debug( "The DocumentCover is not defined, using the DocumentMeta author as company name." );
+            compName = meta.getAuthor();
         }
         else
         {
-            date = cover.getCoverDate_();
+            compName = cover.getCompanyName();
+
+            if ( cover.getCoverDate_() == null )
+            {
+                cover.setCoverDate( new Date() );
+                date = cover.getCoverDate_();
+                cover.setCoverDate( null );
+            }
+            else
+            {
+                date = cover.getCoverDate_();
+            }
         }
 
         writeStartTag( TABLE_ROW_TAG, "height", "0.3in" );
@@ -1117,7 +1128,7 @@
         att.addAttribute( "height", "0.3in" );
         att.addAttribute( "text-align", "left" );
         writeStartTag( BLOCK_TAG, att );
-        write( compName == null ? "" : compName );
+        write( compName == null ? ( cover.getAuthor() == null ? "" : cover.getAuthor() ) : compName );
         writeEndTag( BLOCK_TAG );
         writeEndTag( TABLE_CELL_TAG );