You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2020/01/23 08:14:10 UTC
[maven-doxia-book-renderer] branch master created (now 33e41cf)
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git.
at 33e41cf [INFRA-16467] move components documentation out of CMS space
This branch includes the following new commits:
new 534db7d Move book and plugin since they don't belong in the base of Doxia, and rename them in the process.
new e0e0536 Post-move clean-up: - Fix relative paths to parent, keeping the doxia-parent for now - Change artifactsIds, names and descriptions - Add/remove modules
new 84ece3d Switch over to use doxia-tools as parent. This should probably be changed to maven-parent later on.
new b92120a updated site urls to let automatic extrapolation from parent
new a95faf7 The default locale (en) should not be included in the list of locales for the l10n-maven-plugin.
new efe13fa Tweak the site.
new 6b4d098 Use released version of Doxia.
new b4c9515 Stop using deprecated syntax for Surefire plugin.
new 8cab892 Fix Javadoc error.
new 71581d5 Use a proper name.
new cdd904e generics
new 11e7afd [DOXIATOOLS-37] use plexus java 5 annotations instead of old-style javadoc annotations
new 0d184ed Change the POM hierarchy to match those used for maven-plugins and maven-shared. Such a layout is suitable when the modules have different release cycles, like they do here. The parent for doxia-tools is now at the same level as the modules, instead of one level above. At the top level is now an aggregator POM that can be used for CI servers.
new 31e284c Fix SCM URLs.
new f9c1b2a Add more specific issueManagement/urls.
new be9ae05 Use latest decoration schema. Synchronize the menus so they look the same.
new e73a684 Update to released version of doxia-tools parent.
new edae5a4 Add unique version numbers to the modules, which were lost when I set up the possibility to release the modules individually.
new cd1f9b2 align projects names
new 26ebf07 [MNG-152] add license and download links
new d5426e4 prepared site publication
new d381482 configured license check
new d50c7f7 moved Jira from Codehaus to Apache
new 396b006 updated parent pom (and fixed issues reported by Checkstyle)
new c00813a [MPOM-95] updated relative path to parent pom after move
new ea0a8c2 updated parent version
new 13cdd34 updated parent pom to last release
new 82a978f Jira moved from Codehaus to Apache
new a3a31dd rat is already run on each build since maven-parent 25: now configuration enhancements are to be put in pluginManagement
new 6e292e3 Upgrade parent of tools to org.apache.maven.doxia:doxia-tools:30
new 14f24c6 put "Doxia Tools" in artifact names instead of simply "Doxia"
new 4060ca7 improve java 9 build
new c8f35d9 publish to components instead of content
new 33e41cf [INFRA-16467] move components documentation out of CMS space
The 34 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[maven-doxia-book-renderer] 21/34: prepared site publication
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit d5426e481a205617c820c89093630086603f6a0b
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Mon Jun 30 19:13:49 2014 +0000
prepared site publication
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1606884 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pom.xml b/pom.xml
index f0a19ea..acf18d1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,6 +44,12 @@ under the License.
<system>jira</system>
<url>http://jira.codehaus.org/browse/DOXIATOOLS/component/15478</url>
</issueManagement>
+ <distributionManagement>
+ <site>
+ <id>apache.website</id>
+ <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven-doxia/content/${maven.site.path}</url>
+ </site>
+ </distributionManagement>
<properties>
<doxiaVersion>1.3</doxiaVersion>
[maven-doxia-book-renderer] 16/34: Use latest decoration schema.
Synchronize the menus so they look the same.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit be9ae05e4e2ce8b9c3fef8e4773e63e4bef8f7a6
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Sun Sep 23 13:14:33 2012 +0000
Use latest decoration schema.
Synchronize the menus so they look the same.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1389045 13f79535-47bb-0310-9956-ffa450edef68
---
src/site/site.xml | 49 ++++++++++++++++++++-----------------------------
1 file changed, 20 insertions(+), 29 deletions(-)
diff --git a/src/site/site.xml b/src/site/site.xml
index 2f40985..3292a07 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -1,33 +1,26 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-/*
- * 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.
- */
- -->
-
-<project xmlns="http://maven.apache.org/DECORATION/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd">
-
+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.
+-->
+
+<project xmlns="http://maven.apache.org/DECORATION/1.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 http://maven.apache.org/xsd/decoration-1.3.0.xsd">
<body>
-
- <menu ref="parent"/>
-
<menu name="Overview">
<item name="Introduction" href="index.html"/>
<item name="Usage" href="usage.html"/>
@@ -42,7 +35,5 @@
</menu>
<menu ref="reports"/>
-
</body>
-
</project>
[maven-doxia-book-renderer] 01/34: Move book and plugin since they
don't belong in the base of Doxia, and rename them in the process.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 534db7d2aee83a09c56867d323700a036681afc6
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Sat Mar 31 16:42:15 2012 +0000
Move book and plugin since they don't belong in the base of Doxia, and rename them in the process.
doxia/doxia-book --> doxia-tools/doxia-book-renderer
doxia/doxia-maven-plugin -> doxia/doxia-book-maven-plugin
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1307847 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 165 +++++++
.../org/apache/maven/doxia/book/BookDoxia.java | 79 +++
.../maven/doxia/book/BookDoxiaException.java | 55 +++
.../apache/maven/doxia/book/DefaultBookDoxia.java | 155 ++++++
.../doxia/book/InvalidBookDescriptorException.java | 61 +++
.../maven/doxia/book/context/BookContext.java | 258 ++++++++++
.../apache/maven/doxia/book/context/BookIndex.java | 40 ++
.../doxia/book/services/indexer/BookIndexer.java | 46 ++
.../book/services/indexer/DefaultBookIndexer.java | 147 ++++++
.../maven/doxia/book/services/io/BookIo.java | 57 +++
.../doxia/book/services/io/DefaultBookIo.java | 144 ++++++
.../renderer/AbstractITextBookRenderer.java | 338 +++++++++++++
.../doxia/book/services/renderer/BookRenderer.java | 44 ++
.../services/renderer/DocbookBookRenderer.java | 223 +++++++++
.../book/services/renderer/LatexBookRenderer.java | 246 ++++++++++
.../book/services/renderer/PdfBookRenderer.java | 52 ++
.../book/services/renderer/RtfBookRenderer.java | 52 ++
.../book/services/renderer/XHtmlBookRenderer.java | 208 ++++++++
.../book/services/renderer/XdocBookRenderer.java | 445 +++++++++++++++++
.../services/renderer/docbook/DocBookBookSink.java | 270 +++++++++++
.../services/renderer/latex/LatexBookSink.java | 124 +++++
.../renderer/xdoc/AbstractXdocBookSink.java | 126 +++++
.../renderer/xdoc/ChapterXdocBookSink.java | 151 ++++++
.../services/renderer/xdoc/IndexXdocBookSink.java | 84 ++++
.../renderer/xdoc/SectionXdocBookSink.java | 166 +++++++
.../services/renderer/xhtml/XhtmlBookSink.java | 248 ++++++++++
.../book/services/validation/BookValidator.java | 42 ++
.../services/validation/DefaultBookValidator.java | 104 ++++
.../book/services/validation/ValidationResult.java | 78 +++
src/main/modello/book.mdo | 537 +++++++++++++++++++++
src/main/resources/book-renderer.properties | 21 +
src/main/resources/book-renderer_en.properties | 23 +
src/main/resources/book-renderer_fr.properties | 21 +
src/site/apt/index.apt | 20 +
src/site/apt/usage.apt | 31 ++
src/site/apt/using-book-xsd.apt | 41 ++
src/site/site.xml | 48 ++
.../apache/maven/doxia/book/BookRendererTest.java | 75 +++
.../book/services/indexer/BookIndexerTest.java | 118 +++++
.../renderer/docbook/DocBookBookSinkTest.java | 490 +++++++++++++++++++
src/test/resources/book-1.xml | 51 ++
src/test/resources/book-1/section-1.apt | 61 +++
src/test/resources/book-1/section-2.apt | 16 +
src/test/resources/book-1/section-3.apt | 17 +
src/test/resources/book-1/section-4.apt | 16 +
.../expected/doc-book/plexus-user-guide.xml | 124 +++++
46 files changed, 5918 insertions(+)
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..cc90293
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia</artifactId>
+ <version>1.3-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>doxia-book</artifactId>
+ <name>Doxia :: Book Component</name>
+ <description>A component to write books like user manuals and guides in any format supported by Doxia.</description>
+ <url>http://maven.apache.org/doxia/doxia/doxia-book/</url>
+
+ <dependencies>
+ <!-- doxia core -->
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-sink-api</artifactId>
+ </dependency>
+
+ <!-- doxia modules ordered -->
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-apt</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-docbook-simple</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-itext</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-latex</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-xdoc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-xhtml</artifactId>
+ </dependency>
+
+ <!-- plexus -->
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-i18n</artifactId>
+ <version>1.0-beta-6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </dependency>
+
+ <!-- test -->
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.modello</groupId>
+ <artifactId>modello-maven-plugin</artifactId>
+ <configuration>
+ <models>
+ <model>src/main/modello/book.mdo</model>
+ </models>
+ <version>1.0.0</version>
+ </configuration>
+ <executions>
+ <execution>
+ <id>site-docs</id>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>xdoc</goal>
+ <goal>xsd</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>descriptor</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>java</goal>
+ <goal>xpp3-reader</goal>
+ <goal>xsd</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- To be sure that JVM will implement AWT in software -->
+ <systemProperties>
+ <property>
+ <name>java.awt.headless</name>
+ <value>true</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>reporting</id>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>l10n-maven-plugin</artifactId>
+ <version>1.0-alpha-2</version>
+ <configuration>
+ <locales>
+ <locale>en</locale>
+ <locale>fr</locale>
+ </locales>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/doxia/book/BookDoxia.java b/src/main/java/org/apache/maven/doxia/book/BookDoxia.java
new file mode 100644
index 0000000..3d4ef96
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/BookDoxia.java
@@ -0,0 +1,79 @@
+package org.apache.maven.doxia.book;
+
+/*
+ * 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 org.apache.maven.doxia.book.model.BookModel;
+
+import java.io.File;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * An interface to create books in different output formats from a book descriptor.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public interface BookDoxia
+{
+ /** The plexus lookup role. */
+ String ROLE = BookDoxia.class.getName();
+
+ /**
+ * Load a BookModel from a descriptor file.
+ *
+ * @param bookDescriptor the book descriptor file.
+ * @return BookModel
+ * @throws org.apache.maven.doxia.book.BookDoxiaException if the model cannot be loaded.
+ */
+ BookModel loadBook( File bookDescriptor )
+ throws BookDoxiaException;
+
+ /**
+ * Creates a book from a BookModel using the {@link Locale#getDefault()} and UTF-8 as default encoding.
+ *
+ * @param book the BookModel.
+ * @param bookRendererId the id of the output format.
+ * @param files a list of source files.
+ * @param outputDirectory the output directory.
+ * @throws org.apache.maven.doxia.book.BookDoxiaException if the model cannot be loaded.
+ * @see #renderBook(BookModel, String, List, File, Locale, String, String)
+ * @see Locale#getDefault()
+ */
+ void renderBook( BookModel book, String bookRendererId, List<File> files, File outputDirectory )
+ throws BookDoxiaException;
+
+ /**
+ * Creates a book from a BookModel.
+ *
+ * @param book the BookModel.
+ * @param bookRendererId the id of the output format.
+ * @param files a list of source files.
+ * @param outputDirectory the output directory.
+ * @param locale the wanted locale.
+ * @param inputEncoding the input encoding when processing <code>files</code>.
+ * @param outputEncoding the output encoding when writing files in <code>ouputDirectory</code>.
+ * @throws org.apache.maven.doxia.book.BookDoxiaException if the model cannot be loaded.
+ * @since 1.1
+ */
+ void renderBook( BookModel book, String bookRendererId, List<File> files, File outputDirectory, Locale locale,
+ String inputEncoding, String outputEncoding )
+ throws BookDoxiaException;
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/BookDoxiaException.java b/src/main/java/org/apache/maven/doxia/book/BookDoxiaException.java
new file mode 100644
index 0000000..db02e25
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/BookDoxiaException.java
@@ -0,0 +1,55 @@
+package org.apache.maven.doxia.book;
+
+/*
+ * 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.
+ */
+
+/**
+ * Wraps an exception when rendering books.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class BookDoxiaException
+ extends Exception
+{
+ /** serialVersionUID */
+ private static final long serialVersionUID = 87146681585045106L;
+
+ /**
+ * Construct a new BookDoxiaException with the specified detail message.
+ *
+ * @param message The detailed message. This can later be retrieved by the Throwable.getMessage() method.
+ */
+ public BookDoxiaException( String message )
+ {
+ super( message );
+ }
+
+ /**
+ * Construct a new BookDoxiaException with the specified detail message and cause.
+ *
+ * @param message The detailed message. This can later be retrieved by the Throwable.getMessage() method.
+ * @param cause the cause. This can be retrieved later by the Throwable.getCause() method
+ * (a null value is permitted, and indicates that the cause is nonexistent or unknown).
+ */
+ public BookDoxiaException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java b/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java
new file mode 100644
index 0000000..02fb421
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java
@@ -0,0 +1,155 @@
+package org.apache.maven.doxia.book;
+
+/*
+ * 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 org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.services.indexer.BookIndexer;
+import org.apache.maven.doxia.book.services.io.BookIo;
+import org.apache.maven.doxia.book.services.renderer.BookRenderer;
+import org.apache.maven.doxia.book.services.validation.BookValidator;
+import org.apache.maven.doxia.book.services.validation.ValidationResult;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Default implementation of BookDoxia.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ * @plexus.component
+ */
+public class DefaultBookDoxia
+ extends AbstractLogEnabled
+ implements BookDoxia
+{
+ /**
+ * @plexus.requirement
+ */
+ private BookIo bookIo;
+
+ /**
+ * @plexus.requirement
+ */
+ private BookValidator bookValidator;
+
+ /**
+ * @plexus.requirement
+ */
+ private BookIndexer bookIndexer;
+
+ /**
+ * @plexus.requirement role="org.apache.maven.doxia.book.services.renderer.BookRenderer"
+ */
+ private Map<String, BookRenderer> bookRenderers;
+
+ // ----------------------------------------------------------------------
+ // BookDoxia Implementation
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public BookModel loadBook( File bookDescriptor )
+ throws BookDoxiaException
+ {
+ return bookIo.readBook( bookDescriptor );
+ }
+
+ /** {@inheritDoc} */
+ public void renderBook( BookModel book, String bookRendererId, List<File> files, File outputDirectory )
+ throws BookDoxiaException
+ {
+ renderBook( book, bookRendererId, files, outputDirectory, Locale.getDefault(), "UTF-8", "UTF-8" );
+ }
+
+ /** {@inheritDoc} */
+ public void renderBook( BookModel book, String bookRendererId, List<File> files, File outputDirectory,
+ Locale locale, String inputEncoding, String outputEncoding )
+ throws BookDoxiaException
+ {
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ ValidationResult validationResult = bookValidator.validateBook( book );
+
+ if ( !validationResult.isAllOk() )
+ {
+ throw new InvalidBookDescriptorException( validationResult );
+ }
+
+ // ----------------------------------------------------------------------
+ // Create and initialize the context
+ // ----------------------------------------------------------------------
+
+ BookContext context = new BookContext();
+
+ context.setBook( book );
+
+ context.setOutputDirectory( outputDirectory );
+
+ context.setLocale( locale );
+
+ context.setInputEncoding( inputEncoding );
+
+ context.setOutputEncoding( outputEncoding );
+
+ // -----------------------------------------------------------------------
+ //
+ // -----------------------------------------------------------------------
+
+ bookIo.loadFiles( context, files );
+
+ // ----------------------------------------------------------------------
+ // Generate indexes
+ // ----------------------------------------------------------------------
+
+ bookIndexer.indexBook( book, context );
+
+ // ----------------------------------------------------------------------
+ // Render the book
+ // ----------------------------------------------------------------------
+
+ BookRenderer bookRenderer = bookRenderers.get( bookRendererId );
+
+ if ( bookRenderer == null )
+ {
+ throw new BookDoxiaException( "No such book renderer '" + bookRendererId + "'." );
+ }
+
+ bookRenderer.renderBook( context );
+ }
+
+ /**
+ * Returns a Set of ids of the BookRenderers that are available in this BookDoxia.
+ *
+ * @return Set
+ */
+ public Set<String> getAvailableBookRenderers()
+ {
+ return Collections.unmodifiableSet( bookRenderers.keySet() );
+ }
+
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/InvalidBookDescriptorException.java b/src/main/java/org/apache/maven/doxia/book/InvalidBookDescriptorException.java
new file mode 100644
index 0000000..efc9c80
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/InvalidBookDescriptorException.java
@@ -0,0 +1,61 @@
+package org.apache.maven.doxia.book;
+
+/*
+ * 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 org.apache.maven.doxia.book.services.validation.ValidationResult;
+
+/**
+ * Indicates that the book descriptor file could not be parsed correctly.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class InvalidBookDescriptorException
+ extends BookDoxiaException
+{
+
+ /** serialVersionUID */
+ private static final long serialVersionUID = -5706648416915909753L;
+
+ /** ValidationResult. */
+ private ValidationResult validationResult;
+
+ /**
+ * Construct a new InvalidBookDescriptorException and stores the given ValidationResult.
+ *
+ * @param validationResult The ValidationResult to store.
+ */
+ public InvalidBookDescriptorException( ValidationResult validationResult )
+ {
+ super( "Invalid book descriptor." );
+
+ this.validationResult = validationResult;
+ }
+
+ /**
+ * Return the ValidationResult.
+ *
+ * @return the ValidationResult associated with this Exception.
+ */
+ public ValidationResult getValidationResult()
+ {
+ return validationResult;
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/context/BookContext.java b/src/main/java/org/apache/maven/doxia/book/context/BookContext.java
new file mode 100644
index 0000000..3e78b19
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/context/BookContext.java
@@ -0,0 +1,258 @@
+package org.apache.maven.doxia.book.context;
+
+/*
+ * 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 org.apache.maven.doxia.book.model.BookModel;
+
+import java.io.File;
+import java.util.Locale;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * Context to render a book.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class BookContext
+{
+ /** The BookModel of this context. */
+ private BookModel book;
+
+ /** The files. */
+ private Map<String, BookContext.BookFile> files;
+
+ /** The output directory. */
+ private File outputDirectory;
+
+ /** The BookIndex of this context. */
+ private BookIndex index;
+
+ /** The Locale used to generate the navigation. */
+ private Locale locale;
+
+ /** The input encoding used to read Doxia file. */
+ private String inputEncoding;
+
+ /** The output encoding used to write the renderer files. */
+ private String outputEncoding;
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ /** Represents a BookFile. */
+ public static class BookFile
+ {
+ /** The file. */
+ private File file;
+
+ /** The id of the parser. */
+ private String parserId;
+
+ /**
+ * Constructor.
+ *
+ * @param file the file.
+ * @param parserId the parser id.
+ */
+ public BookFile( File file, String parserId )
+ {
+ this.file = file;
+ this.parserId = parserId;
+ }
+
+ /**
+ * Return the file of this BookFile.
+ *
+ * @return File.
+ */
+ public File getFile()
+ {
+ return file;
+ }
+
+ /**
+ * Return the parserId of this BookFile.
+ *
+ * @return String.
+ */
+ public String getParserId()
+ {
+ return parserId;
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ // Accessors
+ // ----------------------------------------------------------------------
+
+ /**
+ * Return the BookModel of this BookContext.
+ *
+ * @return BookModel.
+ */
+ public BookModel getBook()
+ {
+ return book;
+ }
+
+ /**
+ * Set the BookModel of this BookContext.
+ *
+ * @param book the BookModel.
+ */
+ public void setBook( BookModel book )
+ {
+ this.book = book;
+ }
+
+ /**
+ * Return the files of this BookContext.
+ *
+ * @return Map. A new HashMap is constructed if the current Map is null.
+ */
+ public Map<String, BookContext.BookFile> getFiles()
+ {
+ if ( files == null )
+ {
+ files = new HashMap<String, BookContext.BookFile>();
+ }
+
+ return files;
+ }
+
+ /**
+ * Set the files of this BookContext.
+ *
+ * @param files the Map of files.
+ */
+ public void setFiles( Map<String, BookContext.BookFile> files )
+ {
+ this.files = files;
+ }
+
+ /**
+ * Return the outputDirectory of this BookContext.
+ *
+ * @return File.
+ */
+ public File getOutputDirectory()
+ {
+ return outputDirectory;
+ }
+
+ /**
+ * Set the outputDirectory of this BookContext.
+ *
+ * @param outputDirectory the output directory.
+ */
+ public void setOutputDirectory( File outputDirectory )
+ {
+ this.outputDirectory = outputDirectory;
+ }
+
+ /**
+ * Return the index of this BookContext.
+ *
+ * @return BookIndex.
+ */
+ public BookIndex getIndex()
+ {
+ return index;
+ }
+
+ /**
+ * Set the index of this BookContext.
+ *
+ * @param index the index to set.
+ */
+ public void setIndex( BookIndex index )
+ {
+ this.index = index;
+ }
+
+ /**
+ * <p>Getter for the field <code>locale</code>.</p>
+ *
+ * @return the locale
+ * @since 1.1
+ */
+ public Locale getLocale()
+ {
+ return locale;
+ }
+
+ /**
+ * <p>Setter for the field <code>locale</code>.</p>
+ *
+ * @param locale the locale to set
+ * @since 1.1
+ */
+ public void setLocale( Locale locale )
+ {
+ this.locale = locale;
+ }
+
+ /**
+ * <p>Getter for the field <code>inputEncoding</code>.</p>
+ *
+ * @return the inputEncoding
+ * @since 1.1
+ */
+ public String getInputEncoding()
+ {
+ return inputEncoding;
+ }
+
+ /**
+ * <p>Setter for the field <code>inputEncoding</code>.</p>
+ *
+ * @param inputEncoding the inputEncoding to set
+ * @since 1.1
+ */
+ public void setInputEncoding( String inputEncoding )
+ {
+ this.inputEncoding = inputEncoding;
+ }
+
+ /**
+ * <p>Getter for the field <code>outputEncoding</code>.</p>
+ *
+ * @return the outputEncoding
+ * @since 1.1
+ */
+ public String getOutputEncoding()
+ {
+ return outputEncoding;
+ }
+
+ /**
+ * <p>Setter for the field <code>outputEncoding</code>.</p>
+ *
+ * @param outputEncoding the outputEncoding to set
+ * @since 1.1
+ */
+ public void setOutputEncoding( String outputEncoding )
+ {
+ this.outputEncoding = outputEncoding;
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java b/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java
new file mode 100644
index 0000000..b1d9ca0
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/context/BookIndex.java
@@ -0,0 +1,40 @@
+package org.apache.maven.doxia.book.context;
+
+/*
+ * 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 org.apache.maven.doxia.index.IndexEntry;
+
+/**
+ * <p>BookIndex class.</p>
+ *
+ * @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class BookIndex
+ extends IndexEntry
+{
+ /**
+ * Constructs a new BookIndex.
+ */
+ public BookIndex()
+ {
+ super( "book" );
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/indexer/BookIndexer.java b/src/main/java/org/apache/maven/doxia/book/services/indexer/BookIndexer.java
new file mode 100644
index 0000000..61129fa
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/indexer/BookIndexer.java
@@ -0,0 +1,46 @@
+package org.apache.maven.doxia.book.services.indexer;
+
+/*
+ * 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 org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.book.BookDoxiaException;
+
+/**
+ * Index a book.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public interface BookIndexer
+{
+ /** The plexus lookup role. */
+ String ROLE = BookIndexer.class.getName();
+
+ /**
+ * Index a book.
+ *
+ * @param book the book to index.
+ * @param bookContext the BookContext.
+ * @throws org.apache.maven.doxia.book.BookDoxiaException if the book cannot be indexed.
+ */
+ void indexBook( BookModel book, BookContext bookContext )
+ throws BookDoxiaException;
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java b/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
new file mode 100644
index 0000000..420859b
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
@@ -0,0 +1,147 @@
+package org.apache.maven.doxia.book.services.indexer;
+
+/*
+ * 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.FileNotFoundException;
+import java.io.FileReader;
+
+import org.apache.maven.doxia.Doxia;
+import org.apache.maven.doxia.book.BookDoxiaException;
+import org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.book.context.BookIndex;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.model.Chapter;
+import org.apache.maven.doxia.book.model.Section;
+import org.apache.maven.doxia.index.IndexEntry;
+import org.apache.maven.doxia.index.IndexingSink;
+import org.apache.maven.doxia.parser.ParseException;
+import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+/**
+ * Default implementation of BookIndexer.
+ *
+ * @plexus.component
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class DefaultBookIndexer
+ extends AbstractLogEnabled
+ implements BookIndexer
+{
+ /**
+ * @plexus.requirement
+ */
+ private Doxia doxia;
+
+ // ----------------------------------------------------------------------
+ // BookIndexer Implementation
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public void indexBook( BookModel book, BookContext bookContext )
+ throws BookDoxiaException
+ {
+ BookIndex index = new BookIndex();
+
+ for ( Chapter chapter : book.getChapters() )
+ {
+ indexChapter( bookContext, index, chapter );
+ }
+
+ bookContext.setIndex( index );
+ }
+
+ // ----------------------------------------------------------------------
+ // Private
+ // ----------------------------------------------------------------------
+
+ /**
+ * Index a chapter.
+ *
+ * @param context the BookContext.
+ * @param bookEntry the IndexEntry.
+ * @param chapter the Chapter to index.
+ * @throws BookDoxiaException if the chapter cannot be indexed.
+ */
+ private void indexChapter( BookContext context, IndexEntry bookEntry, Chapter chapter )
+ throws BookDoxiaException
+ {
+ IndexEntry chapterEntry = new IndexEntry( bookEntry, chapter.getId( ) );
+
+ chapterEntry.setTitle( chapter.getTitle() );
+
+ for ( Section section : chapter.getSections() )
+ {
+ indexSection( context, chapterEntry, section );
+ }
+ }
+
+ /**
+ * Index a section.
+ *
+ * @param bookContext the BookContext.
+ * @param chapterEntry the IndexEntry.
+ * @param section the Section to index.
+ * @throws BookDoxiaException if the section cannot be indexed.
+ */
+ private void indexSection( BookContext bookContext, IndexEntry chapterEntry, Section section )
+ throws BookDoxiaException
+ {
+ BookContext.BookFile bookFile = (BookContext.BookFile) bookContext.getFiles().get( section.getId() );
+
+ if ( bookFile == null )
+ {
+ throw new BookDoxiaException( "No document that matches section with id="
+ + section.getId() + "." );
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ IndexEntry sectionEntry = new IndexEntry( chapterEntry, section.getId() );
+
+ IndexingSink sink = new IndexingSink( sectionEntry );
+
+ try
+ {
+ doxia.parse( new FileReader( bookFile.getFile() ), bookFile.getParserId(), sink );
+ }
+ catch ( ParserNotFoundException e )
+ {
+ throw new BookDoxiaException( "Parser not found: "
+ + bookFile.getParserId() + ".", e );
+ }
+ catch ( ParseException e )
+ {
+ throw new BookDoxiaException( "Error while parsing document: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+ catch ( FileNotFoundException e )
+ {
+ throw new BookDoxiaException( "Could not find document: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+
+ sectionEntry.setTitle( sink.getTitle() );
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java b/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java
new file mode 100644
index 0000000..517f7fd
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java
@@ -0,0 +1,57 @@
+package org.apache.maven.doxia.book.services.io;
+
+/*
+ * 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 org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.BookDoxiaException;
+import org.apache.maven.doxia.book.context.BookContext;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * Common book-related IO methods.
+ *
+ * @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public interface BookIo
+{
+ /** The plexus lookup role. */
+ String ROLE = BookIo.class.getName();
+
+ /**
+ * Read a BookModel from a descriptor file.
+ *
+ * @param bookDescriptor the book descriptor file.
+ * @return BookModel
+ * @throws org.apache.maven.doxia.book.BookDoxiaException if the model cannot be read.
+ */
+ BookModel readBook( File bookDescriptor )
+ throws BookDoxiaException;
+
+ /**
+ * Loads files in a given context.
+ *
+ * @param context the BookContext.
+ * @param files a list of files.
+ */
+ void loadFiles( BookContext context, List<File> files );
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java b/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java
new file mode 100644
index 0000000..9509d1d
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java
@@ -0,0 +1,144 @@
+package org.apache.maven.doxia.book.services.io;
+
+/*
+ * 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 org.apache.maven.doxia.book.model.io.xpp3.BookModelXpp3Reader;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.BookDoxiaException;
+import org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.module.site.SiteModule;
+import org.apache.maven.doxia.module.site.manager.SiteModuleManager;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import java.io.IOException;
+import java.io.File;
+import java.io.Reader;
+import java.util.Collection;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.List;
+
+/**
+ * <p>DefaultBookIo class.</p>
+ *
+ * @plexus.component
+ * @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class DefaultBookIo
+ extends AbstractLogEnabled
+ implements BookIo
+{
+ /**
+ * @plexus.requirement
+ */
+ private SiteModuleManager siteModuleManager;
+
+ // -----------------------------------------------------------------------
+ // DefaultBookIo Implementation
+ // -----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public BookModel readBook( File bookDescriptor )
+ throws BookDoxiaException
+ {
+ Reader reader = null;
+ try
+ {
+ reader = ReaderFactory.newXmlReader( bookDescriptor );
+ return new BookModelXpp3Reader().read( reader, true );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while reading book descriptor.", e );
+ }
+ catch ( XmlPullParserException e )
+ {
+ throw new BookDoxiaException( "Error while reading book descriptor.", e );
+ }
+ finally
+ {
+ IOUtil.close( reader );
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void loadFiles( BookContext context, List<File> files )
+ {
+ // ----------------------------------------------------------------------
+ // Find all the files, map the file names to ids
+ // ----------------------------------------------------------------------
+
+ Collection<SiteModule> siteModules = siteModuleManager.getSiteModules();
+
+ for ( SiteModule siteModule : siteModules )
+ {
+ String extension = siteModule.getExtension();
+
+ String sourceDirectory = File.separator + siteModule.getSourceDirectory() + File.separator;
+
+ String parserId = siteModule.getParserId();
+
+ for ( File file : files )
+ {
+ String name = file.getName();
+
+ String path = file.getAbsolutePath();
+
+ // first check if the file path contains one of the recognized source dir identifiers
+ // (there's trouble if a pathname contains 2 identifiers), then match file extensions (not unique).
+
+ if ( path.indexOf( sourceDirectory ) != -1 )
+ {
+ name = name.substring( 0, name.length() - extension.length() - 1 );
+
+ context.getFiles().put( name, new BookContext.BookFile( file, parserId ) );
+ }
+ else if ( name.endsWith( extension ) )
+ {
+ name = name.substring( 0, name.length() - extension.length() - 1 );
+
+ // don't overwrite if it's there already
+ if ( !context.getFiles().containsKey( name ) )
+ {
+ context.getFiles().put( name, new BookContext.BookFile( file, parserId ) );
+ }
+ }
+ }
+ }
+
+ if ( getLogger().isDebugEnabled() )
+ {
+ getLogger().debug( "Dumping document <-> id mapping:" );
+
+ Map<String, BookContext.BookFile> map = new TreeMap<String, BookContext.BookFile>( context.getFiles() );
+
+ for ( Map.Entry<String, BookContext.BookFile> entry : map.entrySet() )
+ {
+ BookContext.BookFile file = entry.getValue();
+
+ getLogger().debug( " " + entry.getKey() + "=" + file.getFile() + ", parser: " + file.getParserId() );
+ }
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java
new file mode 100644
index 0000000..78e18ff
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java
@@ -0,0 +1,338 @@
+package org.apache.maven.doxia.book.services.renderer;
+
+/*
+ * 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 java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+import java.text.DateFormat;
+import java.util.Date;
+
+import org.apache.maven.doxia.Doxia;
+import org.apache.maven.doxia.book.BookDoxiaException;
+import org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.model.Chapter;
+import org.apache.maven.doxia.book.model.Section;
+import org.apache.maven.doxia.module.itext.ITextSinkFactory;
+import org.apache.maven.doxia.parser.ParseException;
+import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
+import org.apache.maven.doxia.sink.Sink;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.WriterFactory;
+import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
+
+/**
+ * Base class for <code>iText</code> renderer.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public abstract class AbstractITextBookRenderer
+ extends AbstractLogEnabled
+ implements BookRenderer
+{
+ /**
+ * @plexus.requirement
+ */
+ private Doxia doxia;
+
+ // ----------------------------------------------------------------------
+ // BookRenderer Implementation
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public void renderBook( BookContext context )
+ throws BookDoxiaException
+ {
+ BookModel book = context.getBook();
+
+ if ( !context.getOutputDirectory().exists() )
+ {
+ if ( !context.getOutputDirectory().mkdirs() )
+ {
+ throw new BookDoxiaException( "Could not make directory: "
+ + context.getOutputDirectory().getAbsolutePath() + "." );
+ }
+ }
+
+ File bookFile = new File( context.getOutputDirectory(), book.getId() + ".xml" );
+
+ Writer fileWriter;
+ try
+ {
+ fileWriter = WriterFactory.newXmlWriter( bookFile );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while opening file.", e );
+ }
+
+ // ----------------------------------------------------------------------
+ // Create the XML File
+ // ----------------------------------------------------------------------
+
+ PrettyPrintXMLWriter writer = new PrettyPrintXMLWriter( fileWriter, "UTF-8", null );
+ writer.startElement( "itext" );
+ writer.addAttribute( "creationdate", DateFormat.getDateTimeInstance().format( new Date() ) );
+ writer.addAttribute( "producer", "Doxia iText" );
+
+ // writer.startElement( "paragraph" );
+ // writer.addAttribute( "leading", "18.0" );
+ // writer.addAttribute( "font", "unknown" );
+ // writer.addAttribute( "align", "Default" );
+ // writer.writeText( "Please visit my" + System.getProperty( "line.separator" ) );
+ //
+ // writer.startElement( "anchor" );
+ // writer.addAttribute( "leading", "18.0" );
+ // writer.addAttribute( "font", "Helvetica" );
+ // writer.addAttribute( "size", "12.0" );
+ // writer.addAttribute( "fontstyle", "normal, underline" );
+ // writer.addAttribute( "red", "0" );
+ // writer.addAttribute( "green", "0" );
+ // writer.addAttribute( "blue", "255" );
+ // writer.addAttribute( "name", "top" );
+ // writer.addAttribute( "reference", "http://www.lowagie.com/iText/" );
+ //
+ // writer.startElement( "chunk" );
+ // writer.addAttribute( "font", "Helvetica" );
+ // writer.addAttribute( "size", "12.0" );
+ // writer.addAttribute( "fontstyle", "normal, underline" );
+ // writer.addAttribute( "red", "0" );
+ // writer.addAttribute( "green", "0" );
+ // writer.addAttribute( "blue", "255" );
+ // writer.writeText( "website (external reference)" );
+ // writer.endElement();
+ //
+ // writer.endElement(); // anchor
+ //
+ // writer.endElement(); // paragraph
+
+ // TODO: Write out TOC
+
+ System.setProperty( "itext.basedir", bookFile.getParentFile().getAbsolutePath() );
+ Sink sink = new ITextSinkFactory().createSink( writer );
+
+ try
+ {
+ for ( Chapter chapter : book.getChapters() )
+ {
+ renderChapter( sink, writer, chapter, context );
+ }
+
+ writer.endElement(); // itext
+ }
+ finally
+ {
+ sink.flush();
+ sink.close();
+
+ IOUtil.close( fileWriter );
+ System.getProperties().remove( "itext.basedir" );
+ }
+
+ // ----------------------------------------------------------------------
+ // Render the XML to PDF
+ // ----------------------------------------------------------------------
+ File outputFile = new File( context.getOutputDirectory(), book.getId() + "." + getOutputExtension() );
+ try
+ {
+ renderXML( bookFile, outputFile );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while rendering file", e );
+ }
+ }
+
+ /**
+ * Get the output extension supported.
+ *
+ * @return the ouput extension supported.
+ */
+ public abstract String getOutputExtension();
+
+ /**
+ * Generate an ouput file with the iText framework.
+ *
+ * @param iTextFile the input file.
+ * @param iTextOutput the output file.
+ * @throws java.io.IOException if any.
+ */
+ public abstract void renderXML( File iTextFile, File iTextOutput )
+ throws IOException;
+
+ // ----------------------------------------------------------------------
+ // Private
+ // ----------------------------------------------------------------------
+
+ /**
+ * Write a chapter.
+ *
+ * @param writer the writer.
+ * @param chapter the Chapter.
+ * @param context the BookContext.
+ * @throws BookDoxiaException if the chapter cannot be written.
+ */
+ private void renderChapter( Sink sink, PrettyPrintXMLWriter writer, Chapter chapter, BookContext context )
+ throws BookDoxiaException
+ {
+ writer.startElement( "chapter" );
+ writer.addAttribute( "numberdepth", "1" );
+ writer.addAttribute( "depth", "1" );
+ writer.addAttribute( "indent", "1" );
+
+ startTitle( writer, "36.0", "Helvetica", "24.0", "normal", "255", "0", "0" );
+ chunk( writer, chapter.getTitle(), "Helvetica", "24.0", "normal", "255", "0", "0" );
+ writer.endElement(); // title
+
+ // writer.startElement( "sectioncontent" );
+ for ( Section section : chapter.getSections() )
+ {
+ renderSection( sink, writer, section, context );
+ }
+ // writer.endElement(); // sectioncontent
+
+ writer.endElement(); // chapter
+ }
+
+ /**
+ * Write a section.
+ *
+ * @param writer the writer.
+ * @param section the Section.
+ * @param context the BookContext.
+ * @throws BookDoxiaException if the section cannot be written.
+ */
+ private void renderSection( Sink sink, PrettyPrintXMLWriter writer, Section section, BookContext context )
+ throws BookDoxiaException
+ {
+ // writer.startElement( "section" );
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ BookContext.BookFile bookFile = (BookContext.BookFile) context.getFiles().get( section.getId() );
+
+ if ( bookFile == null )
+ {
+ throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ Reader reader = null;
+ try
+ {
+ reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
+ doxia.parse( reader, bookFile.getParserId(), sink );
+ }
+ catch ( ParserNotFoundException e )
+ {
+ throw new BookDoxiaException( "Parser not found: " + bookFile.getParserId() + ".", e );
+ }
+ catch ( ParseException e )
+ {
+ throw new BookDoxiaException(
+ "Error while parsing document: " + bookFile.getFile().getAbsolutePath() + ".",
+ e );
+ }
+ catch ( FileNotFoundException e )
+ {
+ throw new BookDoxiaException( "Could not find document: " + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while rendering book: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+ finally
+ {
+ IOUtil.close( reader );
+ }
+ }
+
+ /**
+ * Start a title.
+ *
+ * @param writer the writer.
+ * @param leading leading.
+ * @param font the font.
+ * @param size the size.
+ * @param fontstyle the fontstyle.
+ * @param red red.
+ * @param green green.
+ * @param blue blue.
+ */
+ private void startTitle( PrettyPrintXMLWriter writer, String leading, String font, String size, String fontstyle,
+ String red, String green, String blue )
+ {
+ writer.startElement( "title" );
+ writer.addAttribute( "leading", leading );
+ writer.addAttribute( "font", font );
+ writer.addAttribute( "size", size );
+ writer.addAttribute( "fontstyle", fontstyle );
+ writer.addAttribute( "red", red );
+ writer.addAttribute( "green", green );
+ writer.addAttribute( "blue", blue );
+ }
+
+ /**
+ * Write a chunk.
+ *
+ * @param writer the writer.
+ * @param title the title.
+ * @param font the font.
+ * @param size the size.
+ * @param fontstyle the fontstyle.
+ * @param red red.
+ * @param green green.
+ * @param blue blue.
+ */
+ private void chunk( PrettyPrintXMLWriter writer, String title, String font, String size, String fontstyle,
+ String red, String green, String blue )
+ {
+ writer.startElement( "chunk" );
+ writer.addAttribute( "font", font );
+ writer.addAttribute( "size", size );
+ writer.addAttribute( "fontstyle", fontstyle );
+ writer.addAttribute( "red", red );
+ writer.addAttribute( "green", green );
+ writer.addAttribute( "blue", blue );
+ if ( StringUtils.isNotEmpty( title ) )
+ {
+ writer.writeText( title );
+ }
+ else
+ {
+ writer.writeText( "<Missing title>" );
+ }
+ writer.endElement(); // chunk
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/BookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/BookRenderer.java
new file mode 100644
index 0000000..759831f
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/BookRenderer.java
@@ -0,0 +1,44 @@
+package org.apache.maven.doxia.book.services.renderer;
+
+/*
+ * 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 org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.book.BookDoxiaException;
+
+/**
+ * Render a book.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public interface BookRenderer
+{
+ /** The plexus lookup role. */
+ String ROLE = BookRenderer.class.getName();
+
+ /**
+ * Render a book.
+ *
+ * @param context the BookContext.
+ * @throws org.apache.maven.doxia.book.BookDoxiaException if the book cannot be rendered.
+ */
+ void renderBook( BookContext context )
+ throws BookDoxiaException;
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java
new file mode 100644
index 0000000..0d86ebd
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java
@@ -0,0 +1,223 @@
+package org.apache.maven.doxia.book.services.renderer;
+
+/*
+ * 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 java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+
+import org.apache.maven.doxia.Doxia;
+import org.apache.maven.doxia.book.BookDoxiaException;
+import org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.model.Chapter;
+import org.apache.maven.doxia.book.model.Section;
+import org.apache.maven.doxia.book.services.renderer.docbook.DocBookBookSink;
+import org.apache.maven.doxia.parser.ParseException;
+import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
+import org.apache.maven.doxia.sink.Sink;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.WriterFactory;
+
+/**
+ * An implementation of <code>BookRenderer</code> for docbook
+ *
+ * @plexus.component role-hint="doc-book"
+ * @author Eric Redmond
+ * @version $Id$
+ */
+public class DocbookBookRenderer
+ extends AbstractLogEnabled
+ implements BookRenderer
+{
+ /**
+ * @plexus.requirement
+ */
+ private Doxia doxia;
+
+ // ----------------------------------------------------------------------
+ // BookRenderer Implementation
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public void renderBook( BookContext context )
+ throws BookDoxiaException
+ {
+ BookModel book = context.getBook();
+
+ if ( !context.getOutputDirectory().exists() )
+ {
+ if ( !context.getOutputDirectory().mkdirs() )
+ {
+ throw new BookDoxiaException( "Could not make directory: "
+ + context.getOutputDirectory().getAbsolutePath() + "." );
+ }
+ }
+
+ File bookFile = new File( context.getOutputDirectory(), book.getId() + ".xml" );
+
+ Writer fileWriter;
+ try
+ {
+ fileWriter = WriterFactory.newXmlWriter( bookFile );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while opening file.", e );
+ }
+
+ // ----------------------------------------------------------------------
+ // Create the Dockbook File
+ // ----------------------------------------------------------------------
+
+ // TODO: Write out TOC?
+
+ DocBookBookSink sink = new DocBookBookSink( fileWriter );
+
+ try
+ {
+ sink.book();
+
+ // TODO: symmetrize bookHead?
+
+ if ( StringUtils.isNotEmpty( book.getTitle() ) )
+ {
+ sink.bookTitle();
+ sink.text( book.getTitle() );
+ sink.bookTitle_();
+ }
+
+ if ( StringUtils.isNotEmpty( book.getDate() ) )
+ {
+ sink.bookDate();
+ sink.text( book.getDate() );
+ sink.bookDate_();
+ }
+
+ if ( StringUtils.isNotEmpty( book.getAuthor() ) )
+ {
+ sink.bookAuthor();
+ sink.text( book.getAuthor() );
+ sink.bookAuthor_();
+ }
+
+ sink.bookHead_();
+
+ for ( Chapter chapter : book.getChapters() )
+ {
+ sink.chapter();
+
+ if ( StringUtils.isNotEmpty( chapter.getTitle() ) )
+ {
+ sink.chapterTitle();
+ sink.text( chapter.getTitle() );
+ sink.chapterTitle_();
+ }
+
+ renderChapter( chapter, context, sink );
+
+ sink.chapter_();
+ }
+
+ sink.book_();
+ }
+ finally
+ {
+ sink.flush();
+
+ sink.close();
+
+ IOUtil.close( fileWriter );
+ }
+ }
+
+ /**
+ * Write a chapter.
+ *
+ * @param writer the writer.
+ * @param chapter the Chapter.
+ * @param context the BookContext.
+ * @param sink a Sink.
+ * @throws BookDoxiaException if the chapter cannot be written.
+ */
+ private void renderChapter( Chapter chapter, BookContext context, Sink sink )
+ throws BookDoxiaException
+ {
+ for ( Section section : chapter.getSections() )
+ {
+ renderSection( section, context, sink );
+ }
+ }
+
+ /**
+ * Write a section.
+ *
+ * @param writer the writer.
+ * @param section the Section.
+ * @param context the BookContext.
+ * @param sink a Sink.
+ * @throws BookDoxiaException if the section cannot be written.
+ */
+ private void renderSection( Section section, BookContext context, Sink sink )
+ throws BookDoxiaException
+ {
+ BookContext.BookFile bookFile = (BookContext.BookFile) context.getFiles().get( section.getId() );
+
+ if ( bookFile == null )
+ {
+ throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
+ }
+
+ Reader reader = null;
+ try
+ {
+ reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
+ doxia.parse( reader, bookFile.getParserId(), sink );
+ }
+ catch ( ParserNotFoundException e )
+ {
+ throw new BookDoxiaException( "Parser not found: " + bookFile.getParserId() + ".", e );
+ }
+ catch ( ParseException e )
+ {
+ throw new BookDoxiaException(
+ "Error while parsing document: " + bookFile.getFile().getAbsolutePath() + ".",
+ e );
+ }
+ catch ( FileNotFoundException e )
+ {
+ throw new BookDoxiaException( "Could not find document: " + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while rendering book: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+ finally
+ {
+ IOUtil.close( reader );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java
new file mode 100644
index 0000000..0c5b383
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java
@@ -0,0 +1,246 @@
+package org.apache.maven.doxia.book.services.renderer;
+
+/*
+ * 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 org.apache.maven.doxia.book.BookDoxiaException;
+import org.apache.maven.doxia.book.services.renderer.latex.LatexBookSink;
+import org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.model.Chapter;
+import org.apache.maven.doxia.book.model.Section;
+import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
+import org.apache.maven.doxia.parser.ParseException;
+import org.apache.maven.doxia.Doxia;
+import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.WriterFactory;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.FileNotFoundException;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * <p>LatexBookRenderer class.</p>
+ *
+ * @plexus.component role-hint="latex"
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class LatexBookRenderer
+ implements BookRenderer
+{
+ /**
+ * @plexus.requirement
+ */
+ private Doxia doxia;
+
+ // ----------------------------------------------------------------------
+ // BookRenderer Implementatino
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public void renderBook( BookContext context )
+ throws BookDoxiaException
+ {
+ BookModel book = context.getBook();
+
+ if ( !context.getOutputDirectory().exists() )
+ {
+ if ( !context.getOutputDirectory().mkdirs() )
+ {
+ throw new BookDoxiaException(
+ "Could not make directory: " + context.getOutputDirectory().getAbsolutePath() + "." );
+ }
+ }
+
+ File bookFile = new File( context.getOutputDirectory(), book.getId() + ".tex" );
+
+ FileWriter fileWriter = null;
+
+ try
+ {
+ fileWriter = new FileWriter( bookFile );
+
+ PrintWriter writer = new PrintWriter( fileWriter );
+
+ writeBook( book, context, writer );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while opening file.", e );
+ }
+ finally
+ {
+ IOUtil.close( fileWriter );
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ // Private
+ // ----------------------------------------------------------------------
+
+ /** SectionInfo: id and title. */
+ static class SectionInfo
+ {
+ /** id. */
+ String id;
+
+ /** title. */
+ String title;
+ }
+
+ /**
+ * Write a book.
+ *
+ * @param book the BookModel to write.
+ * @param context the BookContext.
+ * @param writer the writer to use.
+ * @throws IOException if any.
+ * @throws BookDoxiaException if the section cannot be written.
+ */
+ private void writeBook( BookModel book, BookContext context, PrintWriter writer )
+ throws IOException, BookDoxiaException
+ {
+ // ----------------------------------------------------------------------
+ // Process all the section documents and collect their names
+ // ----------------------------------------------------------------------
+
+ Map<String, SectionInfo> sectionInfos = new HashMap<String, SectionInfo>();
+
+ for ( Chapter chapter : book.getChapters() )
+ {
+ for ( Section section : chapter.getSections() )
+ {
+ SectionInfo info = writeSection( section, context );
+
+ sectionInfos.put( info.id, info );
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ // Write the main .tex file
+ // ----------------------------------------------------------------------
+
+ writer.println( "\\documentclass{book}" );
+ writer.println( "\\title{" + book.getTitle() + "}" );
+
+ if ( StringUtils.isNotEmpty( book.getAuthor() ) )
+ {
+ writer.println( "\\author{" + book.getAuthor() + "}" );
+ }
+
+ if ( StringUtils.isNotEmpty( book.getDate() ) )
+ {
+ writer.println( "\\date{" + book.getDate() + "}" );
+ }
+
+ LatexBookSink sink = new LatexBookSink( writer );
+ sink.defaultBookPreamble();
+
+ writer.println( "\\begin{document}" );
+ writer.println( "\\maketitle" );
+ writer.println( "\\tableofcontents" );
+// writer.println( "\\listoffigures" );
+
+ for ( Chapter chapter : book.getChapters() )
+ {
+ writer.println( "\\chapter{" + chapter.getTitle() + "}" );
+
+ for ( Section section : chapter.getSections() )
+ {
+ SectionInfo info = sectionInfos.get( section.getId() );
+
+ writer.println( "\\input{" + info.id + "}" );
+ }
+ }
+
+ writer.println( "\\end{document}" );
+ }
+
+ /**
+ * Write a section.
+ *
+ * @param section the Section to write.
+ * @param context the BookContext.
+ * @return SectionInfo
+ * @throws IOException if any.
+ * @throws BookDoxiaException if the section cannot be written.
+ */
+ private SectionInfo writeSection( Section section, BookContext context )
+ throws IOException, BookDoxiaException
+ {
+ File file = new File( context.getOutputDirectory(), ( section.getId() + ".tex" ) );
+
+ Writer writer = WriterFactory.newWriter( file, context.getOutputEncoding() );
+
+ LatexBookSink sink = new LatexBookSink( writer );
+
+ BookContext.BookFile bookFile = (BookContext.BookFile) context.getFiles().get( section.getId() );
+
+ if ( bookFile == null )
+ {
+ throw new BookDoxiaException( "No document that matches section with id="
+ + section.getId() + "." );
+ }
+
+ Reader reader = null;
+ try
+ {
+ reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
+ doxia.parse( reader, bookFile.getParserId(), sink );
+ }
+ catch ( ParserNotFoundException e )
+ {
+ throw new BookDoxiaException( "Parser not found: "
+ + bookFile.getParserId() + ".", e );
+ }
+ catch ( ParseException e )
+ {
+ throw new BookDoxiaException( "Error while parsing document: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+ catch ( FileNotFoundException e )
+ {
+ throw new BookDoxiaException( "Could not find document: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+ finally
+ {
+ sink.flush();
+ sink.close();
+
+ IOUtil.close( reader );
+ IOUtil.close( writer );
+ }
+
+ SectionInfo info = new SectionInfo();
+ info.id = section.getId();
+ info.title = sink.getTitle();
+
+ return info;
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java
new file mode 100644
index 0000000..b6a1ae5
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java
@@ -0,0 +1,52 @@
+package org.apache.maven.doxia.book.services.renderer;
+
+/*
+ * 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 java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.apache.maven.doxia.module.itext.ITextUtil;
+
+/**
+ * PDF book renderer with the <code>iText</code> framework.
+ *
+ * @plexus.component role-hint="pdf"
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class PdfBookRenderer
+ extends AbstractITextBookRenderer
+{
+ /** {@inheritDoc} */
+ public String getOutputExtension()
+ {
+ return "pdf";
+ }
+
+ /** {@inheritDoc} */
+ public void renderXML( File iTextFile, File iTextOutput )
+ throws IOException
+ {
+ ITextUtil.writePdf( new FileInputStream( iTextFile ), new FileOutputStream( iTextOutput ) );
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java
new file mode 100644
index 0000000..0e60e13
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java
@@ -0,0 +1,52 @@
+package org.apache.maven.doxia.book.services.renderer;
+
+/*
+ * 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 java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.apache.maven.doxia.module.itext.ITextUtil;
+
+/**
+ * RTF book renderer with the <code>iText</code> framework.
+ *
+ * @plexus.component role-hint="rtf"
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class RtfBookRenderer
+ extends AbstractITextBookRenderer
+{
+ /** {@inheritDoc} */
+ public String getOutputExtension()
+ {
+ return "rtf";
+ }
+
+ /** {@inheritDoc} */
+ public void renderXML( File iTextFile, File iTextOutput )
+ throws IOException
+ {
+ ITextUtil.writeRtf( new FileInputStream( iTextFile ), new FileOutputStream( iTextOutput ) );
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java
new file mode 100644
index 0000000..ad6f585
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java
@@ -0,0 +1,208 @@
+package org.apache.maven.doxia.book.services.renderer;
+
+/*
+ * 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 org.apache.maven.doxia.Doxia;
+import org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.book.BookDoxiaException;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.model.Chapter;
+import org.apache.maven.doxia.book.model.Section;
+import org.apache.maven.doxia.book.services.renderer.xhtml.XhtmlBookSink;
+import org.apache.maven.doxia.sink.render.RenderingContext;
+import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
+import org.apache.maven.doxia.parser.ParseException;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.ReaderFactory;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+
+/**
+ * <p>XHtmlBookRenderer class.</p>
+ *
+ * @plexus.component role-hint="xhtml"
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class XHtmlBookRenderer
+ extends AbstractLogEnabled
+ implements BookRenderer
+{
+ /**
+ * @plexus.requirement
+ */
+ private Doxia doxia;
+
+ // ----------------------------------------------------------------------
+ // BookRenderer Implementation
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public void renderBook( BookContext context )
+ throws BookDoxiaException
+ {
+ BookModel book = context.getBook();
+
+ if ( !context.getOutputDirectory().exists() )
+ {
+ if ( !context.getOutputDirectory().mkdirs() )
+ {
+ throw new BookDoxiaException( "Could not make directory: "
+ + context.getOutputDirectory().getAbsolutePath() + "." );
+ }
+ }
+
+ File bookFile = new File( context.getOutputDirectory(), book.getId() + ".xhtml" );
+
+ Writer fileWriter;
+
+ try
+ {
+ fileWriter = new FileWriter( bookFile );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while opening file.", e );
+ }
+
+ XhtmlBookSink sink = new XhtmlBookSink( fileWriter,
+ new RenderingContext( context.getOutputDirectory(), bookFile.getAbsolutePath() ) );
+
+ try
+ {
+ sink.bookHead();
+ sink.bookTitle();
+ sink.text( context.getBook().getTitle() );
+ sink.bookTitle_();
+ sink.bookAuthor();
+ sink.text( context.getBook().getAuthor() );
+ sink.bookAuthor_();
+ sink.bookDate();
+ sink.text( context.getBook().getDate() );
+ sink.bookDate_();
+ sink.bookHead_();
+ sink.bookBody();
+
+ int chapterNumber = 1;
+
+ for ( Chapter chapter : book.getChapters() )
+ {
+ sink.sectionTitle();
+ sink.text( Integer.toString( chapterNumber ) + ". " + chapter.getTitle() );
+ sink.sectionTitle_();
+
+ renderChapter( sink, chapter, context );
+
+ chapterNumber++;
+ }
+
+ sink.bookBody_();
+ }
+ finally
+ {
+ sink.flush();
+
+ sink.close();
+
+ IOUtil.close( fileWriter );
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ // Private
+ // ----------------------------------------------------------------------
+
+ /**
+ * Write a chapter.
+ *
+ * @param sink the XhtmlBookSink.
+ * @param chapter the Chapter.
+ * @param context the BookContext.
+ * @throws BookDoxiaException if the chapter cannot be written.
+ */
+ private void renderChapter( XhtmlBookSink sink, Chapter chapter, BookContext context )
+ throws BookDoxiaException
+ {
+ for ( Section section : chapter.getSections() )
+ {
+ renderSection( sink, section, context );
+ }
+ }
+
+ /**
+ * Write a section.
+ *
+ * @param sink the XhtmlBookSink.
+ * @param section the Section.
+ * @param context the BookContext.
+ * @throws BookDoxiaException if the section cannot be written.
+ */
+ private void renderSection( XhtmlBookSink sink, Section section, BookContext context )
+ throws BookDoxiaException
+ {
+ sink.section2();
+
+ BookContext.BookFile bookFile = context.getFiles().get( section.getId() );
+
+ if ( bookFile == null )
+ {
+ throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
+ }
+
+ Reader reader = null;
+ try
+ {
+ reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
+ doxia.parse( reader, bookFile.getParserId(), sink );
+ }
+ catch ( ParserNotFoundException e )
+ {
+ throw new BookDoxiaException( "Parser not found: "
+ + bookFile.getParserId() + ".", e );
+ }
+ catch ( ParseException e )
+ {
+ throw new BookDoxiaException( "Error while parsing document: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+ catch ( FileNotFoundException e )
+ {
+ throw new BookDoxiaException( "Could not find document: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while rendering book: "
+ + bookFile.getFile().getAbsolutePath() + ".", e );
+ }
+ finally
+ {
+ IOUtil.close( reader );
+ }
+
+ sink.section2_();
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
new file mode 100644
index 0000000..f5c6541
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
@@ -0,0 +1,445 @@
+package org.apache.maven.doxia.book.services.renderer;
+
+/*
+ * 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 java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.Locale;
+
+import org.apache.maven.doxia.Doxia;
+import org.apache.maven.doxia.book.BookDoxiaException;
+import org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.model.Chapter;
+import org.apache.maven.doxia.book.model.Section;
+import org.apache.maven.doxia.book.services.renderer.xdoc.ChapterXdocBookSink;
+import org.apache.maven.doxia.book.services.renderer.xdoc.IndexXdocBookSink;
+import org.apache.maven.doxia.book.services.renderer.xdoc.SectionXdocBookSink;
+import org.apache.maven.doxia.index.IndexEntry;
+import org.apache.maven.doxia.module.xdoc.XdocSink;
+import org.apache.maven.doxia.parser.ParseException;
+import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
+import org.apache.maven.doxia.util.HtmlTools;
+import org.codehaus.plexus.i18n.I18N;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.WriterFactory;
+
+/**
+ * An implementation of <code>BookRenderer</code> for Xdoc
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @plexus.component role-hint="xdoc"
+ */
+public class XdocBookRenderer
+ extends AbstractLogEnabled
+ implements BookRenderer
+{
+ /**
+ * @plexus.requirement
+ */
+ private Doxia doxia;
+
+ /**
+ * @plexus.requirement
+ */
+ private I18N i18n;
+
+ // ----------------------------------------------------------------------
+ // BookRenderer Implementation
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public void renderBook( BookContext context )
+ throws BookDoxiaException
+ {
+ BookModel book = context.getBook();
+
+ if ( !context.getOutputDirectory().exists() )
+ {
+ if ( !context.getOutputDirectory().mkdirs() )
+ {
+ throw new BookDoxiaException( "Could not make directory: "
+ + context.getOutputDirectory().getAbsolutePath() + "." );
+ }
+ }
+
+ renderBook( book, context );
+ }
+
+ // -----------------------------------------------------------------------
+ // Protected
+ // -----------------------------------------------------------------------
+
+ /**
+ * Gets a trimmed String for the given key from the resource bundle defined by Plexus.
+ *
+ * @param locale the locale used
+ * @param key the key for the desired string
+ * @return the string for the given key and the given locale
+ */
+ protected String getString( Locale locale, String key )
+ {
+ if ( StringUtils.isEmpty( key ) )
+ {
+ throw new IllegalArgumentException( "The key cannot be empty" );
+ }
+
+ return i18n.getString( "book-renderer", locale, key ).trim();
+ }
+
+ // -----------------------------------------------------------------------
+ // Private
+ // -----------------------------------------------------------------------
+
+ /**
+ * Render the book, ie the book index and all chapter index and pages
+ *
+ * @param book the BookModel.
+ * @param context the BookContext.
+ * @throws BookDoxiaException if any
+ */
+ private void renderBook( BookModel book, BookContext context )
+ throws BookDoxiaException
+ {
+ // -----------------------------------------------------------------------
+ // Render the book index.xml page
+ // -----------------------------------------------------------------------
+
+ File index = new File( context.getOutputDirectory(), "index.xml" );
+
+ try
+ {
+ writeBookIndex( index, book, context );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while rendering index page to: '"
+ + index.getAbsolutePath() + "'.", e );
+ }
+
+ // -----------------------------------------------------------------------
+ // Render all the chapter pages
+ // -----------------------------------------------------------------------
+
+ Iterator<IndexEntry> ii = context.getIndex().getChildEntries().iterator();
+
+ for ( Chapter chapter : book.getChapters() )
+ {
+ renderChapter( chapter, context, ii.next() );
+ }
+ }
+
+ /**
+ * Write the book index, ie a TOC.
+ *
+ * @param index the File.
+ * @param book the BookModel.
+ * @param context the BookContext.
+ * @throws IOException if any
+ */
+ private void writeBookIndex( File index, BookModel book, BookContext context )
+ throws IOException
+ {
+ Writer writer = WriterFactory.newXmlWriter( index );
+
+ XdocSink sink = new IndexXdocBookSink( writer, context.getIndex().getFirstEntry(), i18n, context.getLocale() );
+
+ try
+ {
+ // -----------------------------------------------------------------------
+ // Head
+ // -----------------------------------------------------------------------
+
+ sink.head();
+
+ sink.title();
+ sink.text( book.getTitle() + " - " + getString( context.getLocale(), "toc" ) );
+ sink.title_();
+
+ sink.head_();
+
+ // -----------------------------------------------------------------------
+ // Body
+ // -----------------------------------------------------------------------
+
+ sink.body();
+
+ sink.section1();
+ sink.sectionTitle1();
+ sink.text( book.getTitle() + " - " + getString( context.getLocale(), "toc" ) );
+ sink.sectionTitle1_();
+
+ sink.list();
+ for ( IndexEntry entry : context.getIndex().getChildEntries() )
+ {
+ writeChapterIndexForBookIndex( sink, entry );
+ }
+ sink.list_();
+
+ sink.section1_();
+
+ sink.body_();
+ }
+ finally
+ {
+ sink.flush();
+
+ sink.close();
+
+ IOUtil.close( writer );
+ }
+ }
+
+ /**
+ * Write the chapter index for the book index.
+ *
+ * @param sink the XdocSink.
+ * @param chapterEntry the chapter IndexEntry.
+ */
+ private void writeChapterIndexForBookIndex( XdocSink sink, IndexEntry chapterEntry )
+ {
+ sink.listItem();
+ sink.link( chapterEntry.getId() + ".html" );
+ sink.text( chapterEntry.getTitle() );
+ sink.link_();
+
+ sink.list();
+ for ( IndexEntry sectionIndex : chapterEntry.getChildEntries() )
+ {
+ writeSectionIndexForBookIndex( sink, sectionIndex );
+ }
+ sink.list_();
+
+ sink.listItem_();
+ }
+
+ /**
+ * Write the section index for the book index.
+ *
+ * @param sink the XdocSink.
+ * @param sectionIndex the section IndexEntry.
+ */
+ private void writeSectionIndexForBookIndex( XdocSink sink, IndexEntry sectionIndex )
+ {
+ sink.listItem();
+ sink.link( sectionIndex.getId() + ".html" );
+ sink.text( sectionIndex.getTitle() );
+ sink.link_();
+
+ sink.list();
+ for ( IndexEntry subsectionIndex : sectionIndex.getChildEntries() )
+ {
+ writeSubsectionIndexForBookIndex( sink, sectionIndex, subsectionIndex );
+ }
+ sink.list_();
+
+ sink.listItem_();
+ }
+
+ /**
+ * Write subsection index for the book index.
+ *
+ * @param sink the XdocSink.
+ * @param sectionIndex the section IndexEntry.
+ * @param subsectionIndex the subsection IndexEntry.
+ */
+ private void writeSubsectionIndexForBookIndex( XdocSink sink, IndexEntry sectionIndex, IndexEntry subsectionIndex )
+ {
+ sink.listItem();
+ sink.link( sectionIndex.getId() + ".html#" + HtmlTools.encodeId( subsectionIndex.getId() ) );
+ sink.text( subsectionIndex.getTitle() );
+ sink.link_();
+ sink.listItem_();
+ }
+
+ // -----------------------------------------------------------------------
+ // Rendering
+ // -----------------------------------------------------------------------
+
+ /**
+ * Render the chapter index and all section pages.
+ *
+ * @param chapter the Chapter.
+ * @param context the BookContext.
+ * @param chapterIndex the IndexEntry.
+ * @throws BookDoxiaException if any
+ */
+ private void renderChapter( Chapter chapter, BookContext context, IndexEntry chapterIndex )
+ throws BookDoxiaException
+ {
+ // -----------------------------------------------------------------------
+ // Render the chapter index page
+ // -----------------------------------------------------------------------
+
+ File index = new File( context.getOutputDirectory(), chapter.getId() + ".xml" );
+
+ try
+ {
+ writeChapterIndex( index, chapter, chapterIndex, context );
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while rendering index page to: '"
+ + index.getAbsolutePath() + "'.", e );
+ }
+
+ // -----------------------------------------------------------------------
+ // Render all section pages
+ // -----------------------------------------------------------------------
+
+ Iterator<IndexEntry> ii = chapterIndex.getChildEntries().iterator();
+
+ for ( Section section : chapter.getSections() )
+ {
+ renderSection( context, section, ii.next() );
+ }
+ }
+
+ /**
+ * Write a chapter index
+ *
+ * @param index the File.
+ * @param context the context.
+ * @param chapter the Chapter.
+ * @param chapterIndex the IndexEntry.
+ * @throws IOException if any.
+ */
+ private void writeChapterIndex( File index, Chapter chapter, IndexEntry chapterIndex, BookContext context )
+ throws IOException
+ {
+ Writer writer = WriterFactory.newXmlWriter( index );
+
+ ChapterXdocBookSink sink = new ChapterXdocBookSink( writer, chapterIndex, i18n, context.getLocale() );
+
+ try
+ {
+ // -----------------------------------------------------------------------
+ // Head
+ // -----------------------------------------------------------------------
+
+ sink.head();
+
+ sink.title();
+ sink.text( chapter.getTitle() );
+ sink.title_();
+
+ sink.head_();
+
+ // -----------------------------------------------------------------------
+ // Body
+ // -----------------------------------------------------------------------
+
+ sink.body();
+
+ sink.section1();
+ sink.sectionTitle1();
+ sink.text( chapter.getTitle() );
+ sink.sectionTitle1_();
+
+ sink.list();
+ for ( IndexEntry sectionIndex : chapterIndex.getChildEntries() )
+ {
+ writeSectionIndexForBookIndex( sink, sectionIndex );
+ }
+ sink.list_();
+
+ sink.section1_();
+
+ sink.body_();
+ }
+ finally
+ {
+ sink.flush();
+
+ sink.close();
+
+ IOUtil.close( writer );
+ }
+ }
+
+ /**
+ * Render all section pages.
+ *
+ * @param context the BookContext.
+ * @param section the Section.
+ * @param sectionIndex the IndexEntry.
+ * @throws BookDoxiaException if any.
+ */
+ private void renderSection( BookContext context, Section section, IndexEntry sectionIndex )
+ throws BookDoxiaException
+ {
+ try
+ {
+ Writer writer = WriterFactory.newXmlWriter( new File( context.getOutputDirectory()
+ + "/" + section.getId() + ".xml" ) );
+
+ SectionXdocBookSink sink = new SectionXdocBookSink( writer, sectionIndex, i18n, context.getLocale() );
+
+ BookContext.BookFile bookFile = (BookContext.BookFile) context.getFiles().get( section.getId() );
+
+ if ( bookFile == null )
+ {
+ throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
+ }
+
+ Reader reader = null;
+ try
+ {
+ reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
+ doxia.parse( reader, bookFile.getParserId(), sink );
+ }
+ catch ( ParserNotFoundException e )
+ {
+ throw new BookDoxiaException( "Parser not found: " + bookFile.getParserId() + ".", e );
+ }
+ catch ( ParseException e )
+ {
+ throw new BookDoxiaException( "Error while parsing document: " + bookFile.getFile().getAbsolutePath()
+ + ".", e );
+ }
+ catch ( FileNotFoundException e )
+ {
+ throw new BookDoxiaException( "Could not find document: " + bookFile.getFile().getAbsolutePath() + ".",
+ e );
+ }
+ finally
+ {
+ sink.flush();
+ sink.close();
+
+ IOUtil.close( reader );
+ IOUtil.close( writer );
+ }
+ }
+ catch ( IOException e )
+ {
+ throw new BookDoxiaException( "Error while rendering book.", e );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSink.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSink.java
new file mode 100644
index 0000000..56a632b
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSink.java
@@ -0,0 +1,270 @@
+package org.apache.maven.doxia.book.services.renderer.docbook;
+
+/*
+ * 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.Writer;
+
+import javax.swing.text.MutableAttributeSet;
+import javax.swing.text.html.HTML.Tag;
+
+import org.apache.maven.doxia.module.docbook.DocBookSink;
+
+/**
+ * An Docbook Sink that doesn't write out head or body elements for every section of a book, and has some convenience
+ * methods relating to the construction of a Doxia Book.
+ *
+ * @author Dave Syer
+ * @version $Id$
+ * @since 1.1
+ */
+public class DocBookBookSink
+ extends DocBookSink
+{
+ /** Indicates if we're inside a head. */
+ private boolean hasHead = false;
+
+ /**
+ * Construct a new DocBookSink.
+ *
+ * @param out the writer for the sink.
+ */
+ public DocBookBookSink( Writer out )
+ {
+ super( out );
+
+ setSystemId( "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" );
+ setPublicId( "-//OASIS//DTD DocBook V4.4//EN" );
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing because we don't want the header from each document to crop up in the middle of a book.
+ */
+ public void head()
+ {
+ // noop
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing because we don't want the header from each document to crop up in the middle of a book.
+ */
+ public void head_()
+ {
+ // noop
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Marks the skip flag to true so that this element's text is not emitted by the base class.
+ */
+ public void title()
+ {
+ setSkip( true );
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Marks the skip flag to false so that rendering can resume.
+ */
+ public void title_()
+ {
+ setSkip( false );
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Marks the skip flag to true so that this element's text is not emitted by the base class.
+ */
+ public void author()
+ {
+ setSkip( true );
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Marks the skip flag to false so that rendering can resume.
+ */
+ public void author_()
+ {
+ setSkip( false );
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing because we don't want the header from each document to crop up in the middle of a book.
+ */
+ public void body()
+ {
+ // noop
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing because we don't want the header from each document to crop up in the middle of a book.
+ */
+ public void body_()
+ {
+ // noop
+ }
+
+ /**
+ * Emit the start tag for the book.
+ *
+ * @see org.apache.maven.doxia.module.docbook.DocbookMarkup#BOOK_TAG
+ */
+ public void book()
+ {
+ init();
+
+ MutableAttributeSet att = writeXmlHeader( "book" );
+
+ writeStartTag( BOOK_TAG, att );
+
+ }
+
+ /**
+ * Emit the end tag for the book.
+ *
+ * @see org.apache.maven.doxia.module.docbook.DocbookMarkup#BOOK_TAG
+ */
+ public void book_()
+ {
+ writeEndTag( BOOK_TAG );
+ flush();
+ }
+
+ /** If no header matter has yet been encountered emit the book info start tag. */
+ private void bookHead()
+ {
+ if ( !hasHead )
+ {
+ writeStartTag( BOOKINFO_TAG );
+ hasHead = true;
+ }
+ }
+
+ /**
+ * If some header matter has been encountered emit the book info end tag.
+ */
+ public void bookHead_()
+ {
+ if ( hasHead )
+ {
+ writeEndTag( BOOKINFO_TAG );
+ hasHead = false;
+ }
+ }
+
+ /**
+ * Emit the title start tag for the whole book.
+ */
+ public void bookTitle()
+ {
+ bookHead();
+ writeStartTag( Tag.TITLE );
+ }
+
+ /**
+ * Emit the title end tag for the whole book.
+ */
+ public void bookTitle_()
+ {
+ super.title_();
+ }
+
+ /**
+ * Emit the author start tag for the whole book.
+ */
+ public void bookAuthor()
+ {
+ bookHead();
+ super.author();
+ }
+
+ /**
+ * Emit the author end tag for the whole book.
+ */
+ public void bookAuthor_()
+ {
+ super.author_();
+ }
+
+ /**
+ * Emit the date start tag for the whole book.
+ */
+ public void bookDate()
+ {
+ bookHead();
+ super.date();
+ }
+
+ /**
+ * Emit the date end tag for the whole book.
+ */
+ public void bookDate_()
+ {
+ super.date_();
+ }
+
+ /**
+ * Emit the chapter start tag.
+ */
+ public void chapter()
+ {
+ writeStartTag( CHAPTER_TAG );
+ }
+
+ /**
+ * Emit the chapter end tag.
+ */
+ public void chapter_()
+ {
+ writeEndTag( CHAPTER_TAG );
+ }
+
+ /**
+ * Emit the chapter title start tag.
+ */
+ public void chapterTitle()
+ {
+ writeStartTag( Tag.TITLE );
+ }
+
+ /**
+ * Emit the chapter title end tag.
+ */
+ public void chapterTitle_()
+ {
+ writeEndTag( Tag.TITLE );
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/latex/LatexBookSink.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/latex/LatexBookSink.java
new file mode 100644
index 0000000..984093e
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/latex/LatexBookSink.java
@@ -0,0 +1,124 @@
+package org.apache.maven.doxia.book.services.renderer.latex;
+
+/*
+ * 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 org.apache.maven.doxia.module.latex.LatexSink;
+
+import java.io.Writer;
+
+/**
+ * <p>LatexBookSink class.</p>
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class LatexBookSink
+ extends LatexSink
+{
+ /** text. */
+ private String txt;
+
+ /** title. */
+ private String title;
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ /**
+ * Construct a new LatexBookSink which is a LatexSink with the given writer,
+ * null sinkCommands, null preamble and fragmentDocument = true.
+ *
+ * @param out the writer for the sink.
+ */
+ public LatexBookSink( Writer out )
+ {
+ super( out, null, null, true );
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ protected String getDocumentStart()
+ {
+ return "";
+// return "\\documentclass{book}";
+ }
+
+ /** {@inheritDoc} */
+ protected String getDocumentBegin()
+ {
+ return null;
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public void text( String text )
+ {
+ this.txt = text;
+
+ super.text( text );
+ }
+
+ /** {@inheritDoc} */
+ public void title_()
+ {
+ super.title_();
+
+ this.title = txt;
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ /**
+ * Return the title.
+ *
+ * @return String.
+ */
+ public String getTitle()
+ {
+ return title;
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ /**
+ * Writes the default LaTeX commands and preamble in the main book file.
+ *
+ * @since 1.1
+ */
+ public void defaultBookPreamble()
+ {
+ markup( defaultSinkCommands() );
+ markup( defaultPreamble() );
+ flush();
+ }
+
+
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/AbstractXdocBookSink.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/AbstractXdocBookSink.java
new file mode 100644
index 0000000..11944dc
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/AbstractXdocBookSink.java
@@ -0,0 +1,126 @@
+package org.apache.maven.doxia.book.services.renderer.xdoc;
+
+/*
+ * 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.Writer;
+import java.util.Locale;
+
+import org.apache.maven.doxia.module.xdoc.XdocSink;
+
+import org.codehaus.plexus.i18n.I18N;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * Abstract <code>XdocSink</code> implementation for book.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public abstract class AbstractXdocBookSink
+ extends XdocSink
+{
+ /** I18N for localized messages. */
+ private final I18N i18n;
+
+ /** The wanted locale */
+ private final Locale locale;
+
+ /**
+ * Default constructor.
+ *
+ * @param out a Writer.
+ * @param i18n I18N.
+ * @param locale the wanted locale.
+ */
+ public AbstractXdocBookSink( Writer out, I18N i18n, Locale locale )
+ {
+ super( out );
+
+ this.i18n = i18n;
+ this.locale = locale;
+ }
+
+ /** {@inheritDoc} */
+ public void date_()
+ {
+ // nop
+ }
+
+ /** {@inheritDoc} */
+ public void body()
+ {
+ writeStartTag( BODY );
+
+ write( "<section name=\"\">" );
+
+ navigationPanel();
+ horizontalRule();
+
+ write( "</section>" );
+ }
+
+ /** {@inheritDoc} */
+ public void body_()
+ {
+ write( "<section name=\"\">" );
+
+ horizontalRule();
+
+ navigationPanel();
+
+ write( "</section>" );
+
+ writeEndTag( BODY );
+
+ writeEndTag( DOCUMENT_TAG );
+
+ flush();
+
+ close();
+
+ init();
+ }
+
+ // -----------------------------------------------------------------------
+ // Protected
+ // -----------------------------------------------------------------------
+
+ /**
+ * Gets a trimmed String for the given key from the resource bundle defined by Plexus.
+ *
+ * @param key the key for the desired string
+ * @return the string for the given key
+ */
+ protected String getString( String key )
+ {
+ if ( StringUtils.isEmpty( key ) )
+ {
+ throw new IllegalArgumentException( "The key cannot be empty" );
+ }
+
+ return i18n.getString( "book-renderer", locale, key ).trim();
+ }
+
+ /**
+ * Add a navigation panel.
+ */
+ protected abstract void navigationPanel();
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java
new file mode 100644
index 0000000..c3d90c1
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/ChapterXdocBookSink.java
@@ -0,0 +1,151 @@
+package org.apache.maven.doxia.book.services.renderer.xdoc;
+
+/*
+ * 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.Writer;
+import java.util.Locale;
+
+import org.apache.maven.doxia.index.IndexEntry;
+import org.codehaus.plexus.i18n.I18N;
+
+/**
+ * A <code>XdocSink</code> implementation for chapter in a book.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class ChapterXdocBookSink
+ extends AbstractXdocBookSink
+{
+ /** the chapter IndexEntry. */
+ private final IndexEntry chapterIndex;
+
+ /**
+ * Default constructor.
+ *
+ * @param out the Writer.
+ * @param chapterIndex the chapter IndexEntry.
+ * @param i18n I18N.
+ * @param locale wanted locale.
+ */
+ public ChapterXdocBookSink( Writer out, IndexEntry chapterIndex, I18N i18n, Locale locale )
+ {
+ super( out, i18n, locale );
+
+ this.chapterIndex = chapterIndex;
+ }
+
+ /** {@inheritDoc} */
+ protected void navigationPanel()
+ {
+ write( "<!--Navigation Panel-->" );
+
+ write( "<table width=\"100%\" align=\"center\">" );
+ write( "<tr>" );
+
+ // -----------------------------------------------------------------------
+ // Prev
+ // -----------------------------------------------------------------------
+
+ IndexEntry prevChapter = chapterIndex.getPrevEntry();
+
+ write( "<td><div align=\"left\">" );
+
+ previous( prevChapter );
+
+ write( "</div></td>" );
+
+ // -----------------------------------------------------------------------
+ // Parent
+ // -----------------------------------------------------------------------
+
+ write( "<td><div align=\"center\">" );
+ up();
+ write( "</div></td>" );
+
+ // -----------------------------------------------------------------------
+ // Next
+ // -----------------------------------------------------------------------
+
+ write( "<td><div align=\"right\">" );
+
+ next();
+
+ write( "</div></td>" );
+
+ write( "</tr>" );
+ write( "</table>" );
+
+ write( "<!--End of Navigation Panel-->" );
+ }
+
+ /**
+ * Add previous link.
+ *
+ * @param prevChapter the previous IndexEntry.
+ */
+ protected void previous( IndexEntry prevChapter )
+ {
+ if ( prevChapter != null )
+ {
+ IndexEntry lastEntry = prevChapter.getLastEntry();
+ if ( lastEntry == null )
+ {
+ write( "<i>Start of book</i>" );
+ }
+ else
+ {
+ write( getString( "previous" ) + ": <a href=\"" + lastEntry.getId() + ".html\">" );
+ content( lastEntry.getTitle() );
+ write( "</a>" );
+ }
+ }
+ else
+ {
+ write( getString( "previous" ) + ":<a href=\"index.html\">" + getString( "toc" ) + "</a>" );
+ }
+ }
+
+ /**
+ * Add parent/up link.
+ */
+ protected void up()
+ {
+ write( getString( "up" ) + ": <a href=\"index.html\">" + getString( "toc" ) + "</a>" );
+ }
+
+ /**
+ * Add next link
+ */
+ protected void next()
+ {
+ IndexEntry firstEntry = chapterIndex.getFirstEntry();
+ if ( firstEntry == null )
+ {
+ write( "<i>End of book</i>" );
+ }
+ else
+ {
+ write( getString( "next" ) + ": <a href=\"" + firstEntry.getId() + ".html\">" );
+ content( firstEntry.getTitle() );
+ write( "</a>" );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java
new file mode 100644
index 0000000..7832957
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/IndexXdocBookSink.java
@@ -0,0 +1,84 @@
+package org.apache.maven.doxia.book.services.renderer.xdoc;
+
+/*
+ * 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.Writer;
+import java.util.Locale;
+
+import org.apache.maven.doxia.index.IndexEntry;
+import org.codehaus.plexus.i18n.I18N;
+
+/**
+ * A <code>XdocSink</code> implementation for index book.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class IndexXdocBookSink
+ extends AbstractXdocBookSink
+{
+ /** the first IndexEntry. */
+ private final IndexEntry firstEntry;
+
+ /**
+ * Default constructor.
+ *
+ * @param out the Writer.
+ * @param firstEntry the first IndexEntry.
+ * @param i18n I18N.
+ * @param locale wanted locale.
+ */
+ public IndexXdocBookSink( Writer out, IndexEntry firstEntry, I18N i18n, Locale locale )
+ {
+ super( out, i18n, locale );
+
+ this.firstEntry = firstEntry;
+ }
+
+ /** {@inheritDoc} */
+ protected void navigationPanel()
+ {
+ write( "<!--Navigation Panel-->" );
+
+ write( "<table width=\"100%\" align=\"center\">" );
+ write( "<tr>" );
+
+ // -----------------------------------------------------------------------
+ // Next
+ // -----------------------------------------------------------------------
+
+ if ( firstEntry != null )
+ {
+ write( "<td><div align=\"right\">" );
+
+ write( getString( "next" ) + ": <a href=\"" + firstEntry.getId() + ".html\">" );
+ content( firstEntry.getTitle() );
+ write( "</a>" );
+
+ write( "</div></td>" );
+ }
+
+ write( "</tr>" );
+ write( "</table>" );
+
+ write( "<!--End of Navigation Panel-->" );
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java
new file mode 100644
index 0000000..f16a179
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/xdoc/SectionXdocBookSink.java
@@ -0,0 +1,166 @@
+package org.apache.maven.doxia.book.services.renderer.xdoc;
+
+/*
+ * 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.Writer;
+import java.util.Locale;
+
+import org.apache.maven.doxia.index.IndexEntry;
+import org.codehaus.plexus.i18n.I18N;
+
+/**
+ * A <code>XdocSink</code> implementation for section in a book
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class SectionXdocBookSink
+ extends AbstractXdocBookSink
+{
+ /** indexEntry. */
+ private final IndexEntry indexEntry;
+
+ /**
+ * Default constructor.
+ *
+ * @param out the Writer to use.
+ * @param indexEntry the IndexEntry.
+ * @param i18n the I18N.
+ * @param locale wanted locale.
+ */
+ public SectionXdocBookSink( Writer out, IndexEntry indexEntry, I18N i18n, Locale locale )
+ {
+ super( out, i18n, locale );
+
+ this.indexEntry = indexEntry;
+ }
+
+ /** {@inheritDoc} */
+ protected void navigationPanel()
+ {
+ write( "<!--Navigation Panel-->" );
+
+ write( "<table width=\"100%\" align=\"center\" border=\"0\">" );
+ write( "<tr>" );
+
+ IndexEntry parent = indexEntry.getParent();
+
+ // -----------------------------------------------------------------------
+ // Prev
+ // -----------------------------------------------------------------------
+
+ IndexEntry prevEntry = indexEntry.getPrevEntry();
+
+ write( "<td align=\"left\">" );
+
+ previous( parent, prevEntry );
+
+ write( "</td>" );
+
+ // -----------------------------------------------------------------------
+ // Parent
+ // -----------------------------------------------------------------------
+
+ write( "<td align=\"center\">" );
+ up( parent );
+ write( "</td>" );
+
+ // -----------------------------------------------------------------------
+ // Next
+ // -----------------------------------------------------------------------
+
+ IndexEntry nextEntry = indexEntry.getNextEntry();
+
+ write( "<td align=\"right\">" );
+
+ next( parent, nextEntry );
+
+ write( "</td>" );
+
+ write( "</tr>" );
+ write( "</table>" );
+
+ write( "<!--End of Navigation Panel-->" );
+ }
+
+ /**
+ * Add previous link.
+ *
+ * @param parent the parent IndexEntry.
+ * @param prevEntry the previous IndexEntry.
+ */
+ protected void previous( IndexEntry parent, IndexEntry prevEntry )
+ {
+ if ( prevEntry != null )
+ {
+ write( getString( "previous" ) + ": <a href=\"" + prevEntry.getId() + ".html\">" );
+ content( prevEntry.getTitle() );
+ write( "</a>" );
+ }
+ else
+ {
+ write( getString( "previous" ) + ": <a href=\"" + parent.getId() + ".html\">" );
+ content( parent.getTitle() );
+ write( "</a>" );
+ }
+ }
+
+ /**
+ * Add parent/up link.
+ *
+ * @param parent the parent IndexEntry.
+ * @see org.apache.maven.doxia.book.services.renderer.xdoc.ChapterXdocBookSink#up()
+ */
+ protected void up( IndexEntry parent )
+ {
+ write( getString( "up" ) + ": <a href=\"" + parent.getId() + ".html\">" + parent.getTitle() + "</a>" );
+ }
+
+ /**
+ * Add next link.
+ *
+ * @param parent the parent IndexEntry.
+ * @param nextEntry the next IndexEntry.
+ */
+ protected void next( IndexEntry parent, IndexEntry nextEntry )
+ {
+ if ( nextEntry != null )
+ {
+ write( getString( "next" ) + ": <a href=\"" + nextEntry.getId() + ".html\">" );
+ content( nextEntry.getTitle() );
+ write( "</a>" );
+ }
+ else
+ {
+ IndexEntry nextChapter = parent.getNextEntry();
+
+ if ( nextChapter == null )
+ {
+ write( "<i>End of book</i>" );
+ }
+ else
+ {
+ write( getString( "next" ) + ": <a href=\"" + nextChapter.getId() + ".html\">" );
+ content( nextChapter.getTitle() );
+ write( "</a>" );
+ }
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/xhtml/XhtmlBookSink.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/xhtml/XhtmlBookSink.java
new file mode 100644
index 0000000..a6b823e
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/xhtml/XhtmlBookSink.java
@@ -0,0 +1,248 @@
+package org.apache.maven.doxia.book.services.renderer.xhtml;
+
+/*
+ * 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 org.apache.maven.doxia.module.xhtml.XhtmlSink;
+import org.apache.maven.doxia.sink.render.RenderingContext;
+import org.codehaus.plexus.util.StringUtils;
+
+import java.io.Writer;
+
+/**
+ * An Xhtml Sink that doesn't write out head or body elements.
+ *
+ * @author ltheussl
+ * @version $Id$
+ */
+public class XhtmlBookSink
+ extends XhtmlSink
+{
+ private RenderingContext renderingContext;
+
+ /**
+ * Construct a new XhtmlBookSink.
+ *
+ * @param out the writer for the sink.
+ * @param context the RenderingContext.
+ */
+ public XhtmlBookSink( Writer out, RenderingContext context )
+ {
+ super( out );
+ this.renderingContext = context;
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing.
+ */
+ public void head()
+ {
+ init();
+
+ setHeadFlag( true );
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing.
+ */
+ public void head_()
+ {
+ setHeadFlag( false );
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing.
+ */
+ public void title()
+ {
+ // noop
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing.
+ */
+ public void title_()
+ {
+ resetTextBuffer();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing.
+ */
+ public void author_()
+ {
+ resetTextBuffer();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing.
+ */
+ public void date_()
+ {
+ resetTextBuffer();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing.
+ */
+ public void body()
+ {
+ // noop
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Does nothing.
+ */
+ public void body_()
+ {
+ // noop
+ }
+
+ /**
+ * Calls super.head().
+ */
+ public void bookHead()
+ {
+ super.head();
+ }
+
+ /**
+ * Calls super.head_().
+ */
+ public void bookHead_()
+ {
+ super.head_();
+ }
+
+ /**
+ * Calls super.title().
+ */
+ public void bookTitle()
+ {
+ super.title();
+ }
+
+ /**
+ * Calls super.title_().
+ */
+ public void bookTitle_()
+ {
+ super.title_();
+ }
+
+ /**
+ * Calls super.author().
+ */
+ public void bookAuthor()
+ {
+ super.author();
+ }
+
+ /**
+ * Calls super.author_().
+ */
+ public void bookAuthor_()
+ {
+ super.author_();
+ }
+
+ /**
+ * Calls super.date().
+ */
+ public void bookDate()
+ {
+ super.date();
+ }
+
+ /**
+ * Calls super.date_().
+ */
+ public void bookDate_()
+ {
+ super.date_();
+ }
+
+ /**
+ * Calls super.body().
+ */
+ public void bookBody()
+ {
+ super.body();
+ }
+
+ /**
+ * Calls super.body_().
+ */
+ public void bookBody_()
+ {
+ super.body_();
+ }
+
+ /** {@inheritDoc} */
+ public void sectionTitle()
+ {
+ writeStartTag( H1 );
+ }
+
+ /** {@inheritDoc} */
+ public void sectionTitle_()
+ {
+ writeEndTag( H1 );
+ }
+
+ /** {@inheritDoc} */
+ protected void write( String text )
+ {
+ if ( renderingContext != null )
+ {
+ String relativePathToBasedir = renderingContext.getRelativePath();
+
+ if ( relativePathToBasedir == null )
+ {
+ text = StringUtils.replace( text, "$relativePath", "." );
+ }
+ else
+ {
+ text = StringUtils.replace( text, "$relativePath", relativePathToBasedir );
+ }
+ }
+
+ super.write( text );
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/validation/BookValidator.java b/src/main/java/org/apache/maven/doxia/book/services/validation/BookValidator.java
new file mode 100644
index 0000000..878300d
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/validation/BookValidator.java
@@ -0,0 +1,42 @@
+package org.apache.maven.doxia.book.services.validation;
+
+/*
+ * 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 org.apache.maven.doxia.book.model.BookModel;
+
+/**
+ * Ensure a BookModel is valid.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public interface BookValidator
+{
+ /** The plexus lookup role. */
+ String ROLE = BookValidator.class.getName();
+
+ /**
+ * Validate a BookModel.
+ *
+ * @param book the BookModel to validate.
+ * @return ValidationResult
+ */
+ ValidationResult validateBook( BookModel book );
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java b/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java
new file mode 100644
index 0000000..19a06ec
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java
@@ -0,0 +1,104 @@
+package org.apache.maven.doxia.book.services.validation;
+
+/*
+ * 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 org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.StringUtils;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.model.Chapter;
+
+/**
+ * Default implementation of BookValidator.
+ *
+ * @plexus.component
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class DefaultBookValidator
+ extends AbstractLogEnabled
+ implements BookValidator
+{
+ // ----------------------------------------------------------------------
+ // BookValidator Implementation
+ // ----------------------------------------------------------------------
+
+ /** {@inheritDoc} */
+ public ValidationResult validateBook( BookModel book )
+ {
+ ValidationResult result = new ValidationResult();
+
+ if ( StringUtils.isEmpty( book.getId() ) )
+ {
+ result.getErrors().add( "Book is missing id." );
+ }
+
+ if ( StringUtils.isEmpty( book.getTitle() ) )
+ {
+ result.getErrors().add( "Book is missing title." );
+ }
+
+ if ( book.getChapters().size() == 0 )
+ {
+ result.getErrors().add( "The book must have at least one chaper" );
+ }
+ else
+ {
+ for ( Chapter chapter : book.getChapters() )
+ {
+ validateChapter( result, chapter );
+
+ // TODO: Validate the chapter id
+ }
+ }
+
+ return result;
+ }
+
+ // ----------------------------------------------------------------------
+ // Private
+ // ----------------------------------------------------------------------
+
+ /**
+ * Validate a Chapter.
+ *
+ * @param result the ValidationResult to receive the results.
+ * @param chapter the chapter to validate.
+ */
+ private void validateChapter( ValidationResult result, Chapter chapter )
+ {
+ if ( StringUtils.isEmpty( chapter.getId() ) )
+ {
+ result.getErrors().add( "Each chapter has to have an id." );
+
+ return;
+ }
+
+ if ( StringUtils.isEmpty( chapter.getTitle() ) )
+ {
+ result.getErrors().add( "Missing title. Chapter id: " + chapter.getId() );
+ }
+
+ if ( chapter.getSections().size() == 0 )
+ {
+ result.getErrors().add( "Chapter doesn't have any sections. Chapter id: " + chapter.getId() );
+ }
+ }
+}
diff --git a/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java b/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java
new file mode 100644
index 0000000..47e218c
--- /dev/null
+++ b/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java
@@ -0,0 +1,78 @@
+package org.apache.maven.doxia.book.services.validation;
+
+/*
+ * 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.util.List;
+import java.util.ArrayList;
+
+/**
+ * Encapsulates the result of a validation.
+ *
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class ValidationResult
+{
+ /** List of errors. */
+ private List<String> errors;
+
+ /** List of warnings. */
+ private List<String> warnings;
+
+ /**
+ * Checks if there were any errors or warnings.
+ *
+ * @return True if there were no errors or warnings.
+ */
+ public boolean isAllOk()
+ {
+ return getErrors().size() == 0 && getWarnings().size() == 0;
+ }
+
+ /**
+ * Return the list of errors.
+ *
+ * @return List. A new ArrayList is constructed if the current List is null.
+ */
+ public List<String> getErrors()
+ {
+ if ( errors == null )
+ {
+ errors = new ArrayList<String>();
+ }
+
+ return errors;
+ }
+
+ /**
+ * Return the list of warnings.
+ *
+ * @return List. A new ArrayList is constructed if the current List is null.
+ */
+ public List<String> getWarnings()
+ {
+ if ( warnings == null )
+ {
+ warnings = new ArrayList<String>();
+ }
+
+ return warnings;
+ }
+}
diff --git a/src/main/modello/book.mdo b/src/main/modello/book.mdo
new file mode 100644
index 0000000..13068f6
--- /dev/null
+++ b/src/main/modello/book.mdo
@@ -0,0 +1,537 @@
+<?xml version="1.0"?>
+
+<!--
+ 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.
+-->
+
+<model xmlns="http://modello.codehaus.org/MODELLO/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.0.0 http://modello.codehaus.org/xsd/modello-1.0.0.xsd"
+ xml.namespace="http://maven.apache.org/BOOK/${version}">
+ <id>book</id>
+ <name>BookModel</name>
+ <description>
+ <![CDATA[
+ <p>
+ This descriptor specifies the metadatas and the content for a book.
+ </p>
+ <p>
+ A book is defined by a collection of chapters, a chapter by a
+ collection of sections, a section by a file.
+ </p>
+ <p>An XSD is available at:</p>
+ <ul>
+ <li><a href="http://maven.apache.org/xsd/book-1.0.0.xsd">http://maven.apache.org/xsd/book-1.0.0.xsd</a>.</li>
+ </ul>
+ ]]>
+ </description>
+ <defaults>
+ <default>
+ <key>package</key>
+ <value>org.apache.maven.doxia.book.model</value>
+ </default>
+ </defaults>
+ <classes>
+ <class rootElement="true" xml.tagName="book">
+ <name>BookModel</name>
+ <description>
+ Describes the book layout and packaging.
+ </description>
+ <version>1.0.0</version>
+ <fields>
+ <field>
+ <name>id</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ <description>
+ Specifies the id of this book. This is a symbolic name for a
+ particular book from this project.
+ </description>
+ </field>
+ <field>
+ <name>title</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description>
+ Specifies the title of this book.
+ </description>
+ </field>
+ <field>
+ <name>author</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description>
+ Specifies the author of this book.
+ </description>
+ </field>
+ <field>
+ <name>date</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description>
+ Specifies the date of this book.
+ </description>
+ </field>
+ <field>
+ <name>chapters</name>
+ <version>1.0.0</version>
+ <description>
+ Specifies a collection of chapters.
+ </description>
+ <association>
+ <type>Chapter</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+<!--
+ <field>
+ <name>bannerLeft</name>
+ <description>Banner logo on the masthead of the site to the left.</description>
+ <version>1.0.0</version>
+ <association>
+ <type>Banner</type>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>bannerRight</name>
+ <description>Banner logo on the masthead of the site to the right.</description>
+ <version>1.0.0</version>
+ <association>
+ <type>Banner</type>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>publishDate</name>
+ <description>Modify the date published display properties.</description>
+ <version>1.0.0</version>
+ <association>
+ <type>PublishDate</type>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>version</name>
+ <description>Modify the version display properties.</description>
+ <version>1.0.0</version>
+ <association>
+ <type>Version</type>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>poweredBy</name>
+ <description>Powered by logos.</description>
+ <version>1.0.0</version>
+ <association xml.tagName="logo">
+ <type>Logo</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>skin</name>
+ <description>The artifact containing the skin for the site</description>
+ <version>1.0.0</version>
+ <association>
+ <type>Skin</type>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>body</name>
+ <description>The main site content decoration.</description>
+ <version>1.0.0</version>
+ <association>
+ <type>Body</type>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>custom</name>
+ <description>Custom configuration for use with customised velocity templates.</description>
+ <version>1.0.0</version>
+ <type>DOM</type>
+ <identifier>true</identifier>
+ </field>
+-->
+ </fields>
+ </class>
+ <class>
+ <name>Chapter</name>
+ <version>1.0.0</version>
+ <fields>
+ <field>
+ <name>id</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ <description>
+ Specifies the id of this chapter. This is a symbolic name for a
+ particular chapter.
+ </description>
+ </field>
+ <field>
+ <name>title</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description>
+ Specifies the title of this chapter.
+ </description>
+ </field>
+ <field>
+ <name>sections</name>
+ <version>1.0.0</version>
+ <description>
+ Specifies a collection of sections.
+ </description>
+ <association>
+ <type>Section</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>Section</name>
+ <version>1.0.0</version>
+ <fields>
+ <field>
+ <name>id</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ <description>
+ Specifies the id of this section. This is a symbolic name for a
+ particular section.
+ </description>
+ </field>
+ <field>
+ <name>title</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description>
+ Specifies the title of this section.
+ </description>
+ </field>
+ <field>
+ <name>file</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description>
+ Specifies the file of this section.
+ </description>
+ </field>
+ </fields>
+ </class>
+<!--
+ <class>
+ <name>Banner</name>
+ <description>A banner logo on the masthead of the site.</description>
+ <version>1.0.0</version>
+ <fields>
+ <field>
+ <name>name</name>
+ <version>1.0.0</version>
+ <description>Description of the banner.</description>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>src</name>
+ <version>1.0.0</version>
+ <description>The href of an image for the banner</description>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>alt</name>
+ <version>1.0.0</version>
+ <description>Alt description for the banner image.</description>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>href</name>
+ <version>1.0.0</version>
+ <description>The href of a link to use for the banner</description>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>PublishDate</name>
+ <description>Modify display properties for date published.</description>
+ <version>1.0.0</version>
+ <fields>
+ <field xml.attribute="true">
+ <name>position</name>
+ <description>Where to place the date published (left, right, navigation-top, navigation-bottom,
+ bottom).</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field xml.attribute="true">
+ <name>format</name>
+ <description>Date format to use. The default is MM/dd/yyyy.</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>Version</name>
+ <description>Modify display properties for version.</description>
+ <version>1.0.0</version>
+ <fields>
+ <field xml.attribute="true">
+ <name>position</name>
+ <description>Where to place the date published (left, right, navigation-top, navigation-bottom,
+ bottom).</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>Logo</name>
+ <description>Logo.</description>
+ <version>1.0.0</version>
+ <superClass>LinkItem</superClass>
+ <fields>
+ <field xml.attribute="true">
+ <name>img</name>
+ <description>Logo image href.</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>Body</name>
+ <description>The main content decoration.</description>
+ <version>1.0.0</version>
+ <fields>
+ <field>
+ <name>head</name>
+ <description>Additional content to include in the HEAD block of the generated pages.</description>
+ <version>1.0.0</version>
+ <type>DOM</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>links</name>
+ <description>A list of links to display in the navigation.</description>
+ <version>1.0.0</version>
+ <association xml.tagName="item">
+ <type>LinkItem</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>breadcrumbs</name>
+ <description>A list of breadcrumbs to display in the navigation.</description>
+ <version>1.0.0</version>
+ <association xml.tagName="item">
+ <type>LinkItem</type>
+ <multiplicity>*</multiplicity>
+ <identifier>true</identifier>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>menus</name>
+ <description>Menus to include in the navigation.</description>
+ <version>1.0.0</version>
+ <association xml.itemsStyle="flat">
+ <type>Menu</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>LinkItem</name>
+ <description>A link in the navigation.</description>
+ <version>1.0.0</version>
+ <fields>
+ <field xml.attribute="true">
+ <name>name</name>
+ <description>The name to use for the link.</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field xml.attribute="true">
+ <name>href</name>
+ <description>The href to use for the link.</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>Menu</name>
+ <description>A menu in the navigation.</description>
+ <version>1.0.0</version>
+ <fields>
+ <field xml.attribute="true">
+ <name>name</name>
+ <description>The name to use for the menu.</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field xml.attribute="true">
+ <name>inherit</name>
+ <description>The way in which the menu is inherited.</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field xml.attribute="true">
+ <name>inheritAsRef</name>
+ <description>If this is a reference, setting inheritAsRef means that it will be populated in the project,
+ whereas if it is false it is populated in the parent and then inherited.</description>
+ <version>1.0.0</version>
+ <type>boolean</type>
+ </field>
+ <field xml.attribute="true">
+ <name>ref</name>
+ <description><![CDATA[A reference to a pre-defined menu, such as a <code>reports</code>, <code>modules</code>
+ or <code>parentProject</code>.]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field xml.attribute="true">
+ <name>img</name>
+ <description>Image href.</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>items</name>
+ <description>Menu item.</description>
+ <version>1.0.0</version>
+ <association xml.itemsStyle="flat">
+ <type>MenuItem</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>MenuItem</name>
+ <description>A menu item.</description>
+ <version>1.0.0</version>
+ <superClass>LinkItem</superClass>
+ <fields>
+ <field>
+ <name>description</name>
+ <description>A description of the menu item. This is used on any summary pages for a menu.</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field xml.attribute="true">
+ <name>collapse</name>
+ <description>Whether the item is collapsed by default when it has children elements.</description>
+ <version>1.0.0</version>
+ <type>boolean</type>
+ <identifier>true</identifier>
+ </field>
+ <field xml.attribute="true">
+ <name>ref</name>
+ <description><![CDATA[A reference to a pre-defined menu item, such as a report (specified by the report goal
+ name). Any elements explicitly given override those from the pre-defined reference.]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>items</name>
+ <description>Menu item.</description>
+ <version>1.0.0</version>
+ <association xml.itemsStyle="flat">
+ <type>MenuItem</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <identifier>true</identifier>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>Skin</name>
+ <description>An skin artifact declaration</description>
+ <version>1.0.0</version>
+ <fields>
+ <field>
+ <name>groupId</name>
+ <description>The group ID</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <required>true</required>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>artifactId</name>
+ <description>The artifact ID</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <required>true</required>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>version</name>
+ <description>The version</description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ </fields>
+ <codeSegments>
+ <codeSegment>
+ <version>1.0.0</version>
+ <code>
+ <![CDATA[
+ public static Skin getDefaultSkin()
+ {
+ Skin skin = new Skin();
+ skin.setGroupId( "org.apache.maven.skins" );
+ skin.setArtifactId( "maven-default-skin" );
+ return skin;
+ }
+ ]]>
+ </code>
+ </codeSegment>
+ </codeSegments>
+ </class>
+-->
+ </classes>
+</model>
diff --git a/src/main/resources/book-renderer.properties b/src/main/resources/book-renderer.properties
new file mode 100644
index 0000000..9369897
--- /dev/null
+++ b/src/main/resources/book-renderer.properties
@@ -0,0 +1,21 @@
+# 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.
+
+toc=Table Of Content
+previous=Previous
+up=Up
+next=Next
diff --git a/src/main/resources/book-renderer_en.properties b/src/main/resources/book-renderer_en.properties
new file mode 100644
index 0000000..0c479bc
--- /dev/null
+++ b/src/main/resources/book-renderer_en.properties
@@ -0,0 +1,23 @@
+# 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.
+
+# NOTE:
+# This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It
+# must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the
+# JVM's default locale (which need not be "en"). See the method javadoc about
+# ResourceBundle.getBundle(String, Locale, ClassLoader)
+# for a full description of the lookup strategy.
diff --git a/src/main/resources/book-renderer_fr.properties b/src/main/resources/book-renderer_fr.properties
new file mode 100644
index 0000000..385696e
--- /dev/null
+++ b/src/main/resources/book-renderer_fr.properties
@@ -0,0 +1,21 @@
+# 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.
+
+toc=Table des mati�res
+previous=Pr�c�dent
+up=Haut
+next=Suivant
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
new file mode 100644
index 0000000..968e955
--- /dev/null
+++ b/src/site/apt/index.apt
@@ -0,0 +1,20 @@
+ -----
+ Writing Books in Doxia
+ -----
+ Lukas Theussl
+ -----
+
+Introduction
+
+ Doxia allows you to write books like user manuals and guides in any format supported by Doxia. Combined with the
+ Doxia Book Maven you are able to include the manuals directly in your generated site with links to the off-line
+ friendly formats like XDoc, PDF, RTF and LaTeX.
+
+* How It Works
+
+ The only thing you need in addition to the content files itself is a simple book descriptor which is used to specify
+ the ordering of the sections and the names for the chapters.
+
+ See {{{./book.html}The Book Descriptor Reference}} for a reference to the descriptor. A sample is given on the
+ main Doxia {{{http://maven.apache.org/doxia/book/index.html}site}}.
+
diff --git a/src/site/apt/usage.apt b/src/site/apt/usage.apt
new file mode 100644
index 0000000..e90d983
--- /dev/null
+++ b/src/site/apt/usage.apt
@@ -0,0 +1,31 @@
+ -----
+ Usage
+ -----
+ Lukas Theussl
+ -----
+
+Usage
+
+ Below is a simple example to illustrate how to use it.
+
++------------------------------------------------------
+ BookDoxia doxia = (BookDoxia) lookup( BookDoxia.ROLE );
+
+ // load the book descriptor
+ File book1 = new File( "book-1.xml" );
+
+ BookModel book = doxia.loadBook( book1 );
+
+ // files to include
+ List files = FileUtils.getFiles( new File( "src/resources/book/" ), "**/*.apt, **/*.xml", "" );
+
+ // render books in different formats
+ doxia.renderBook( book, "pdf", files, new File( "target/itext/" ) );
+ doxia.renderBook( book, "xhtml", files, new File( "target/xhtml/" ) );
+ doxia.renderBook( book, "xdoc", files, new File( "target/xdoc/" ) );
+ doxia.renderBook( book, "latex", files, new File( "target/latex/" ) );
+ doxia.renderBook( book, "doc-book", files, new File( "target/doc-book/" ) );
+ doxia.renderBook( book, "rtf", files, new File( "target/rtf/" ) );
++------------------------------------------------------
+
+ See the {{{./apidocs/index.html}Javadocs}} for more details.
diff --git a/src/site/apt/using-book-xsd.apt b/src/site/apt/using-book-xsd.apt
new file mode 100644
index 0000000..1c3fdc9
--- /dev/null
+++ b/src/site/apt/using-book-xsd.apt
@@ -0,0 +1,41 @@
+ -----
+ Using Schema Book 1.0
+ -----
+ Vincent Siveton
+ ------
+ 2009-01-28
+ ------
+
+~~ 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.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Using Schema Book 1.0
+
+ The Decoration XSD is located {{{http://maven.apache.org/xsd/book-1.0.0.xsd}here}}.
+
+ Your favorite IDE probably supports XSD schema's for .xml files. You need to specify the following:
+
++-----+
+<book xmlns="http://maven.apache.org/BOOK/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/BOOK/1.0.0 http://maven.apache.org/xsd/book-1.0.0.xsd">
+...
+</book>
++-----+
diff --git a/src/site/site.xml b/src/site/site.xml
new file mode 100644
index 0000000..cc6f0cd
--- /dev/null
+++ b/src/site/site.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * 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.
+ */
+ -->
+
+<project xmlns="http://maven.apache.org/DECORATION/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd">
+
+ <body>
+
+ <menu ref="parent"/>
+
+ <menu name="About Doxia :: Book Components">
+ <item name="Introduction" href="index.html"/>
+ <item name="Usage" href="usage.html"/>
+ <item name="JavaDocs" href="apidocs/index.html"/>
+ <item name="Source Xref" href="xref/index.html"/>
+ <!--item name="FAQ" href="faq.html"/-->
+ </menu>
+
+ <menu name="Book Schema">
+ <item name="Reference" href="book.html"/>
+ <item name="Using Book Schema" href="using-book-xsd.html"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ </body>
+
+</project>
diff --git a/src/test/java/org/apache/maven/doxia/book/BookRendererTest.java b/src/test/java/org/apache/maven/doxia/book/BookRendererTest.java
new file mode 100644
index 0000000..b445a97
--- /dev/null
+++ b/src/test/java/org/apache/maven/doxia/book/BookRendererTest.java
@@ -0,0 +1,75 @@
+package org.apache.maven.doxia.book;
+
+/*
+ * 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 org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.StringUtils;
+import org.apache.maven.doxia.book.model.BookModel;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class BookRendererTest
+ extends PlexusTestCase
+{
+ public void testBasic()
+ throws Exception
+ {
+ BookDoxia doxia = (BookDoxia) lookup( BookDoxia.ROLE );
+
+ File book1 = getTestFile( "src/test/resources/book-1.xml" );
+
+ List files = FileUtils.getFiles( getTestFile( "src/test/resources/book-1" ), "**/*.apt, **/*.xml", "" );
+
+ BookModel book = doxia.loadBook( book1 );
+
+ doxia.renderBook( book, "pdf", files, getTestFile( "target/test-output/itext" ) );
+ doxia.renderBook( book, "xhtml", files, getTestFile( "target/test-output/xhtml" ) );
+ doxia.renderBook( book, "xdoc", files, getTestFile( "target/test-output/xdoc" ) );
+ doxia.renderBook( book, "latex", files, getTestFile( "target/test-output/latex" ) );
+ doxia.renderBook( book, "doc-book", files, getTestFile( "target/test-output/doc-book" ) );
+ doxia.renderBook( book, "rtf", files, getTestFile( "target/test-output/rtf" ) );
+
+ assertCorrectDocbook();
+ }
+
+ /**
+ * Regression test for the docbook output.
+ */
+ private void assertCorrectDocbook()
+ throws Exception
+ {
+ String expected =
+ FileUtils.fileRead( getTestFile( "src/test/resources/expected/doc-book/plexus-user-guide.xml" ) );
+ expected = StringUtils.deleteWhitespace( expected );
+
+ String actual =
+ FileUtils.fileRead( getTestFile( "target/test-output/doc-book/plexus-user-guide.xml" ) );
+ actual = StringUtils.deleteWhitespace( actual );
+
+ assertEquals( "Wrong docbook output!",
+ StringUtils.replace( expected, "\r", "" ), StringUtils.replace( actual, "\r", "" ) );
+ }
+}
diff --git a/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java b/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java
new file mode 100644
index 0000000..1a293ad
--- /dev/null
+++ b/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java
@@ -0,0 +1,118 @@
+package org.apache.maven.doxia.book.services.indexer;
+
+/*
+ * 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 org.apache.maven.doxia.book.context.BookContext;
+import org.apache.maven.doxia.book.model.BookModel;
+import org.apache.maven.doxia.book.services.io.BookIo;
+import org.apache.maven.doxia.index.IndexEntry;
+import org.apache.maven.doxia.util.HtmlTools;
+import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.util.FileUtils;
+
+/**
+ * @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class BookIndexerTest
+ extends PlexusTestCase
+{
+ public void testBasic()
+ throws Exception
+ {
+ BookIo io = (BookIo) lookup( BookIo.ROLE );
+
+ BookIndexer indexer = (BookIndexer) lookup( BookIndexer.ROLE );
+
+ BookModel book = io.readBook( getTestFile( "src/test/resources/book-1.xml" ) );
+
+ BookContext context = new BookContext();
+
+ io.loadFiles( context, FileUtils.getFiles( getTestFile( "src/test/resources/book-1" ), "*.apt", "" ) );
+
+ indexer.indexBook( book, context );
+
+ IndexEntry root = context.getIndex();
+
+ assertNotNull( root );
+
+ assertEquals( 2, root.getChildEntries().size() );
+
+ IndexEntry c1 = assertIndexEntry( root, 0, "Chapter 1", "chapter-1", 2 );
+
+ // -----------------------------------------------------------------------
+ // Section 1
+ // -----------------------------------------------------------------------
+
+ IndexEntry s1 = assertIndexEntry( c1, 0, "Section 1", "section-1", 5 );
+
+ IndexEntry ss1 = assertIndexEntry( s1, 0, "Subsection 1", "Subsection_1", 1 );
+
+ assertIndexEntry( ss1, 0, "Subsubsection 1", "Subsubsection_1", 0 );
+
+ assertIndexEntry( s1, 1, "Subsection 2", "Subsection_2", 0 );
+
+ assertIndexEntry( s1, 2, "Subsection 3", "Subsection_3", 0 );
+
+ assertIndexEntry( s1, 3, "Subsection 4", "Subsection_4", 0 );
+
+ // -----------------------------------------------------------------------
+ // Section 2
+ // -----------------------------------------------------------------------
+
+ IndexEntry s2 = assertIndexEntry( c1, 1, "Section 2", "section-2", 1 );
+
+ assertIndexEntry( s2, 0, "Section 1.10.32 of \"de Finibus Bonorum et Malorum\", written by Cicero in 45 BC",
+ "Section_1.10.32_of_\"de_Finibus_Bonorum_et_Malorum\",_written_by_Cicero_in_45_BC", 0 );
+
+ // -----------------------------------------------------------------------
+ // Chapter 2
+ // -----------------------------------------------------------------------
+
+ IndexEntry c2 = assertIndexEntry( root, 1, "Chapter 2", "chapter-2", 2 );
+
+ IndexEntry s3 = assertIndexEntry( c2, 0, "Section 3", "section-3", 1 );
+
+ assertIndexEntry( s3, 0, "1914 translation by H. Rackham", "1914_translation_by_H._Rackham", 0 );
+
+ IndexEntry s4 = assertIndexEntry( c2, 1, "Section 4", "section-4", 1 );
+
+ assertIndexEntry( s4, 0, "Section 1.10.33 of \"de Finibus Bonorum et Malorum\", written by Cicero in 45 BC",
+ "Section_1.10.33_of_\"de_Finibus_Bonorum_et_Malorum\",_written_by_Cicero_in_45_BC", 0 );
+ }
+
+ private IndexEntry assertIndexEntry( IndexEntry parent, int childIndex, String title, String id, int childCount )
+ {
+ assertTrue( "parent: " + parent.getId() + ", " +
+ "required count: " + childCount + ", " +
+ "actual count: " + parent.getChildEntries().size(),
+ childIndex < parent.getChildEntries().size() );
+
+ IndexEntry indexEntry = (IndexEntry) parent.getChildEntries().get( childIndex );
+
+ assertEquals( title, indexEntry.getTitle() );
+
+ assertEquals( HtmlTools.encodeId( id ), indexEntry.getId() );
+
+ assertEquals( childCount, indexEntry.getChildEntries().size() );
+
+ return indexEntry;
+ }
+}
diff --git a/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java b/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java
new file mode 100644
index 0000000..6a4de45
--- /dev/null
+++ b/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java
@@ -0,0 +1,490 @@
+package org.apache.maven.doxia.book.services.renderer.docbook;
+
+/*
+ * 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.Writer;
+
+import java.util.Locale;
+
+import javax.swing.text.MutableAttributeSet;
+import javax.swing.text.SimpleAttributeSet;
+
+import org.apache.maven.doxia.module.docbook.DocBookSink;
+import org.apache.maven.doxia.sink.AbstractSinkTest;
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkUtils;
+
+import org.apache.maven.doxia.util.DoxiaUtils;
+import org.codehaus.plexus.util.FileUtils;
+
+/**
+ * Test the book path of the DockBook sink
+ * @author Dave Syer
+ */
+public class DocBookBookSinkTest extends AbstractSinkTest
+{
+ /** {@inheritDoc} */
+ protected boolean isXmlSink()
+ {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ protected String outputExtension()
+ {
+ return "docbook";
+ }
+
+ /** {@inheritDoc} */
+ protected Sink createSink( Writer writer )
+ {
+ return new DocBookBookSink( writer );
+ }
+
+ //
+ // DocBookBookSink specific
+ //
+
+ /**
+ * Checks that the sequence <code>[bookTitle(), text( title ), bookTitle_()]</code>,
+ * invoked on the current sink, produces the same result as
+ * {@link #getBookTitleBlock getBookTitleBlock}( title ).
+ * NewLines are ignored.
+ */
+ public void testBookTitle()
+ {
+ DocBookBookSink sink = (DocBookBookSink) getSink();
+
+ String title = "Grodek";
+ sink.bookTitle();
+ sink.text( title );
+ sink.bookTitle_();
+ sink.flush();
+
+ String actual = getSinkContent();
+ String expected = getBookTitleBlock( title );
+
+ assertEquals( "Wrong book title!", expected, actual );
+ }
+
+ /**
+ * Checks that the sequence <code>[bookAuthor(), text( author ), bookAuthor_()]
+ * </code>, invoked on the current sink, produces the same result as
+ * {@link #getBookAuthorBlock getBookAuthorBlock}( author ).
+ * NewLines are ignored.
+ */
+ public void testBookAuthor()
+ {
+ DocBookBookSink sink = (DocBookBookSink) getSink();
+
+ String author = "Georg Trakl";
+ sink.bookAuthor();
+ sink.text( author );
+ sink.bookAuthor_();
+ sink.flush();
+
+ String actual = getSinkContent();
+ String expected = getBookAuthorBlock( author );
+
+ assertEquals( "Wrong book author!", expected, actual );
+ }
+
+ /**
+ * Checks that the sequence <code>[bookDate(), text( date ), bookDate_()]</code>,
+ * invoked on the current sink, produces the same result as
+ * {@link #getBookDateBlock getBookDateBlock}( date ). NewLines are ignored.
+ */
+ public void testBookDate()
+ {
+ DocBookBookSink sink = (DocBookBookSink) getSink();
+
+ String date = "1914";
+ sink.bookDate();
+ sink.text( date );
+ sink.bookDate_();
+ sink.flush();
+
+ String actual = getSinkContent();
+ String expected = getBookDateBlock( date );
+
+ assertEquals( "Wrong book date!", expected, actual );
+ }
+
+ /**
+ * Checks that the sequence <code>[bookHead(), bookHead_()]</code>,
+ * invoked on the current sink, produces the same result as
+ * {@link #getBookHeadBlock getBookHeadBlock()}. NewLines are ignored.
+ */
+ public void testBookHead()
+ {
+ DocBookBookSink sink = (DocBookBookSink) getSink();
+
+ //sink.bookHead();
+ sink.bookHead_();
+ sink.flush();
+
+ String actual = getSinkContent();
+ String expected = getBookHeadBlock();
+
+ assertEquals( "Wrong book head!", expected, actual );
+ }
+
+ /**
+ * Checks that the sequence <code>[book(), book_()]</code>,
+ * invoked on the current sink, produces the same result as
+ * {@link #getBookBlock getBookBlock()}. NewLines are ignored.
+ */
+ public void testBook()
+ {
+ DocBookBookSink sink = (DocBookBookSink) getSink();
+
+ sink.book();
+ sink.book_();
+ sink.flush();
+
+ String actual = getSinkContent();
+ String expected = getBookBlock();
+
+ assertEquals( "Wrong book body!", expected, actual );
+ }
+
+ /**
+ * Checks that the sequence <code>[chapterTitle(), text( title ),
+ * chapterTitle_()]</code>, invoked on the current sink, produces
+ * the same result as
+ * {@link #getChapterTitleBlock getChapterTitleBlock}( title ).
+ * NewLines are ignored.
+ */
+ public void testChapterTitle()
+ {
+ DocBookBookSink sink = (DocBookBookSink) getSink();
+
+ String title = "Title";
+ sink.chapterTitle();
+ sink.text( title );
+ sink.chapterTitle_();
+ sink.flush();
+
+ String actual = getSinkContent();
+ String expected = getChapterTitleBlock( title );
+
+ assertEquals( "Wrong chapterTitle!", expected, actual );
+ }
+
+ /**
+ * Checks that the sequence <code>[chapter(), chapter_()]</code>,
+ * invoked on the current sink, produces the same result as
+ * {@link #getChapterBlock getChapterBlock}().
+ * NewLines are ignored.
+ */
+ public void testChapter()
+ {
+ DocBookBookSink sink = (DocBookBookSink) getSink();
+
+ sink.chapter();
+ sink.chapter_();
+ sink.flush();
+
+ String actual = getSinkContent();
+ String expected = getChapterBlock();
+
+ assertEquals( "Wrong chapter block!", expected, actual );
+ }
+
+ /**
+ * Returns a title block generated by this sink.
+ * @param title The title to use.
+ * @return The result of invoking a title block on the current sink.
+ * @see #testBookTitle()
+ */
+ protected String getBookTitleBlock( String title )
+ {
+ return "<bookinfo><title>" + title + "</title>";
+ }
+
+ /**
+ * Returns an author block generated by this sink.
+ * @param author The author to use.
+ * @return The result of invoking an author block on the current sink.
+ * @see #testBookAuthor()
+ */
+ protected String getBookAuthorBlock( String author )
+ {
+ return "<bookinfo><corpauthor>" + author + "</corpauthor>";
+ }
+
+ /**
+ * Returns a date block generated by this sink.
+ * @param date The date to use.
+ * @return The result of invoking a date block on the current sink.
+ * @see #testBookDate()
+ */
+ protected String getBookDateBlock( String date )
+ {
+ return "<bookinfo><date>" + date + "</date>";
+ }
+
+ /**
+ * Returns a head block generated by this sink.
+ * @return The result of invoking a head block on the current sink.
+ * @see #testBookHead()
+ */
+ protected String getBookHeadBlock()
+ {
+ return "";
+ }
+
+ /**
+ * Returns a body block generated by this sink.
+ * @return The result of invoking a body block on the current sink.
+ * @see #testBook()
+ */
+ protected String getBookBlock()
+ {
+ return "<?xml version=\"1.0\"?><!DOCTYPE book PUBLIC \"" + DocBookSink.DEFAULT_XML_PUBLIC_ID
+ + "\" \"" + DocBookSink.DEFAULT_XML_SYSTEM_ID + "\"><book></book>";
+ }
+
+ /**
+ * Returns a SectionTitle block generated by this sink.
+ * @param title The title to use.
+ * @return The result of invoking a SectionTitle block on the current sink.
+ * @see #testChapterTitle()
+ */
+ protected String getChapterTitleBlock( String title )
+ {
+ return "<title>" + title + "</title>";
+ }
+
+ /**
+ * Returns a Section1 block generated by this sink.
+ * @param title The title to use.
+ * @return The result of invoking a Section1 block on the current sink.
+ * @see #testChapter()
+ */
+ protected String getChapterBlock()
+ {
+ return "<chapter></chapter>";
+ }
+
+
+ //
+ // from DocBookSink
+ //
+
+
+ /** {@inheritDoc} */
+ protected String getTitleBlock( String title )
+ {
+ return "";
+ }
+
+ /** {@inheritDoc} */
+ protected String getAuthorBlock( String author )
+ {
+ return "";
+ }
+
+ /** {@inheritDoc} */
+ protected String getDateBlock( String date )
+ {
+ return "<date>" + date + "</date>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getHeadBlock()
+ {
+ return "";
+ }
+
+ /** {@inheritDoc} */
+ protected String getBodyBlock()
+ {
+ return "";
+ }
+
+ /** {@inheritDoc} */
+ protected String getSectionTitleBlock( String title )
+ {
+ return "<title>" + title + "</title>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getSection1Block( String title )
+ {
+ return "<section><title>" + title + "</title></section>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getSection2Block( String title )
+ {
+ return "<section><title>" + title + "</title></section>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getSection3Block( String title )
+ {
+ return "<section><title>" + title + "</title></section>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getSection4Block( String title )
+ {
+ return "<section><title>" + title + "</title></section>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getSection5Block( String title )
+ {
+ return "<section><title>" + title + "</title></section>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getListBlock( String item )
+ {
+ return "<itemizedlist><listitem><para>" + item + "</para></listitem></itemizedlist>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getNumberedListBlock( String item )
+ {
+ return "<orderedlist numeration=\"lowerroman\"><listitem><para>"
+ + item + "</para></listitem></orderedlist>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getDefinitionListBlock( String definum, String definition )
+ {
+ return "<variablelist><varlistentry><term>" + definum
+ + "</term><listitem><para>" + definition
+ + "</para></listitem></varlistentry></variablelist>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getFigureBlock( String source, String caption )
+ {
+ String format = FileUtils.extension( source ).toUpperCase( Locale.ENGLISH );
+
+ return "<mediaobject><imageobject>"
+ + "<imagedata fileref=\"" + source + "\" format=\"" + format + "\" />"
+ + "</imageobject><caption><para>" + caption + "</para></caption></mediaobject>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getTableBlock( String cell, String caption )
+ {
+ // Using the same set ordering than the JVM
+ MutableAttributeSet att = new SimpleAttributeSet();
+ att.addAttribute( "frame", "none" );
+ att.addAttribute( "rowsep", "0" );
+ att.addAttribute( "colsep", "0" );
+
+ return "<table" + SinkUtils.getAttributeString( att ) + "><title>" + caption
+ + "</title><tgroup cols=\"1\"><colspec align=\"center\" /><tbody><row><entry>"
+ + cell + "</entry></row></tbody></tgroup></table>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getParagraphBlock( String text )
+ {
+ return "<para>" + text + "</para>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getVerbatimBlock( String text )
+ {
+ return "<programlisting>" + text + "</programlisting>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getHorizontalRuleBlock()
+ {
+ return "<!-- HR -->";
+ }
+
+ /** {@inheritDoc} */
+ protected String getPageBreakBlock()
+ {
+ return "<!-- PB -->";
+ }
+
+ /** {@inheritDoc} */
+ protected String getAnchorBlock( String anchor )
+ {
+ return "<anchor id=\"" + anchor + "\" />" + anchor + "<!-- anchor_end -->";
+ }
+
+ /** {@inheritDoc} */
+ protected String getLinkBlock( String link, String text )
+ {
+ String linkend = DoxiaUtils.isInternalLink( link ) ? link.substring( 1 ) : link;
+ return "<link linkend=\"" + linkend + "\">" + text + "</link>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getItalicBlock( String text )
+ {
+ return "<emphasis>" + text + "</emphasis>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getBoldBlock( String text )
+ {
+ return "<emphasis role=\"bold\">" + text + "</emphasis>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getMonospacedBlock( String text )
+ {
+ return "<literal>" + text + "</literal>";
+ }
+
+ /** {@inheritDoc} */
+ protected String getLineBreakBlock()
+ {
+ return "<!-- LB -->";
+ }
+
+ /** {@inheritDoc} */
+ protected String getNonBreakingSpaceBlock()
+ {
+ return " ";
+ }
+
+ /** {@inheritDoc} */
+ protected String getTextBlock( String text )
+ {
+ // TODO: retreive those from the sink
+ return "~,_=,_-,_+,_*,_[,_],_<,_>,_{,_},_\\";
+ }
+
+ /** {@inheritDoc} */
+ protected String getRawTextBlock( String text )
+ {
+ // TODO
+ return "";
+ }
+
+ /** {@inheritDoc} */
+ protected String getCommentBlock( String text )
+ {
+ return "<!-- Simple comment with - - - - -->";
+ }
+}
diff --git a/src/test/resources/book-1.xml b/src/test/resources/book-1.xml
new file mode 100644
index 0000000..7364904
--- /dev/null
+++ b/src/test/resources/book-1.xml
@@ -0,0 +1,51 @@
+<!--
+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.
+-->
+
+<book xmlns="http://maven.apache.org/BOOK/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/BOOK/1.0.0 ../../../target/generated-site/xsd/book-1.0.0.xsd">
+ <id>plexus-user-guide</id>
+ <title>Test Book</title>
+ <chapters>
+ <chapter>
+ <id>chapter-1</id>
+ <title>Chapter 1</title>
+ <sections>
+ <section>
+ <id>section-1</id>
+ </section>
+ <section>
+ <id>section-2</id>
+ </section>
+ </sections>
+ </chapter>
+ <chapter>
+ <id>chapter-2</id>
+ <title>Chapter 2</title>
+ <sections>
+ <section>
+ <id>section-3</id>
+ </section>
+ <section>
+ <id>section-4</id>
+ </section>
+ </sections>
+ </chapter>
+ </chapters>
+</book>
diff --git a/src/test/resources/book-1/section-1.apt b/src/test/resources/book-1/section-1.apt
new file mode 100644
index 0000000..35d204f
--- /dev/null
+++ b/src/test/resources/book-1/section-1.apt
@@ -0,0 +1,61 @@
+ -----
+ Section 1
+ -----
+ Trygve
+ -----
+
+Subsection 1
+
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec sagittis malesuada nisi. Aliquam orci eros, vestibulum
+ eu, placerat et, pretium sed, nisi. Proin consequat. Praesent faucibus sem id arcu hendrerit nonummy. Aliquam blandit
+ accumsan pede. Vivamus aliquet lacinia nunc. Praesent dapibus orci eu magna. Cras nonummy, pede nec facilisis semper,
+ sem nibh vestibulum massa, sed ornare tortor elit non lectus. Nullam mauris turpis, luctus et, vulputate vitae, commodo
+ sit amet, purus. Fusce erat. Proin ullamcorper imperdiet est. Morbi sit amet dui. Fusce bibendum auctor augue. Sed leo
+ sapien, vehicula ac, nonummy id, cursus at, nulla. Ut sed purus.
+
+* Subsubsection 1
+
+ Suspendisse sagittis metus nec leo. Suspendisse velit. Phasellus ipsum dolor, porttitor ut1, varius id, scelerisque
+ vel, ligula. Aliquam tempor sem in pede tincidunt nonummy. Vestibulum et nulla. Nunc et dolor a risus porttitor tem
+ pus. Sed felis arcu, consectetuer non, imperdiet sollicitudin, ullamcorper vitae, nulla. Vestibulum ante ipsum primis
+ in faucibus.
+
+Subsection 2
+
+ Duis eget libero aliquet quam ultrices malesuada. Donec molestie dignissim nunc. Curabitur turpis. Suspendisse a nibh
+ ut elit vulputate ultrices. Etiam nulla erat, nonummy vel, fringilla at, scelerisque non, ante. Suspendisse adipiscing
+ rhoncus purus. Nulla in augue. Ut ac nisi eu nisi cursus elementum. Pellentesque habitant morbi tristique senectus et
+ netus et malesuada fames ac turpis egestas. Donec et turpis. Donec nec mi. Mauris malesuada congue sem. Maecenas et
+ urna in nisi sagittis facilisis. Cras nibh. Aliquam purus. Donec convallis congue libero. Nulla feugiat. Nulla massa
+ libero, consectetuer ac, aliquet ac, consequat eu, purus. Pellentesque eleifend pretium augue.
+
+Subsection 3
+
+ Integer auctor, nisi ut convallis imperdiet, ligula diam sollicitudin dolor, porttitor mattis urna sapien at velit.
+ Fusce vestibulum, neque nec malesuada tempor, tortor nisi accumsan purus, quis faucibus metus elit ac urna. Aliquam
+ commodo velit vel ipsum. Donec blandit diam blandit eros. Aliquam pretium fermentum neque. Sed nec tellus eu orci
+ ullamcorper facilisis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
+ Nulla sed leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Fusce
+ suscipit. Sed sit amet diam ac ante tincidunt ornare. Sed sodales vestibulum quam. Fusce accumsan. Ut ut mi.
+
+Subsection 4
+
+ Maecenas tincidunt lobortis nunc. Phasellus euismod diam sit amet felis. Donec lorem metus, vulputate vitae, ornare
+ vel, molestie sit amet, pede. In erat velit, adipiscing sed, varius in, interdum cursus, enim. Quisque dolor ante,
+ tincidunt vel, congue eget, consectetuer id, nunc. Suspendisse hendrerit. Proin egestas, massa eget egestas
+ ullamcorper, nisl elit gravida magna, vitae dignissim odio velit ut tortor. Fusce lobortis consequat nulla.
+ Vestibulum pretium justo at metus. Sed lorem velit, elementum eget, pellentesque ac, ornare id, mi. Pellentesque vel
+ ligula et erat dictum commodo. Integer malesuada lacus nec metus. Aliquam id purus ac neque mattis venenatis. Aenean
+ lobortis accumsan massa. Donec dui ante, facilisis vel, hendrerit ut, vehicula in, eros. Suspendisse potenti. Sed
+ fringilla. Suspendisse vel nibh. Sed sit amet lacus quis massa tincidunt elementum. Ut ut augue vitae ligula dapibus
+ aliquam.
+
+Subsection 5
+
+ Fusce non eros non lectus venenatis bibendum. Nullam pharetra. Nunc commodo pede et metus. Pellentesque habitant morbi
+ tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum imperdiet nisl nec nulla. Morbi congue
+ dictum pede. Aliquam ligula. In pede nulla, varius a, blandit ut, pulvinar vitae, mauris. Suspendisse sit amet magna.
+ Curabitur cursus placerat justo. Vivamus imperdiet magna commodo mi. Vestibulum eget metus quis sem sollicitudin
+ consectetuer. Morbi metus augue, elementum rutrum, luctus quis, porttitor a, est. Phasellus quis sapien et augue
+ adipiscing fermentum. Sed fermentum tristique dui. Vivamus aliquam, tortor at ultricies commodo, urna ipsum fringilla
+ neque, sit amet congue purus enim a justo.
diff --git a/src/test/resources/book-1/section-2.apt b/src/test/resources/book-1/section-2.apt
new file mode 100644
index 0000000..64c1f5f
--- /dev/null
+++ b/src/test/resources/book-1/section-2.apt
@@ -0,0 +1,16 @@
+ -----
+ Section 2
+ -----
+ Trygve
+ -----
+
+Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
+
+ Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam,
+ eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam
+ voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione
+ voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci
+ velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim
+ ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi
+ consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur,
+ vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
diff --git a/src/test/resources/book-1/section-3.apt b/src/test/resources/book-1/section-3.apt
new file mode 100644
index 0000000..f5d07ec
--- /dev/null
+++ b/src/test/resources/book-1/section-3.apt
@@ -0,0 +1,17 @@
+ -----
+ Section 3
+ -----
+ Trygve
+ -----
+
+1914 translation by H. Rackham
+
+ But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will
+ give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the
+ master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but
+ because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful.
+ Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because
+ occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial
+ example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who
+ has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who
+ avoids a pain that produces no resultant pleasure?
diff --git a/src/test/resources/book-1/section-4.apt b/src/test/resources/book-1/section-4.apt
new file mode 100644
index 0000000..a148762
--- /dev/null
+++ b/src/test/resources/book-1/section-4.apt
@@ -0,0 +1,16 @@
+ -----
+ Section 4
+ -----
+ Trygve
+ -----
+
+Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
+
+ At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque
+ corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa
+ qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita
+ distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime
+ placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut
+ officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae.
+ Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut
+ perferendis doloribus asperiores repellat.
diff --git a/src/test/resources/expected/doc-book/plexus-user-guide.xml b/src/test/resources/expected/doc-book/plexus-user-guide.xml
new file mode 100644
index 0000000..37ed826
--- /dev/null
+++ b/src/test/resources/expected/doc-book/plexus-user-guide.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0"?><!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<book><bookinfo><title>Test Book</title>
+</bookinfo>
+<chapter><title>Chapter 1</title>
+<section><title>Subsection 1</title>
+<para>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec sagittis
+malesuada nisi. Aliquam orci eros, vestibulum eu, placerat et, pretium sed,
+nisi. Proin consequat. Praesent faucibus sem id arcu hendrerit nonummy.
+Aliquam blandit accumsan pede. Vivamus aliquet lacinia nunc. Praesent dapibus
+orci eu magna. Cras nonummy, pede nec facilisis semper, sem nibh vestibulum
+massa, sed ornare tortor elit non lectus. Nullam mauris turpis, luctus et,
+vulputate vitae, commodo sit amet, purus. Fusce erat. Proin ullamcorper
+imperdiet est. Morbi sit amet dui. Fusce bibendum auctor augue. Sed leo
+sapien, vehicula ac, nonummy id, cursus at, nulla. Ut sed purus.</para>
+<section><title>Subsubsection 1</title>
+<para>Suspendisse sagittis metus nec leo. Suspendisse velit. Phasellus ipsum
+dolor, porttitor ut1, varius id, scelerisque vel, ligula. Aliquam tempor sem
+in pede tincidunt nonummy. Vestibulum et nulla. Nunc et dolor a risus
+porttitor tem pus. Sed felis arcu, consectetuer non, imperdiet sollicitudin,
+ullamcorper vitae, nulla. Vestibulum ante ipsum primis in faucibus.</para>
+</section>
+</section>
+<section><title>Subsection 2</title>
+<para>Duis eget libero aliquet quam ultrices malesuada. Donec molestie
+dignissim nunc. Curabitur turpis. Suspendisse a nibh ut elit vulputate
+ultrices. Etiam nulla erat, nonummy vel, fringilla at, scelerisque non, ante.
+Suspendisse adipiscing rhoncus purus. Nulla in augue. Ut ac nisi eu nisi
+cursus elementum. Pellentesque habitant morbi tristique senectus et netus et
+malesuada fames ac turpis egestas. Donec et turpis. Donec nec mi. Mauris
+malesuada congue sem. Maecenas et urna in nisi sagittis facilisis. Cras nibh.
+Aliquam purus. Donec convallis congue libero. Nulla feugiat. Nulla massa
+libero, consectetuer ac, aliquet ac, consequat eu, purus. Pellentesque
+eleifend pretium augue.</para>
+</section>
+<section><title>Subsection 3</title>
+<para>Integer auctor, nisi ut convallis imperdiet, ligula diam sollicitudin
+dolor, porttitor mattis urna sapien at velit. Fusce vestibulum, neque nec
+malesuada tempor, tortor nisi accumsan purus, quis faucibus metus elit ac
+urna. Aliquam commodo velit vel ipsum. Donec blandit diam blandit eros.
+Aliquam pretium fermentum neque. Sed nec tellus eu orci ullamcorper facilisis.
+Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac
+turpis egestas. Nulla sed leo. Class aptent taciti sociosqu ad litora torquent
+per conubia nostra, per inceptos hymenaeos. Fusce suscipit. Sed sit amet diam
+ac ante tincidunt ornare. Sed sodales vestibulum quam. Fusce accumsan. Ut ut
+mi.</para>
+</section>
+<section><title>Subsection 4</title>
+<para>Maecenas tincidunt lobortis nunc. Phasellus euismod diam sit amet felis.
+Donec lorem metus, vulputate vitae, ornare vel, molestie sit amet, pede. In
+erat velit, adipiscing sed, varius in, interdum cursus, enim. Quisque dolor
+ante, tincidunt vel, congue eget, consectetuer id, nunc. Suspendisse
+hendrerit. Proin egestas, massa eget egestas ullamcorper, nisl elit gravida
+magna, vitae dignissim odio velit ut tortor. Fusce lobortis consequat nulla.
+Vestibulum pretium justo at metus. Sed lorem velit, elementum eget,
+pellentesque ac, ornare id, mi. Pellentesque vel ligula et erat dictum
+commodo. Integer malesuada lacus nec metus. Aliquam id purus ac neque mattis
+venenatis. Aenean lobortis accumsan massa. Donec dui ante, facilisis vel,
+hendrerit ut, vehicula in, eros. Suspendisse potenti. Sed fringilla.
+Suspendisse vel nibh. Sed sit amet lacus quis massa tincidunt elementum. Ut ut
+augue vitae ligula dapibus aliquam.</para>
+</section>
+<section><title>Subsection 5</title>
+<para>Fusce non eros non lectus venenatis bibendum. Nullam pharetra. Nunc
+commodo pede et metus. Pellentesque habitant morbi tristique senectus et netus
+et malesuada fames ac turpis egestas. Vestibulum imperdiet nisl nec nulla.
+Morbi congue dictum pede. Aliquam ligula. In pede nulla, varius a, blandit ut,
+pulvinar vitae, mauris. Suspendisse sit amet magna. Curabitur cursus placerat
+justo. Vivamus imperdiet magna commodo mi. Vestibulum eget metus quis sem
+sollicitudin consectetuer. Morbi metus augue, elementum rutrum, luctus quis,
+porttitor a, est. Phasellus quis sapien et augue adipiscing fermentum. Sed
+fermentum tristique dui. Vivamus aliquam, tortor at ultricies commodo, urna
+ipsum fringilla neque, sit amet congue purus enim a justo.</para>
+</section>
+<section><title>Section 1.10.32 of "de Finibus Bonorum et Malorum",
+written by Cicero in 45 BC</title>
+<para>Sed ut perspiciatis unde omnis iste natus error sit voluptatem
+accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo
+inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
+Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
+sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
+Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,
+adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et
+dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis
+nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex
+ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea
+voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem
+eum fugiat quo voluptas nulla pariatur?</para>
+</section>
+</chapter>
+<chapter><title>Chapter 2</title>
+<section><title>1914 translation by H. Rackham</title>
+<para>But I must explain to you how all this mistaken idea of denouncing
+pleasure and praising pain was born and I will give you a complete account of
+the system, and expound the actual teachings of the great explorer of the
+truth, the master-builder of human happiness. No one rejects, dislikes, or
+avoids pleasure itself, because it is pleasure, but because those who do not
+know how to pursue pleasure rationally encounter consequences that are
+extremely painful. Nor again is there anyone who loves or pursues or desires
+to obtain pain of itself, because it is pain, but because occasionally
+circumstances occur in which toil and pain can procure him some great
+pleasure. To take a trivial example, which of us ever undertakes laborious
+physical exercise, except to obtain some advantage from it? But who has any
+right to find fault with a man who chooses to enjoy a pleasure that has no
+annoying consequences, or one who avoids a pain that produces no resultant
+pleasure?</para>
+</section>
+<section><title>Section 1.10.33 of "de Finibus Bonorum et Malorum",
+written by Cicero in 45 BC</title>
+<para>At vero eos et accusamus et iusto odio dignissimos ducimus qui
+blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas
+molestias excepturi sint occaecati cupiditate non provident, similique sunt in
+culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et
+harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum
+soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime
+placeat facere possimus, omnis voluptas assumenda est, omnis dolor
+repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum
+necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae
+non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut
+reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus
+asperiores repellat.</para>
+</section>
+</chapter>
+</book>
[maven-doxia-book-renderer] 08/34: Stop using deprecated syntax for
Surefire plugin.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit b4c951567fdb6ffe6c8a59dd2f60cc214b9c34f6
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Fri Apr 13 21:07:28 2012 +0000
Stop using deprecated syntax for Surefire plugin.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1325950 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index c0fc3f8..8f0ed63 100644
--- a/pom.xml
+++ b/pom.xml
@@ -143,12 +143,9 @@ under the License.
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- To be sure that JVM will implement AWT in software -->
- <systemProperties>
- <property>
- <name>java.awt.headless</name>
- <value>true</value>
- </property>
- </systemProperties>
+ <systemPropertyVariables>
+ <java.awt.headless>true</java.awt.headless>
+ </systemPropertyVariables>
</configuration>
</plugin>
</plugins>
[maven-doxia-book-renderer] 31/34: put "Doxia Tools" in artifact
names instead of simply "Doxia"
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 14f24c65c31ceb41100e81f36c70f79e16c06c52
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sat Sep 9 19:53:33 2017 +0000
put "Doxia Tools" in artifact names instead of simply "Doxia"
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1807923 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 8071453..d837371 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@ under the License.
<artifactId>doxia-book-renderer</artifactId>
<version>1.3-SNAPSHOT</version>
- <name>Doxia :: Book Renderer</name>
+ <name>Doxia Tools :: Book Renderer</name>
<description>A component to render books like user manuals and guides in any format supported by Doxia.</description>
<scm>
[maven-doxia-book-renderer] 26/34: updated parent version
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit ea0a8c23fdcf15e87557dda95aa4e95794ef6249
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Wed Dec 9 11:26:31 2015 +0000
updated parent version
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1718819 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 73d882e..877e0e5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
<parent>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-tools</artifactId>
- <version>4-SNAPSHOT</version>
+ <version>30-SNAPSHOT</version>
<relativePath>../../../pom/maven/doxia-tools/pom.xml</relativePath>
</parent>
[maven-doxia-book-renderer] 34/34: [INFRA-16467] move components
documentation out of CMS space
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 33e41cf0b8df9d410c8284cbbb07623b1c84cdff
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Mon Jun 18 21:49:18 2018 +0000
[INFRA-16467] move components documentation out of CMS space
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1833771 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index c5965ba..3af1b03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,7 +47,7 @@ under the License.
<distributionManagement>
<site>
<id>apache.website</id>
- <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven-doxia/components/${maven.site.path}</url>
+ <url>scm:svn:https://svn.apache.org/repos/asf/maven/doxia/website/components/${maven.site.path}</url>
</site>
</distributionManagement>
[maven-doxia-book-renderer] 11/34: generics
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit cdd904ed4d375b74df53c9c3f1d2e6e44ba47795
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sat Jun 2 21:56:03 2012 +0000
generics
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1345594 13f79535-47bb-0310-9956-ffa450edef68
---
src/test/java/org/apache/maven/doxia/book/BookRendererTest.java | 3 ++-
.../org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/test/java/org/apache/maven/doxia/book/BookRendererTest.java b/src/test/java/org/apache/maven/doxia/book/BookRendererTest.java
index b445a97..f1968da 100644
--- a/src/test/java/org/apache/maven/doxia/book/BookRendererTest.java
+++ b/src/test/java/org/apache/maven/doxia/book/BookRendererTest.java
@@ -41,7 +41,8 @@ public class BookRendererTest
File book1 = getTestFile( "src/test/resources/book-1.xml" );
- List files = FileUtils.getFiles( getTestFile( "src/test/resources/book-1" ), "**/*.apt, **/*.xml", "" );
+ @SuppressWarnings( "unchecked" )
+ List<File> files = FileUtils.getFiles( getTestFile( "src/test/resources/book-1" ), "**/*.apt, **/*.xml", "" );
BookModel book = doxia.loadBook( book1 );
diff --git a/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java b/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java
index 1a293ad..48edc9d 100644
--- a/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java
+++ b/src/test/java/org/apache/maven/doxia/book/services/indexer/BookIndexerTest.java
@@ -105,7 +105,7 @@ public class BookIndexerTest
"actual count: " + parent.getChildEntries().size(),
childIndex < parent.getChildEntries().size() );
- IndexEntry indexEntry = (IndexEntry) parent.getChildEntries().get( childIndex );
+ IndexEntry indexEntry = parent.getChildEntries().get( childIndex );
assertEquals( title, indexEntry.getTitle() );
[maven-doxia-book-renderer] 12/34: [DOXIATOOLS-37] use plexus java
5 annotations instead of old-style javadoc annotations
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 11e7afd64352f8c17bb4f32c13d02c8e4457902b
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sat Jun 2 22:10:15 2012 +0000
[DOXIATOOLS-37] use plexus java 5 annotations instead of old-style javadoc annotations
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1345596 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++++
.../apache/maven/doxia/book/DefaultBookDoxia.java | 20 +++++++-------------
.../book/services/indexer/DefaultBookIndexer.java | 9 ++++-----
.../maven/doxia/book/services/io/DefaultBookIo.java | 8 ++++----
.../services/renderer/AbstractITextBookRenderer.java | 5 ++---
.../book/services/renderer/DocbookBookRenderer.java | 8 ++++----
.../book/services/renderer/LatexBookRenderer.java | 8 ++++----
.../book/services/renderer/PdfBookRenderer.java | 4 ++--
.../book/services/renderer/RtfBookRenderer.java | 4 ++--
.../book/services/renderer/XHtmlBookRenderer.java | 8 ++++----
.../book/services/renderer/XdocBookRenderer.java | 12 +++++-------
.../services/validation/DefaultBookValidator.java | 4 ++--
12 files changed, 44 insertions(+), 50 deletions(-)
diff --git a/pom.xml b/pom.xml
index eb274bc..891e0ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -96,6 +96,10 @@ under the License.
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-annotations</artifactId>
+ </dependency>
<!-- test -->
<dependency>
diff --git a/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java b/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java
index 02fb421..82730d1 100644
--- a/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java
+++ b/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java
@@ -26,6 +26,8 @@ import org.apache.maven.doxia.book.services.io.BookIo;
import org.apache.maven.doxia.book.services.renderer.BookRenderer;
import org.apache.maven.doxia.book.services.validation.BookValidator;
import org.apache.maven.doxia.book.services.validation.ValidationResult;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import java.io.File;
@@ -40,30 +42,22 @@ import java.util.Set;
*
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
- * @plexus.component
*/
+@Component( role = BookDoxia.class )
public class DefaultBookDoxia
extends AbstractLogEnabled
implements BookDoxia
{
- /**
- * @plexus.requirement
- */
+ @Requirement
private BookIo bookIo;
- /**
- * @plexus.requirement
- */
+ @Requirement
private BookValidator bookValidator;
- /**
- * @plexus.requirement
- */
+ @Requirement
private BookIndexer bookIndexer;
- /**
- * @plexus.requirement role="org.apache.maven.doxia.book.services.renderer.BookRenderer"
- */
+ @Requirement( role = BookRenderer.class )
private Map<String, BookRenderer> bookRenderers;
// ----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java b/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
index 420859b..f29d02f 100644
--- a/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
+++ b/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
@@ -33,23 +33,22 @@ import org.apache.maven.doxia.index.IndexEntry;
import org.apache.maven.doxia.index.IndexingSink;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.AbstractLogEnabled;
/**
* Default implementation of BookIndexer.
*
- * @plexus.component
- *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
+@Component( role = BookIndexer.class )
public class DefaultBookIndexer
extends AbstractLogEnabled
implements BookIndexer
{
- /**
- * @plexus.requirement
- */
+ @Requirement
private Doxia doxia;
// ----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java b/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java
index 9509d1d..2b07935 100644
--- a/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java
+++ b/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java
@@ -28,6 +28,8 @@ import org.apache.maven.doxia.module.site.manager.SiteModuleManager;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import java.io.IOException;
@@ -41,17 +43,15 @@ import java.util.List;
/**
* <p>DefaultBookIo class.</p>
*
- * @plexus.component
* @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugstøl</a>
* @version $Id$
*/
+@Component( role = BookIo.class )
public class DefaultBookIo
extends AbstractLogEnabled
implements BookIo
{
- /**
- * @plexus.requirement
- */
+ @Requirement
private SiteModuleManager siteModuleManager;
// -----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java
index 78e18ff..92a0304 100644
--- a/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java
@@ -37,6 +37,7 @@ import org.apache.maven.doxia.module.itext.ITextSinkFactory;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
import org.apache.maven.doxia.sink.Sink;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
@@ -55,9 +56,7 @@ public abstract class AbstractITextBookRenderer
extends AbstractLogEnabled
implements BookRenderer
{
- /**
- * @plexus.requirement
- */
+ @Requirement
private Doxia doxia;
// ----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java
index 0d86ebd..a4097d1 100644
--- a/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java
@@ -35,6 +35,8 @@ import org.apache.maven.doxia.book.services.renderer.docbook.DocBookBookSink;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
import org.apache.maven.doxia.sink.Sink;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
@@ -44,17 +46,15 @@ import org.codehaus.plexus.util.WriterFactory;
/**
* An implementation of <code>BookRenderer</code> for docbook
*
- * @plexus.component role-hint="doc-book"
* @author Eric Redmond
* @version $Id$
*/
+@Component( role = BookRenderer.class, hint = "doc-book" )
public class DocbookBookRenderer
extends AbstractLogEnabled
implements BookRenderer
{
- /**
- * @plexus.requirement
- */
+ @Requirement
private Doxia doxia;
// ----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java
index 0c5b383..7b3b333 100644
--- a/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java
@@ -28,6 +28,8 @@ import org.apache.maven.doxia.book.model.Section;
import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.Doxia;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.IOUtil;
@@ -46,16 +48,14 @@ import java.util.HashMap;
/**
* <p>LatexBookRenderer class.</p>
*
- * @plexus.component role-hint="latex"
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
+@Component( role = BookRenderer.class, hint = "latex" )
public class LatexBookRenderer
implements BookRenderer
{
- /**
- * @plexus.requirement
- */
+ @Requirement
private Doxia doxia;
// ----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java
index b6a1ae5..2d0e9b9 100644
--- a/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/PdfBookRenderer.java
@@ -25,15 +25,15 @@ import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.maven.doxia.module.itext.ITextUtil;
+import org.codehaus.plexus.component.annotations.Component;
/**
* PDF book renderer with the <code>iText</code> framework.
*
- * @plexus.component role-hint="pdf"
- *
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
*/
+@Component( role = BookRenderer.class, hint = "pdf" )
public class PdfBookRenderer
extends AbstractITextBookRenderer
{
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java
index 0e60e13..2e6954d 100644
--- a/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/RtfBookRenderer.java
@@ -25,15 +25,15 @@ import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.maven.doxia.module.itext.ITextUtil;
+import org.codehaus.plexus.component.annotations.Component;
/**
* RTF book renderer with the <code>iText</code> framework.
*
- * @plexus.component role-hint="rtf"
- *
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
*/
+@Component( role = BookRenderer.class, hint = "rtf" )
public class RtfBookRenderer
extends AbstractITextBookRenderer
{
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java
index ad6f585..f0b2f82 100644
--- a/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java
@@ -29,6 +29,8 @@ import org.apache.maven.doxia.book.services.renderer.xhtml.XhtmlBookSink;
import org.apache.maven.doxia.sink.render.RenderingContext;
import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
import org.apache.maven.doxia.parser.ParseException;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
@@ -43,17 +45,15 @@ import java.io.Writer;
/**
* <p>XHtmlBookRenderer class.</p>
*
- * @plexus.component role-hint="xhtml"
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
+@Component( role = BookRenderer.class, hint = "xhtml" )
public class XHtmlBookRenderer
extends AbstractLogEnabled
implements BookRenderer
{
- /**
- * @plexus.requirement
- */
+ @Requirement
private Doxia doxia;
// ----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java b/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
index f5c6541..1be58f4 100644
--- a/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
+++ b/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
@@ -41,6 +41,8 @@ import org.apache.maven.doxia.module.xdoc.XdocSink;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
import org.apache.maven.doxia.util.HtmlTools;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.i18n.I18N;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.util.IOUtil;
@@ -54,20 +56,16 @@ import org.codehaus.plexus.util.WriterFactory;
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
- * @plexus.component role-hint="xdoc"
*/
+@Component( role = BookRenderer.class, hint = "xdoc" )
public class XdocBookRenderer
extends AbstractLogEnabled
implements BookRenderer
{
- /**
- * @plexus.requirement
- */
+ @Requirement
private Doxia doxia;
- /**
- * @plexus.requirement
- */
+ @Requirement
private I18N i18n;
// ----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java b/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java
index 19a06ec..3ba4596 100644
--- a/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java
+++ b/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java
@@ -19,6 +19,7 @@ package org.apache.maven.doxia.book.services.validation;
* under the License.
*/
+import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.util.StringUtils;
import org.apache.maven.doxia.book.model.BookModel;
@@ -27,11 +28,10 @@ import org.apache.maven.doxia.book.model.Chapter;
/**
* Default implementation of BookValidator.
*
- * @plexus.component
- *
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @version $Id$
*/
+@Component( role = BookValidator.class )
public class DefaultBookValidator
extends AbstractLogEnabled
implements BookValidator
[maven-doxia-book-renderer] 10/34: Use a proper name.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 71581d5b5317703bde39ff1e5e0f4d898c058e12
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Fri Apr 13 21:09:24 2012 +0000
Use a proper name.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1325953 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 8f0ed63..eb274bc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
</parent>
<artifactId>doxia-book-renderer</artifactId>
- <name>Doxia Tools :: Book Renderer</name>
+ <name>Doxia Book Renderer</name>
<description>A component to render books like user manuals and guides in any format supported by Doxia.</description>
<properties>
[maven-doxia-book-renderer] 22/34: configured license check
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit d381482c96498ba42dcee378ee3209603b75de43
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Mon Jul 21 15:24:16 2014 +0000
configured license check
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1612312 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/pom.xml b/pom.xml
index acf18d1..487fad4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -170,6 +170,24 @@ under the License.
</systemPropertyVariables>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>src/test/resources/expected/doc-book/plexus-user-guide.xml</exclude>
+ <exclude>src/test/resources/book-1/section-*.apt</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>check</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
[maven-doxia-book-renderer] 03/34: Switch over to use doxia-tools
as parent. This should probably be changed to maven-parent later on.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 84ece3de7a87d1fcadc82a86eb2fbece20202b37
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Sat Mar 31 17:10:15 2012 +0000
Switch over to use doxia-tools as parent.
This should probably be changed to maven-parent later on.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1307852 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index b7b0e5a..98368f3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,9 +24,9 @@ under the License.
<parent>
<groupId>org.apache.maven.doxia</groupId>
- <artifactId>doxia</artifactId>
+ <artifactId>doxia-tools</artifactId>
<version>1.3-SNAPSHOT</version>
- <relativePath>../../doxia/pom.xml</relativePath>
+ <relativePath>../pom.xml</relativePath>
</parent>
<artifactId>doxia-book-renderer</artifactId>
@@ -34,41 +34,53 @@ under the License.
<description>A component to render books like user manuals and guides in any format supported by Doxia.</description>
<url>http://maven.apache.org/doxia/doxia/doxia-book/</url>
+ <properties>
+ <doxiaVersion>1.3-SNAPSHOT</doxiaVersion>
+ </properties>
+
<dependencies>
<!-- doxia core -->
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-core</artifactId>
+ <version>${doxiaVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-sink-api</artifactId>
+ <version>${doxiaVersion}</version>
</dependency>
<!-- doxia modules ordered -->
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-apt</artifactId>
+ <version>${doxiaVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-docbook-simple</artifactId>
+ <version>${doxiaVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-itext</artifactId>
+ <version>${doxiaVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-latex</artifactId>
+ <version>${doxiaVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-xdoc</artifactId>
+ <version>${doxiaVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-xhtml</artifactId>
+ <version>${doxiaVersion}</version>
</dependency>
<!-- plexus -->
@@ -90,6 +102,7 @@ under the License.
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-core</artifactId>
+ <version>${doxiaVersion}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
[maven-doxia-book-renderer] 18/34: Add unique version numbers to
the modules,
which were lost when I set up the possibility to release the modules
individually.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit edae5a4a3a21e57bbbd94ee802bbe0a327cbb6a9
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Thu Oct 11 19:48:53 2012 +0000
Add unique version numbers to the modules, which were lost when I set up the possibility to release the modules individually.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1397266 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pom.xml b/pom.xml
index 84c0988..548a96f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,6 +30,8 @@ under the License.
</parent>
<artifactId>doxia-book-renderer</artifactId>
+ <version>1.3-SNAPSHOT</version>
+
<name>Doxia Book Renderer</name>
<description>A component to render books like user manuals and guides in any format supported by Doxia.</description>
[maven-doxia-book-renderer] 24/34: updated parent pom (and fixed
issues reported by Checkstyle)
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 396b006fdb83eade64d60fd94302d77578a81f73
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sat Oct 24 23:37:07 2015 +0000
updated parent pom (and fixed issues reported by Checkstyle)
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1710402 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index c5e460a..a445533 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
<parent>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-tools</artifactId>
- <version>2</version>
+ <version>4-SNAPSHOT</version>
<relativePath>../doxia-tools/pom.xml</relativePath>
</parent>
@@ -53,6 +53,7 @@ under the License.
<properties>
<doxiaVersion>1.3</doxiaVersion>
+ <checkstyle.violation.ignore>MethodName,NewlineAtEndOfFile,ParameterNumber</checkstyle.violation.ignore>
</properties>
<dependencies>
@@ -174,7 +175,7 @@ under the License.
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
- <excludes>
+ <excludes combine.children="append">
<exclude>src/test/resources/expected/doc-book/plexus-user-guide.xml</exclude>
<exclude>src/test/resources/book-1/section-*.apt</exclude>
</excludes>
[maven-doxia-book-renderer] 27/34: updated parent pom to last
release
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 13cdd34c2f913b1f8d97c10f5840b9059a0df6a2
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Wed Dec 9 16:13:20 2015 +0000
updated parent pom to last release
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1718894 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 877e0e5..abd22bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
<parent>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-tools</artifactId>
- <version>30-SNAPSHOT</version>
+ <version>3</version>
<relativePath>../../../pom/maven/doxia-tools/pom.xml</relativePath>
</parent>
[maven-doxia-book-renderer] 09/34: Fix Javadoc error.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 8cab892cc9a7f12763f21b0393733e7df8581f57
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Fri Apr 13 21:07:44 2012 +0000
Fix Javadoc error.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1325951 13f79535-47bb-0310-9956-ffa450edef68
---
.../maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java b/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java
index 6a4de45..756795d 100644
--- a/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java
+++ b/src/test/java/org/apache/maven/doxia/book/services/renderer/docbook/DocBookBookSinkTest.java
@@ -275,7 +275,7 @@ public class DocBookBookSinkTest extends AbstractSinkTest
/**
* Returns a Section1 block generated by this sink.
- * @param title The title to use.
+ *
* @return The result of invoking a Section1 block on the current sink.
* @see #testChapter()
*/
[maven-doxia-book-renderer] 19/34: align projects names
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit cd1f9b230fce6dd8e18cabed65033a1d7cda1ac0
Author: Olivier Lamy <ol...@apache.org>
AuthorDate: Fri Jan 25 08:49:59 2013 +0000
align projects names
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1438389 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 548a96f..f0a19ea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@ under the License.
<artifactId>doxia-book-renderer</artifactId>
<version>1.3-SNAPSHOT</version>
- <name>Doxia Book Renderer</name>
+ <name>Doxia :: Book Renderer</name>
<description>A component to render books like user manuals and guides in any format supported by Doxia.</description>
<scm>
[maven-doxia-book-renderer] 14/34: Fix SCM URLs.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 31e284c955fd2f7faed1a5fcb541b7500a5231b2
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Thu Sep 20 20:55:10 2012 +0000
Fix SCM URLs.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1388213 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pom.xml b/pom.xml
index ed2e248..0fa3e58 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,12 @@ under the License.
<name>Doxia Book Renderer</name>
<description>A component to render books like user manuals and guides in any format supported by Doxia.</description>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk/doxia-book-renderer</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk/doxia-book-renderer</developerConnection>
+ <url>http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-book-renderer</url>
+ </scm>
+
<properties>
<doxiaVersion>1.3</doxiaVersion>
</properties>
[maven-doxia-book-renderer] 25/34: [MPOM-95] updated relative path
to parent pom after move
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit c00813a3d4824e883e5bc21770e40c4fa8934e9a
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Wed Dec 9 09:45:01 2015 +0000
[MPOM-95] updated relative path to parent pom after move
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1718792 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a445533..73d882e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@ under the License.
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-tools</artifactId>
<version>4-SNAPSHOT</version>
- <relativePath>../doxia-tools/pom.xml</relativePath>
+ <relativePath>../../../pom/maven/doxia-tools/pom.xml</relativePath>
</parent>
<artifactId>doxia-book-renderer</artifactId>
[maven-doxia-book-renderer] 06/34: Tweak the site.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit efe13fa051c7d20200934b7cf2bb8d299adf7821
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Fri Apr 13 21:01:22 2012 +0000
Tweak the site.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1325947 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/modello/book.mdo | 4 ++--
src/site/apt/index.apt | 26 ++++++++++++++++++++++++--
src/site/apt/usage.apt | 22 ++++++++++++++++++++++
src/site/apt/using-book-xsd.apt | 4 ++--
src/site/site.xml | 6 +++---
5 files changed, 53 insertions(+), 9 deletions(-)
diff --git a/src/main/modello/book.mdo b/src/main/modello/book.mdo
index 13068f6..9350a62 100644
--- a/src/main/modello/book.mdo
+++ b/src/main/modello/book.mdo
@@ -26,11 +26,11 @@
<description>
<![CDATA[
<p>
- This descriptor specifies the metadatas and the content for a book.
+ This descriptor specifies the metadata and the content for a book.
</p>
<p>
A book is defined by a collection of chapters, a chapter by a
- collection of sections, a section by a file.
+ collection of sections and a section by a file.
</p>
<p>An XSD is available at:</p>
<ul>
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
index 968e955..83dc6c5 100644
--- a/src/site/apt/index.apt
+++ b/src/site/apt/index.apt
@@ -3,11 +3,33 @@
-----
Lukas Theussl
-----
+ 2012-04-13
+ ------
+
+~~ 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.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
Introduction
Doxia allows you to write books like user manuals and guides in any format supported by Doxia. Combined with the
- Doxia Book Maven you are able to include the manuals directly in your generated site with links to the off-line
+ Doxia Book Maven Plugin you are able to include the manuals directly in your generated site with links to the off-line
friendly formats like XDoc, PDF, RTF and LaTeX.
* How It Works
@@ -15,6 +37,6 @@ Introduction
The only thing you need in addition to the content files itself is a simple book descriptor which is used to specify
the ordering of the sections and the names for the chapters.
- See {{{./book.html}The Book Descriptor Reference}} for a reference to the descriptor. A sample is given on the
+ See the {{{./book.html}Book Descriptor Reference}} for a reference to the descriptor. A sample is given on the
main Doxia {{{http://maven.apache.org/doxia/book/index.html}site}}.
diff --git a/src/site/apt/usage.apt b/src/site/apt/usage.apt
index e90d983..02d4185 100644
--- a/src/site/apt/usage.apt
+++ b/src/site/apt/usage.apt
@@ -3,6 +3,28 @@
-----
Lukas Theussl
-----
+ 2012-04-13
+ ------
+
+~~ 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.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
Usage
diff --git a/src/site/apt/using-book-xsd.apt b/src/site/apt/using-book-xsd.apt
index 1c3fdc9..0652754 100644
--- a/src/site/apt/using-book-xsd.apt
+++ b/src/site/apt/using-book-xsd.apt
@@ -3,7 +3,7 @@
-----
Vincent Siveton
------
- 2009-01-28
+ 2012-04-13
------
~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -30,7 +30,7 @@ Using Schema Book 1.0
The Decoration XSD is located {{{http://maven.apache.org/xsd/book-1.0.0.xsd}here}}.
- Your favorite IDE probably supports XSD schema's for .xml files. You need to specify the following:
+ Your favorite IDE probably supports XSD schema's for <<<.xml>>> files. You need to specify the following:
+-----+
<book xmlns="http://maven.apache.org/BOOK/1.0.0"
diff --git a/src/site/site.xml b/src/site/site.xml
index cc6f0cd..2f40985 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -28,7 +28,7 @@
<menu ref="parent"/>
- <menu name="About Doxia :: Book Components">
+ <menu name="Overview">
<item name="Introduction" href="index.html"/>
<item name="Usage" href="usage.html"/>
<item name="JavaDocs" href="apidocs/index.html"/>
@@ -36,8 +36,8 @@
<!--item name="FAQ" href="faq.html"/-->
</menu>
- <menu name="Book Schema">
- <item name="Reference" href="book.html"/>
+ <menu name="Reference">
+ <item name="Book Reference" href="book.html"/>
<item name="Using Book Schema" href="using-book-xsd.html"/>
</menu>
[maven-doxia-book-renderer] 15/34: Add more specific
issueManagement/urls.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit f9c1b2ac26bcbaef0fa652c681d743354e007400
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Thu Sep 20 21:02:21 2012 +0000
Add more specific issueManagement/urls.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1388215 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pom.xml b/pom.xml
index 0fa3e58..a88187e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,6 +38,10 @@ under the License.
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk/doxia-book-renderer</developerConnection>
<url>http://svn.apache.org/viewvc/maven/doxia/doxia-tools/trunk/doxia-book-renderer</url>
</scm>
+ <issueManagement>
+ <system>jira</system>
+ <url>http://jira.codehaus.org/browse/DOXIATOOLS/component/15478</url>
+ </issueManagement>
<properties>
<doxiaVersion>1.3</doxiaVersion>
[maven-doxia-book-renderer] 04/34: updated site urls to let
automatic extrapolation from parent
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit b92120a1d98ab665c0a897601282249221f5095d
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Wed Apr 11 21:36:49 2012 +0000
updated site urls to let automatic extrapolation from parent
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1325018 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 98368f3..5e827d1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,6 @@ under the License.
<artifactId>doxia-book-renderer</artifactId>
<name>Doxia Tools :: Book Renderer</name>
<description>A component to render books like user manuals and guides in any format supported by Doxia.</description>
- <url>http://maven.apache.org/doxia/doxia/doxia-book/</url>
<properties>
<doxiaVersion>1.3-SNAPSHOT</doxiaVersion>
[maven-doxia-book-renderer] 33/34: publish to components instead of
content
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit c8f35d94f8eaa935dc4eaad472d37502408df80b
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Fri Dec 29 22:36:48 2017 +0000
publish to components instead of content
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1819548 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 31edc50..c5965ba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,7 +47,7 @@ under the License.
<distributionManagement>
<site>
<id>apache.website</id>
- <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven-doxia/content/${maven.site.path}</url>
+ <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven-doxia/components/${maven.site.path}</url>
</site>
</distributionManagement>
[maven-doxia-book-renderer] 30/34: Upgrade parent of tools to
org.apache.maven.doxia:doxia-tools:30
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 6e292e3d28d4961498ac0e149528e9765b6ed24b
Author: Robert Scholte <rf...@apache.org>
AuthorDate: Sat Dec 3 15:43:01 2016 +0000
Upgrade parent of tools to org.apache.maven.doxia:doxia-tools:30
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1772473 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 44c650f..8071453 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
<parent>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-tools</artifactId>
- <version>3</version>
+ <version>30</version>
<relativePath>../../../pom/maven/doxia-tools/pom.xml</relativePath>
</parent>
[maven-doxia-book-renderer] 29/34: rat is already run on each build
since maven-parent 25: now configuration enhancements are to be put in
pluginManagement
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit a3a31ddb20617e0a3910b4f9038e6f55e17a157b
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sun Apr 10 22:51:30 2016 +0000
rat is already run on each build since maven-parent 25: now configuration enhancements are to be put in pluginManagement
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1738484 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/pom.xml b/pom.xml
index abd22bf..44c650f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -131,6 +131,20 @@ under the License.
</dependencies>
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes combine.children="append">
+ <exclude>src/test/resources/expected/doc-book/plexus-user-guide.xml</exclude>
+ <exclude>src/test/resources/book-1/section-*.apt</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.modello</groupId>
@@ -171,24 +185,6 @@ under the License.
</systemPropertyVariables>
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes combine.children="append">
- <exclude>src/test/resources/expected/doc-book/plexus-user-guide.xml</exclude>
- <exclude>src/test/resources/book-1/section-*.apt</exclude>
- </excludes>
- </configuration>
- <executions>
- <execution>
- <id>check</id>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
[maven-doxia-book-renderer] 28/34: Jira moved from Codehaus to
Apache
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 82a978fdab5d51fa9e7afb68e011cb9cee4d56d8
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Wed Mar 2 16:37:18 2016 +0000
Jira moved from Codehaus to Apache
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1733332 13f79535-47bb-0310-9956-ffa450edef68
---
src/site/site.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/site/site.xml b/src/site/site.xml
index a636558..b6df03d 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -27,7 +27,7 @@ under the License.
<item name="JavaDocs" href="apidocs/index.html"/>
<item name="Source Xref" href="xref/index.html"/>
<!--item name="FAQ" href="faq.html"/-->
- <!-- According to http://jira.codehaus.org/browse/MNGSITE-152 -->
+ <!-- According to https://issues.apache.org/jira/browse/MNGSITE-152 -->
<item name="License" href="http://www.apache.org/licenses/"/>
<item name="Download" href="download.html"/>
</menu>
[maven-doxia-book-renderer] 17/34: Update to released version of
doxia-tools parent.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit e73a6844d320caddd5714d64ddb44826ab6c97e7
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Wed Sep 26 21:03:25 2012 +0000
Update to released version of doxia-tools parent.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1390725 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a88187e..84c0988 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
<parent>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-tools</artifactId>
- <version>2-SNAPSHOT</version>
+ <version>2</version>
<relativePath>../doxia-tools/pom.xml</relativePath>
</parent>
[maven-doxia-book-renderer] 23/34: moved Jira from Codehaus to
Apache
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit d50c7f7e1addcded15741c38d44c663208284a13
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sun Apr 5 23:37:56 2015 +0000
moved Jira from Codehaus to Apache
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1671454 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 487fad4..c5e460a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,7 +42,7 @@ under the License.
</scm>
<issueManagement>
<system>jira</system>
- <url>http://jira.codehaus.org/browse/DOXIATOOLS/component/15478</url>
+ <url>https://issues.apache.org/jira/browse/DOXIATOOLS/component/12326006</url>
</issueManagement>
<distributionManagement>
<site>
[maven-doxia-book-renderer] 05/34: The default locale (en) should
not be included in the list of locales for the l10n-maven-plugin.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit a95faf7ef10678af567979f5184b80a9f34cf9dd
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Fri Apr 13 20:37:57 2012 +0000
The default locale (en) should not be included in the list of locales for the l10n-maven-plugin.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1325940 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 5e827d1..8d77b7d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -165,7 +165,6 @@ under the License.
<version>1.0-alpha-2</version>
<configuration>
<locales>
- <locale>en</locale>
<locale>fr</locale>
</locales>
</configuration>
[maven-doxia-book-renderer] 32/34: improve java 9 build
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 4060ca789382368c8ccc11f1692b9eb50d53480a
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sat Sep 9 20:35:02 2017 +0000
improve java 9 build
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1807928 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pom.xml b/pom.xml
index d837371..31edc50 100644
--- a/pom.xml
+++ b/pom.xml
@@ -143,6 +143,11 @@ under the License.
</excludes>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-metadata</artifactId>
+ <version>1.7.1</version>
+ </plugin>
</plugins>
</pluginManagement>
<plugins>
[maven-doxia-book-renderer] 20/34: [MNG-152] add license and
download links
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 26ebf0732adf007f9203dc7d595dd8a8ade9ec4e
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sat Jun 21 14:14:06 2014 +0000
[MNG-152] add license and download links
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1604393 13f79535-47bb-0310-9956-ffa450edef68
---
src/site/resources/download.cgi | 22 +++++++
src/site/site.xml | 3 +
src/site/xdoc/download.xml.vm | 126 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 151 insertions(+)
diff --git a/src/site/resources/download.cgi b/src/site/resources/download.cgi
new file mode 100644
index 0000000..1b178d2
--- /dev/null
+++ b/src/site/resources/download.cgi
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# 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.
+#
+# Just call the standard mirrors.cgi script. It will use download.html
+# as the input template.
+exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $*
\ No newline at end of file
diff --git a/src/site/site.xml b/src/site/site.xml
index 3292a07..a636558 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -27,6 +27,9 @@ under the License.
<item name="JavaDocs" href="apidocs/index.html"/>
<item name="Source Xref" href="xref/index.html"/>
<!--item name="FAQ" href="faq.html"/-->
+ <!-- According to http://jira.codehaus.org/browse/MNGSITE-152 -->
+ <item name="License" href="http://www.apache.org/licenses/"/>
+ <item name="Download" href="download.html"/>
</menu>
<menu name="Reference">
diff --git a/src/site/xdoc/download.xml.vm b/src/site/xdoc/download.xml.vm
new file mode 100644
index 0000000..11c2577
--- /dev/null
+++ b/src/site/xdoc/download.xml.vm
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+
+<!--
+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.
+-->
+
+<document>
+ <properties>
+ <title>Download ${project.name} Source</title>
+ </properties>
+ <body>
+ <section name="Download ${project.name} ${project.version} Source">
+
+ <p>${project.name} ${project.version} is distributed in source format. Use a source archive if you intend to build
+ ${project.name} yourself. Otherwise, simply use the ready-made binary artifacts from central repository.</p>
+
+ <p>You will be prompted for a mirror - if the file is not found on yours, please be patient, as it may take 24
+ hours to reach all mirrors.<p/>
+
+ <p>In order to guard against corrupted downloads/installations, it is highly recommended to
+ <a href="http://www.apache.org/dev/release-signing#verifying-signature">verify the signature</a>
+ of the release bundles against the public <a href="http://www.apache.org/dist/maven/KEYS">KEYS</a> used by the Apache Maven
+ developers.</p>
+
+ <p>${project.name} is distributed under the <a href="http://www.apache.org/licenses/">Apache License, version 2.0</a>.</p>
+
+ <p></p>We <b>strongly</b> encourage our users to configure a Maven repository mirror closer to their location, please read <a href="./guides/mini/guide-mirror-settings.html">How to Use Mirrors for Repositories</a>.</p>
+
+ <a name="mirror"/>
+ <subsection name="Mirror">
+
+ <p>
+ [if-any logo]
+ <a href="[link]">
+ <img align="right" src="[logo]" border="0"
+ alt="logo"/>
+ </a>
+ [end]
+ The currently selected mirror is
+ <b>[preferred]</b>.
+ If you encounter a problem with this mirror,
+ please select another mirror.
+ If all mirrors are failing, there are
+ <i>backup</i>
+ mirrors
+ (at the end of the mirrors list) that should be available.
+ </p>
+
+ <form action="[location]" method="get" id="SelectMirror">
+ Other mirrors:
+ <select name="Preferred">
+ [if-any http]
+ [for http]
+ <option value="[http]">[http]</option>
+ [end]
+ [end]
+ [if-any ftp]
+ [for ftp]
+ <option value="[ftp]">[ftp]</option>
+ [end]
+ [end]
+ [if-any backup]
+ [for backup]
+ <option value="[backup]">[backup] (backup)</option>
+ [end]
+ [end]
+ </select>
+ <input type="submit" value="Change"/>
+ </form>
+
+ <p>
+ You may also consult the
+ <a href="http://www.apache.org/mirrors/">complete list of
+ mirrors.</a>
+ </p>
+
+ </subsection>
+
+ <subsection name="${project.name} ${project.version}">
+
+ <p>This is the current stable version of ${project.name}.</p>
+
+ <table>
+ <thead>
+ <tr>
+ <th></th>
+ <th>Link</th>
+ <th>Checksum</th>
+ <th>Signature</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>${project.name} ${project.version} (Source zip)</td>
+ <td><a href="[preferred]maven/doxia/${project.artifactId}-${project.version}-source-release.zip">maven/doxia/${project.artifactId}-${project.version}-source-release.zip</a></td>
+ <td><a href="http://www.apache.org/dist/maven/doxia/${project.artifactId}-${project.version}-source-release.zip.md5">maven/doxia/${project.artifactId}-${project.version}-source-release.zip.md5</a></td>
+ <td><a href="http://www.apache.org/dist/maven/doxia/${project.artifactId}-${project.version}-source-release.zip.asc">maven/doxia/${project.artifactId}-${project.version}-source-release.zip.asc</a></td>
+ </tr>
+ </tbody>
+ </table>
+ </subsection>
+
+ <subsection name="Previous Versions">
+
+ <p>Older non-recommended releases can be found on our <a href="http://archive.apache.org/dist/maven/doxia/">archive site</a>.</p>
+
+ </subsection>
+ </section>
+ </body>
+</document>
+
[maven-doxia-book-renderer] 13/34: Change the POM hierarchy to
match those used for maven-plugins and maven-shared. Such a layout is
suitable when the modules have different release cycles,
like they do here. The parent for doxia-tools is now at the same level as
the modules,
instead of one level above. At the top level is now an aggregator POM that
can be used for CI servers.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 0d184ed179751a3ccce257a25b5b57cbcaf9b612
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Thu Sep 20 20:49:05 2012 +0000
Change the POM hierarchy to match those used for maven-plugins and maven-shared. Such a layout is suitable when the modules have different release cycles, like they do here. The parent for doxia-tools is now at the same level as the modules, instead of one level above. At the top level is now an aggregator POM that can be used for CI servers.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1388210 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 891e0ff..ed2e248 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,8 +25,8 @@ under the License.
<parent>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-tools</artifactId>
- <version>1.3-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
+ <version>2-SNAPSHOT</version>
+ <relativePath>../doxia-tools/pom.xml</relativePath>
</parent>
<artifactId>doxia-book-renderer</artifactId>
[maven-doxia-book-renderer] 02/34: Post-move clean-up: - Fix
relative paths to parent,
keeping the doxia-parent for now - Change artifactsIds,
names and descriptions - Add/remove modules
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit e0e0536f1a4c6a6bfcf70a75017a1bd73217c911
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Sat Mar 31 17:00:10 2012 +0000
Post-move clean-up:
- Fix relative paths to parent, keeping the doxia-parent for now
- Change artifactsIds, names and descriptions
- Add/remove modules
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1307849 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index cc90293..b7b0e5a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,12 +26,12 @@ under the License.
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia</artifactId>
<version>1.3-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
+ <relativePath>../../doxia/pom.xml</relativePath>
</parent>
- <artifactId>doxia-book</artifactId>
- <name>Doxia :: Book Component</name>
- <description>A component to write books like user manuals and guides in any format supported by Doxia.</description>
+ <artifactId>doxia-book-renderer</artifactId>
+ <name>Doxia Tools :: Book Renderer</name>
+ <description>A component to render books like user manuals and guides in any format supported by Doxia.</description>
<url>http://maven.apache.org/doxia/doxia/doxia-book/</url>
<dependencies>
[maven-doxia-book-renderer] 07/34: Use released version of Doxia.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-doxia-book-renderer.git
commit 6b4d098364fa5b32d93be44db7b4a235ba0078af
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Fri Apr 13 21:01:56 2012 +0000
Use released version of Doxia.
git-svn-id: https://svn.apache.org/repos/asf/maven/doxia/doxia-tools/trunk@1325948 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 8d77b7d..c0fc3f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,7 +34,7 @@ under the License.
<description>A component to render books like user manuals and guides in any format supported by Doxia.</description>
<properties>
- <doxiaVersion>1.3-SNAPSHOT</doxiaVersion>
+ <doxiaVersion>1.3</doxiaVersion>
</properties>
<dependencies>