svn commit: r763143 - /maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/table.confluence

2009-04-08 Thread ltheussl
Author: ltheussl
Date: Wed Apr  8 08:51:27 2009
New Revision: 763143

URL: http://svn.apache.org/viewvc?rev=763143&view=rev
Log:
Add a test resource for confluence tables (DOXIA-301)

Added:

maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/table.confluence

Added: 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/table.confluence
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/table.confluence?rev=763143&view=auto
==
--- 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/table.confluence
 (added)
+++ 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/test/resources/table.confluence
 Wed Apr  8 08:51:27 2009
@@ -0,0 +1,13 @@
+
+Simple table:
+
+||heading 1||heading 2||heading 3||
+|col A1|col A2|col A3|
+|col B1|col B2|col B3|
+
+Table with links (DOXIA-301):
+
+|| Version || Download || Date || Format || 
+|0.1.1 | [Download|http://example.com/release.0.1.1/ex-win32-win32.x86.zip] | 
12-12-2008 | zip |
+|0.1.2 | [Download|http://example.com/release.0.1.2/ex-win32-win32.x86.zip] | 
04-12-2008 | zip |
+|0.1.3 | [Download|http://example.com/release.0.1.3/ex-win32-win32.x86.zip] | 
03-11-2008 | zip |
\ No newline at end of file




svn commit: r763165 - /maven/doxia/doxia/trunk/pom.xml

2009-04-08 Thread ltheussl
Author: ltheussl
Date: Wed Apr  8 10:12:32 2009
New Revision: 763165

URL: http://svn.apache.org/viewvc?rev=763165&view=rev
Log:
Upgrade to latest modello-maven-plugin

Modified:
maven/doxia/doxia/trunk/pom.xml

Modified: maven/doxia/doxia/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/pom.xml?rev=763165&r1=763164&r2=763165&view=diff
==
--- maven/doxia/doxia/trunk/pom.xml (original)
+++ maven/doxia/doxia/trunk/pom.xml Wed Apr  8 10:12:32 2009
@@ -267,12 +267,13 @@
 
   org.codehaus.plexus
   plexus-maven-plugin
+  
   1.3.5
 
 
   org.codehaus.modello
   modello-maven-plugin
-  1.0
+  1.0.1
 
 
   maven-project-info-reports-plugin




svn commit: r763202 - in /maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo: FoConfiguration.java FoSink.java

2009-04-08 Thread ltheussl
Author: ltheussl
Date: Wed Apr  8 12:12:36 2009
New Revision: 763202

URL: http://svn.apache.org/viewvc?rev=763202&view=rev
Log:
[DOXIA-305] make layout properties configurable

Modified:

maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java

maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java

Modified: 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.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/FoConfiguration.java?rev=763202&r1=763201&r2=763202&view=diff
==
--- 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java
 Wed Apr  8 12:12:36 2009
@@ -20,7 +20,6 @@
  */
 
 import java.io.File;
-import java.io.FileReader;
 import java.io.IOException;
 import java.util.List;
 
@@ -60,18 +59,7 @@
 // necessary because some attributes contain commas:
 config.setDelimiterParsingDisabled( true );
 
-try
-{
-config.load( getClass().getResourceAsStream( "/fo-styles.xslt" ) );
-}
-catch ( ConfigurationException cex )
-{
-// this should not happen
-throw new RuntimeException( cex );
-}
-
-this.sets = config.getList( "xsl:attribute-s...@name]" );
-reset();
+loadDefaultConfig();
 }
 
 /**
@@ -87,20 +75,20 @@
 public void load( File configFile )
 throws IOException
 {
-// this overloads default values with custom config
+config.clear();
+
 try
 {
-config.load( new FileReader( configFile ) );
+config.load( configFile );
 }
 catch ( ConfigurationException cex )
 {
 IOException ioe = new IOException();
 ioe.initCause( cex );
-throw  ioe;
+throw ioe;
 }
 
-this.sets = config.getList( "xsl:attribute-s...@name]" );
-reset();
+loadDefaultConfig(); // this adds default values that are missing from 
above
 }
 
 /**
@@ -168,10 +156,12 @@
 String keybase = "xsl:attribute-set(" + String.valueOf( index ) + ")";
 
 Object prop = config.getProperty( keybase + ".xsl:attribute" );
+
 if ( prop instanceof List )
 {
 List values = (List) prop;
 List keys = config.getList( keybase + ".xsl:attribu...@name]" );
+
 for ( int i = 0; i < values.size(); i++ )
 {
 attributeSet.addAttribute( keys.get( i ), values.get( i ) );
@@ -185,12 +175,30 @@
 }
 
 String extend = config.getString( keybase + "[...@use-attribute-sets]" 
);
+
 if ( extend != null )
 {
 addAttributes( extend );
 }
 }
 
+/** Load the default fo configuration file. */
+private void loadDefaultConfig()
+{
+try
+{
+config.load( getClass().getResourceAsStream( "/fo-styles.xslt" ) );
+}
+catch ( ConfigurationException cex )
+{
+// this should not happen
+throw new RuntimeException( cex );
+}
+
+this.sets = config.getList( "xsl:attribute-s...@name]" );
+reset();
+}
+
 /**
  * (Re-)initialize the AttributeSet.
  */

Modified: 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.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/FoSink.java?rev=763202&r1=763201&r2=763202&view=diff
==
--- 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
 Wed Apr  8 12:12:36 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import java.io.File;
 import java.io.IOException;
 import java.io.StringWriter;
 import java.io.Writer;
@@ -140,6 +141,22 @@
 
 // TODO add FOP compliance mode?
 
+/**
+ * Load configuration parameters from a File.
+ *
+ * @param configFile the configuration file.
+ *
+ * @throws java.io.IOException if the File cannot be read
+ *  or some error occurs when initializing the configuration parameters.
+ *
+ * @since 1.1.1
+ */
+public void load( File configFile )
+  

svn commit: r763203 - /maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java

2009-04-08 Thread ltheussl
Author: ltheussl
Date: Wed Apr  8 12:15:00 2009
New Revision: 763203

URL: http://svn.apache.org/viewvc?rev=763203&view=rev
Log:
Override default layout properties if a custom config file is found (DOXIA-305)

Modified:

maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java

Modified: 
maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java?rev=763203&r1=763202&r2=763203&view=diff
==
--- 
maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java
 (original)
+++ 
maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java
 Wed Apr  8 12:15:00 2009
@@ -93,10 +93,7 @@
 
 if ( outputName == null )
 {
-if ( getLogger().isInfoEnabled() )
-{
-getLogger().info( "No outputName is defined in the document 
descriptor. Using 'target.pdf'" );
-}
+getLogger().info( "No outputName is defined in the document 
descriptor. Using 'target.pdf'" );
 
 documentModel.setOutputName( "target" );
 }
@@ -121,6 +118,9 @@
 pdfOutputFile.getParentFile().mkdirs();
 }
 
+// copy resources, images, etc.
+copyResources( outputDirectory );
+
 Writer writer = null;
 try
 {
@@ -128,6 +128,14 @@
 
 FoAggregateSink sink = new FoAggregateSink( writer );
 
+File fOConfigFile = new File( outputDirectory, "pdf-config.xml" );
+
+if ( fOConfigFile.exists() )
+{
+sink.load( fOConfigFile );
+getLogger().debug( "Loaded pdf config file: " + 
fOConfigFile.getAbsolutePath() );
+}
+
 sink.setDocumentModel( documentModel  );
 
 sink.beginDocument();
@@ -138,10 +146,7 @@
 
 if ( ( documentModel.getToc() == null ) || ( 
documentModel.getToc().getItems() == null ) )
 {
-if ( getLogger().isInfoEnabled() )
-{
-getLogger().info( "No TOC is defined in the document 
descriptor. Merging all documents." );
-}
+getLogger().info( "No TOC is defined in the document 
descriptor. Merging all documents." );
 
 for ( Iterator j = filesToProcess.keySet().iterator(); 
j.hasNext(); )
 {
@@ -223,9 +228,6 @@
 IOUtil.close( writer );
 }
 
-// copy resources, images, etc.
-copyResources( outputDirectory );
-
 generatePdf( outputFOFile, pdfOutputFile );
 }