svn commit: r772215 - in /maven/doxia/doxia/trunk/doxia-core/src: main/mdo/document.mdo test/java/org/apache/maven/doxia/document/DocumentModelTest.java
Author: ltheussl Date: Wed May 6 13:13:46 2009 New Revision: 772215 URL: http://svn.apache.org/viewvc?rev=772215&view=rev Log: Simplify DocumentCover, date and author are just Strings. We need to oublish a new xsd. Modified: maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java Modified: maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo?rev=772215&r1=772214&r2=772215&view=diff == --- maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo (original) +++ maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo Wed May 6 13:13:46 2009 @@ -27,7 +27,7 @@ This is a reference for the Document model used in Doxia. An XSD is available at: - http://maven.apache.org/doxia/xsd/document-1.0.0.xsd";>http://maven.apache.org/doxia/xsd/document-1.0.0.xsd. + http://maven.apache.org/doxia/xsd/document-1.0.1.xsd";>http://maven.apache.org/doxia/xsd/document-1.0.1.xsd. ]]> @@ -354,7 +354,7 @@ DocumentAuthor - An author the document. + An author of the document. 1.0.0 @@ -764,19 +764,16 @@ The date to appear on the cover. ]]> 1.0.0 - Date + String true - authors - 1.0.0 + author - -DocumentAuthor -* - + 1.0.0 + String true Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java?rev=772215&r1=772214&r2=772215&view=diff == --- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java (original) +++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java Wed May 6 13:13:46 2009 @@ -129,10 +129,10 @@ private DocumentCover getDocumentCover() { DocumentCover cover = new DocumentCover(); -cover.addAuthor( getAuthor( 1 ) ); +cover.setAuthor( "Author" ); cover.setCompanyLogo( "companyLogo" ); cover.setCompanyName( "companyName" ); -cover.setCoverDate( new Date( 0L ) ); +cover.setCoverDate( "coverDate" ); cover.setCoverSubTitle( "coverSubTitle" ); cover.setCoverTitle( "coverTitle" ); cover.setCoverType( "coverType" ); @@ -145,12 +145,10 @@ private void verifyDocumentCover( DocumentCover cover ) { -List authors = cover.getAuthors(); -assertEquals( 1, authors.size() ); -verifyAuthor( (DocumentAuthor) authors.get( 0 ), 1 ); +assertEquals( "Author", cover.getAuthor() ); assertEquals( "companyLogo", cover.getCompanyLogo() ); assertEquals( "companyName", cover.getCompanyName() ); -assertEquals( 0L, cover.getCoverDate().getTime() ); +assertEquals( "coverDate", cover.getCoverDate() ); assertEquals( "coverSubTitle", cover.getCoverSubTitle() ); assertEquals( "coverTitle", cover.getCoverTitle() ); assertEquals( "coverType", cover.getCoverType() );
svn commit: r772219 - /maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
Author: ltheussl Date: Wed May 6 13:14:30 2009 New Revision: 772219 URL: http://svn.apache.org/viewvc?rev=772219&view=rev Log: Construct cover page from DocumentModel. 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=772219&r1=772218&r2=772219&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 Wed May 6 13:14:30 2009 @@ -27,10 +27,12 @@ import javax.swing.text.MutableAttributeSet; import javax.swing.text.html.HTML.Tag; +import org.apache.maven.doxia.document.DocumentCover; import org.apache.maven.doxia.document.DocumentMeta; import org.apache.maven.doxia.document.DocumentModel; import org.apache.maven.doxia.document.DocumentTOC; import org.apache.maven.doxia.document.DocumentTOCItem; +import org.apache.maven.doxia.sink.SinkEventAttributeSet; import org.apache.maven.doxia.sink.SinkEventAttributes; import org.apache.maven.doxia.util.DoxiaUtils; import org.apache.maven.doxia.util.HtmlTools; @@ -778,22 +780,51 @@ return; } +DocumentCover cover = docModel.getCover(); DocumentMeta meta = docModel.getMeta(); -if ( meta == null ) +if ( cover == null && meta == null ) { -return; +return; // no information for cover page: ignore } -String title = meta.getTitle(); -String author = meta.getAuthor(); +String title = null; +String subtitle = null; +String version = null; +String type = null; +String date = null; +// TODO: implement +//String author = null; +//String projName = null; +String projLogo = null; +String compName = null; +String compLogo = null; + +if ( cover == null ) +{ +// aleady checked that meta != null +title = meta.getTitle(); +compName = meta.getAuthor(); +} +else +{ +title = cover.getCoverTitle(); +subtitle = cover.getCoverSubTitle(); +version = cover.getCoverVersion(); +type = cover.getCoverType(); +date = cover.getCoverDate(); +//author = cover.getAuthor(); +//projName = cover.getProjectName(); +projLogo = cover.getProjectLogo(); +compName = cover.getCompanyName(); +compLogo = cover.getCompanyLogo(); +} // TODO: remove hard-coded settings writeStartTag( PAGE_SEQUENCE_TAG, "master-reference", "cover-page" ); writeStartTag( FLOW_TAG, "flow-name", "xsl-region-body" ); writeStartTag( BLOCK_TAG, "text-align", "center" ); -//writeStartTag( TABLE_TAG, "table-layout", "fixed" ); writeln( "" ); writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "3.125in" ); writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "3.125in" ); @@ -801,11 +832,37 @@ writeStartTag( TABLE_ROW_TAG, "height", "1.5in" ); writeStartTag( TABLE_CELL_TAG, "" ); -// TODO: companyLogo + +if ( compLogo != null ) +{ +SinkEventAttributeSet atts = new SinkEventAttributeSet(); +atts.addAttribute( "text-align", "left" ); +atts.addAttribute( "vertical-align", "top" ); +writeStartTag( BLOCK_TAG, atts ); + +atts = new SinkEventAttributeSet(); +atts.addAttribute( SinkEventAttributes.HEIGHT, "1.5in" ); +figureGraphics( compLogo, atts ); +writeEndTag( BLOCK_TAG ); +} + writeEmptyTag( BLOCK_TAG, "" ); writeEndTag( TABLE_CELL_TAG ); writeStartTag( TABLE_CELL_TAG, "" ); -// TODO: projectLogo + +if ( projLogo != null ) +{ +SinkEventAttributeSet atts = new SinkEventAttributeSet(); +atts.addAttribute( "text-align", "right" ); +atts.addAttribute( "vertical-align", "top" ); +writeStartTag( BLOCK_TAG, atts ); + +atts = new SinkEventAttributeSet(); +atts.addAttribute( SinkEventAttributes.HEIGHT, "1.5in" ); +figureGraphics( projLogo, atts ); +writeEndTag( BLOCK_TAG ); +} + writeEmptyTag( BLOCK_TAG, "" ); writeEndTag( TABLE_CELL_TAG ); writeEndTag( TABLE_ROW_TAG ); @@ -820,7 +877,
svn commit: r772262 - /maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo
Author: ltheussl Date: Wed May 6 13:48:44 2009 New Revision: 772262 URL: http://svn.apache.org/viewvc?rev=772262&view=rev Log: Correct link Modified: maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo Modified: maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo?rev=772262&r1=772261&r2=772262&view=diff == --- maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo (original) +++ maven/doxia/doxia/trunk/doxia-core/src/main/mdo/document.mdo Wed May 6 13:48:44 2009 @@ -27,7 +27,7 @@ This is a reference for the Document model used in Doxia. An XSD is available at: - http://maven.apache.org/doxia/xsd/document-1.0.1.xsd";>http://maven.apache.org/doxia/xsd/document-1.0.1.xsd. + http://maven.apache.org/xsd/document-1.0.1.xsd";>http://maven.apache.org/xsd/document-1.0.1.xsd. ]]>
svn commit: r772430 - /maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
Author: ltheussl Date: Wed May 6 21:18:10 2009 New Revision: 772430 URL: http://svn.apache.org/viewvc?rev=772430&view=rev Log: Additional warning for ambiguous links (MPDF-11) Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java?rev=772430&r1=772429&r2=772430&view=diff == --- maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java (original) +++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java Wed May 6 21:18:10 2009 @@ -449,9 +449,15 @@ { String hash = linkAnchor.substring( hashIndex + 1 ); +if ( hash.endsWith( ".html" ) && !hash.startsWith( "./" ) ) +{ +getLog().warn( "[Apt Parser] Ambiguous link: '" + hash ++ "'. If this is a local link, prepend \"./\"!" ); +} + if ( !DoxiaUtils.isValidId( hash ) ) { -getLog().warn( "Modified invalid link: " + hash ); +getLog().warn( "[Apt Parser] Modified invalid link: " + hash ); linkAnchor = linkAnchor.substring( 0, hashIndex ) + "#" + DoxiaUtils.encodeId( hash, true );