...
 
Commits (112)
*.iml
*.ipr
target
*.iws
.classpath
dependency-reduced-pom.xml
build
.classpath
.project
.settings
.idea
.surefire-*
.DS_Store
*.versionsBackup
Information about doxia
-----------------------
This package was debianized using the mh_make command
from the maven-debian-helper package.
The build system uses Maven but prevents it from downloading
anything from the Internet, making the build compliant with
the Debian policy.
doxia (1.7-2) unstable; urgency=medium
* Team upload.
* Fixed the build failure with maven-parent 31 (Closes: #906350)
* Removed the unused build dependency on libmaven-plugin-tools-java
* Standards-Version updated to 4.2.1
* Switch to debhelper level 11
* Use salsa.debian.org Vcs-* URLs
-- Emmanuel Bourg <ebourg@apache.org> Mon, 26 Nov 2018 13:10:55 +0100
doxia (1.7-1) unstable; urgency=medium
* Team upload.
* New upstream release
- Refreshed the patches
- Removed 0001-modello.patch
- Build depend on maven-debian-helper (>= 2.2.2)
- Build depend on junit4 instead of junit
- No longer build the doxia-book module (removed upstream)
- Build the new doxia-module-markdown module
- New dependency on libcommons-collections3-java
- Keep the RenderingContext class to preserve the backward compatibility
* Removed the unused dependency on libmaven2-core-java
* Depend on libplexus-container-default1.5-java
instead of libplexus-containers-java
* Depend on libmaven-parent-java and inherit the modello configuration
* Set the source encoding to UTF-8
* Standards-Version updated to 4.0.0
* Switch to debhelper level 10
* Use XZ compression for the upstream tarball
* Converted debian/copyright to the Copyright Format 1.0
-- Emmanuel Bourg <ebourg@apache.org> Fri, 28 Jul 2017 12:23:09 +0200
doxia (1.1.4-7) unstable; urgency=medium
* Team upload.
* Added the missing build dependency on libplexus-component-metadata-java
(Closes: #830495)
-- Emmanuel Bourg <ebourg@apache.org> Tue, 30 May 2017 15:15:35 +0200
doxia (1.1.4-6) unstable; urgency=medium
* Team upload.
* Updated the version of the plexus-component-metadata plugin
(Closes: #820734)
* Standards-Version updated to 3.9.8
* Use secure Vcs-* URLs
-- Emmanuel Bourg <ebourg@apache.org> Thu, 07 Jul 2016 10:52:55 +0200
doxia (1.1.4-5) unstable; urgency=medium
* Team upload.
* Removed the build dependency on libplexus-component-metadata-java
-- Emmanuel Bourg <ebourg@apache.org> Tue, 19 Jan 2016 15:50:20 +0100
doxia (1.1.4-4) unstable; urgency=medium
* Team upload.
* Imported the patch from Fedora fixing the compatibility with FOP 2.0
* Build with the DH sequencer instead of CDBS
-- Emmanuel Bourg <ebourg@apache.org> Tue, 05 Jan 2016 17:55:42 +0100
doxia (1.1.4-3) unstable; urgency=medium
* Team upload.
* Moved the doxia-core, doxia-sink-api and doxia-logging-api modules
to a separate libdoxia-core-java package
* No longer build and install the doxia-test-docs module
* Removed the build dependency libclirr-maven-plugin-java
* Replaced the patch disabling doxia-maven-plugin with a --ignore flag
in debian/libdoxia-java.poms
* Replaced the patch removing the dependency on doxia-core:test-jar
with a Maven rule
* Removed the patch setting the source/target level to 1.4
* Moved the package to Git
* Standards-Version updated to 3.9.6 (no changes)
* Switch to debhelper level 9
-- Emmanuel Bourg <ebourg@apache.org> Wed, 05 Aug 2015 13:55:10 +0200
doxia (1.1.4-2) unstable; urgency=low
* Team upload.
* Add --java-lib flag to install jars in /usr/share/java directory.
Thanks to Sjoerd Simons for the patch. (Closes: #676332).
* Remove Michael Koch from Uploaders lists.
Thanks for your work on this package. (Closes: #654012).
* Bump Standards-Version to 3.9.3. No changes were required.
-- Miguel Landaeta <miguel@miguel.cc> Wed, 06 Jun 2012 19:30:32 -0430
doxia (1.1.4-1) unstable; urgency=low
[Gabriele Giacone]
* Replaced classpath-doc/openjdk-6-doc with default-jdk-doc (Closes: #567272)
[tony mancill]
* Correct minor typos in long description (Closes: #612365)
[ Torsten Werner ]
* Newer but not newest upstream release.
- Add Build-Depends: libhttpcore-java and switch to httpclient 4.
- Do not remove maven-plugin from orig tarball.
* Remove Trygve and Paul from Uploaders list.
* Update Standards-Version: 3.9.2.
* Improve short descriptions.
* Use Maven to build the package.
- Disable tests because there are issues with Maven finding a test-jar.
- Add several (too many) patches.
-- Torsten Werner <twerner@debian.org> Fri, 09 Sep 2011 17:33:03 +0200
doxia (1.1.2-1) unstable; urgency=low
* New upstream release.
* Standards-Version to 3.8.4.
* Source format 3.0 (quilt)
- removed quilt as build dependency
- removed README.source
-- Gabriele Giacone <1o5g4r8o@gmail.com> Fri, 26 Feb 2010 00:58:38 +0100
doxia (1.1.1-1) unstable; urgency=low
* New upstream release.
* Build-Depends/Recommends libcommons-httpclient-java (>= 3.1-6).
* Build-Depends on debhelper (>= 7).
* Updated to Standards-Version 3.8.3.
-- Michael Koch <konqueror@gmx.de> Thu, 01 Oct 2009 08:03:40 +0200
doxia (1.1-3) unstable; urgency=low
* Upload to unstable.
-- Torsten Werner <twerner@debian.org> Sun, 09 Aug 2009 10:47:26 +0200
doxia (1.1-2) experimental; urgency=low
[ Ludovic Claude ]
* Remove test dependencies from Maven POM descriptors
[ Torsten Werner ]
* Remove extra Build-Depends-Indep: ant.
-- Torsten Werner <twerner@debian.org> Mon, 03 Aug 2009 21:33:12 +0200
doxia (1.1-1) experimental; urgency=low
[ Ludovic Claude ]
* New upstream version (Closes: #520760)
* Add myself to uploaders
* Add the Maven POMs to the package,
* Add a Build-Depends-Indep dependency on maven-repo-helper
* Use mh_installpom and mh_installjar to install the POM and the jar to the
Maven repository
* Remove the patch itext.diff, use a dependency on libitext1-java
instead to keep using version 1.x of iText.
* Add a dependency on fop and libcommons-configuration-java to build the new
doxia-module-fo
* Remove the dependency on libplexus-container-default-java, it's replaced
by a transitive dependency on libplexus-containers-java (from
libplexus-i18n-java)
* Remove the dependency on classpath-doc on the java-doc package,
it's not needed
* Remove full text of the Apache 2.0 license from debian/copyright
[ Torsten Werner ]
* Add missing Build-Depends: libcommons-lang-java.
* Upload to experimental.
-- Torsten Werner <twerner@debian.org> Mon, 13 Jul 2009 19:55:39 +0200
doxia (1.0-alpha-11-4) unstable; urgency=low
* Change debian/rules to really use default-jdk. (Closes: #535919)
-- Torsten Werner <twerner@debian.org> Mon, 06 Jul 2009 22:12:34 +0200
doxia (1.0-alpha-11-3) unstable; urgency=low
* Add missing Depends: ${misc:Depends}.
* Change Section: java.
* Update Standards-Version: 3.8.2 (no changes).
* Switch to default-jdk. (Closes: #526278)
-- Torsten Werner <twerner@debian.org> Wed, 01 Jul 2009 22:34:46 +0200
doxia (1.0-alpha-11-2) experimental; urgency=low
* Improve patch itext.diff.
-- Torsten Werner <twerner@debian.org> Fri, 28 Nov 2008 16:49:47 +0100
doxia (1.0-alpha-11-1) experimental; urgency=low
[ Michael Koch ]
* Added watch file.
* Added Homepage, Vcs-Svn and Vcs-Browser fields.
* Added myself to Uploaders.
[ Torsten Werner ]
* new upstream version
* Added myself to Uploaders.
* Updated Standards-Version to 3.8.0.
* Add patch itext.diff.
-- Torsten Werner <twerner@debian.org> Thu, 27 Nov 2008 20:37:58 +0100
doxia (1.0-alpha-7-1) unstable; urgency=low
* Initial release. (Closes: #413554)
-- Paul Cager <paul-debian@home.paulcager.org> Thu, 12 Jul 2007 10:11:17 +0100
Source: doxia
Section: java
Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Uploaders: Torsten Werner <twerner@debian.org>
Build-Depends:
debhelper (>= 11),
default-jdk,
default-jdk-doc,
fop (>= 1:2.0),
junit4,
libcommons-collections3-java,
libcommons-configuration-java,
libcommons-configuration-java-doc,
libcommons-lang-java,
libdoxia-sitetools-java,
libhttpclient-java,
libitext1-java,
liblog4j1.2-java,
liblog4j1.2-java-doc,
libmaven-doxia-tools-java,
libmaven-javadoc-plugin-java,
libmaven-parent-java,
libmaven-shade-plugin-java,
libmodello-maven-plugin-java,
libpegdown-java,
libplexus-component-metadata-java,
libplexus-container-default1.5-java,
libplexus-i18n-java,
libplexus-utils-java,
libplexus-utils-java-doc,
libxerces2-java,
maven-debian-helper (>= 2.2.2~)
Standards-Version: 4.2.1
Vcs-Git: https://salsa.debian.org/java-team/doxia.git
Vcs-Browser: https://salsa.debian.org/java-team/doxia
Homepage: http://maven.apache.org/doxia/
Package: libdoxia-java
Architecture: all
Depends: ${maven:Depends}, ${misc:Depends}, libdoxia-core-java (= ${source:Version})
Suggests: ${maven:OptionalDepends}, libdoxia-java-doc
Description: Doxia content generation framework (modules)
Doxia is a content generation framework which aims to provide its users
with powerful techniques for generating static and dynamic content.
.
Doxia can be used to generate static sites in addition to being
incorporated into dynamic content generation systems like blogs, wikis
and content management systems.
.
Doxia is used extensively by Maven and it powers the entire
documentation system of Maven. It gives Maven the ability to take any
document that Doxia supports and output it any format.
Package: libdoxia-core-java
Architecture: all
Depends: ${misc:Depends}, libcommons-lang-java, libhttpclient-java, libplexus-utils-java, libmaven-parent-java
Breaks: libdoxia-java (<= 1.1.4-2)
Replaces: libdoxia-java (<= 1.1.4-2)
Description: Doxia content generation framework (core)
Doxia is a content generation framework which aims to provide its users
with powerful techniques for generating static and dynamic content.
.
Doxia can be used to generate static sites in addition to being
incorporated into dynamic content generation systems like blogs, wikis
and content management systems.
.
Doxia is used extensively by Maven and it powers the entire
documentation system of Maven. It gives Maven the ability to take any
document that Doxia supports and output it any format.
.
This package contains the core modules (doxia-core, doxia-sink-api and
doxia-logging-api).
Package: libdoxia-java-doc
Architecture: all
Section: doc
Depends: ${maven:DocDepends}, ${misc:Depends}
Suggests: ${maven:DocOptionalDepends}
Description: Documentation for libdoxia-java
Doxia is a content generation framework which aims to provide its users
with powerful techniques for generating static and dynamic content.
.
Doxia can be used to generate static sites in addition to being
incorporated into dynamic content generation systems like blogs, wikis
and content management systems.
.
Doxia is used extensively by Maven and it powers the entire
documentation system of Maven. It gives Maven the ability to take any
document that Doxia supports and output it any format.
.
This package provides the API documentation for Doxia.
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Maven Doxia
Source: http://svn.apache.org/repos/asf/maven/doxia/doxia/
Files: *
Copyright: 2006-2016, The Apache Software Foundation
License: Apache-2.0
Files: debian/*
Copyright: 2007, Trygve Laugstøl <trygvis@inamo.no>
2007, Paul Cager <paul-debian@home.paulcager.org>
2008-2011, Torsten Werner <twerner@debian.org>
2009, Ludovic Claude <ludovic.claude@laposte.net>
2009, Michael Koch <konqueror@gmx.de>
2010-2011, Gabriele Giacone <1o5g4r8o@gmail.com>
2012, Miguel Landaeta <miguel@miguel.cc>
2015-2017, Emmanuel Bourg <ebourg@apache.org>
License: Apache-2.0
License: Apache-2.0
On Debian systems, the full text of the Apache-2.0 license
can be found in the file '/usr/share/common-licenses/Apache-2.0'
Document: libdoxia-java
Title: API Javadoc for Doxia
Author: Doxia developers
Abstract: This is the API Javadoc provided for the
libdoxia-java library.
Section: Programming
Format: HTML
Index: /usr/share/doc/libdoxia-java/api/index.html
Files: /usr/share/doc/libdoxia-java/api/*
target/site/apidocs/* usr/share/doc/libdoxia-java/api
# List of POM files for the package
# Format of this file is:
# <path to pom file> [option]*
# where option can be:
# --ignore: ignore this POM and its artifact if any
# --ignore-pom: don't install the POM. To use on POM files that are created
# temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms]
# --no-parent: remove the <parent> tag from the POM
# --package=<package>: an alternative package to use when installing this POM
# and its artifact
# --has-package-version: to indicate that the original version of the POM is the same as the upstream part
# of the version for the package.
# --keep-elements=<elem1,elem2>: a list of XML elements to keep in the POM
# during a clean operation with mh_cleanpom or mh_installpom
# --artifact=<path>: path to the build artifact associated with this POM,
# it will be installed when using the command mh_install. [mh_install]
# --java-lib: install the jar into /usr/share/java to comply with Debian
# packaging guidelines
# --usj-name=<name>: name to use when installing the library in /usr/share/java
# --usj-version=<version>: version to use when installing the library in /usr/share/java
# --no-usj-versionless: don't install the versionless link in /usr/share/java
# --dest-jar=<path>: the destination for the real jar.
# It will be installed with mh_install. [mh_install]
# --classifier=<classifier>: Optional, the classifier for the jar. Empty by default.
# --site-xml=<location>: Optional, the location for site.xml if it needs to be installed.
# Empty by default. [mh_install]
#
pom.xml --has-package-version --java-lib --package=libdoxia-core-java
doxia-logging-api/pom.xml --has-package-version --java-lib --package=libdoxia-core-java
doxia-sink-api/pom.xml --has-package-version --java-lib --package=libdoxia-core-java
doxia-test-docs/pom.xml --ignore
doxia-core/pom.xml --has-package-version --java-lib --package=libdoxia-core-java
doxia-modules/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-apt/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-confluence/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-docbook-simple/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-fml/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-fo/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-itext/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-latex/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-markdown/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-rtf/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-twiki/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-xdoc/pom.xml --has-package-version --java-lib
doxia-modules/doxia-module-xhtml/pom.xml --has-package-version --java-lib
# Maven ignore rules - ignore some Maven dependencies and plugins
# Format of this file is:
# [group] [artifact] [type] [version] [classifier] [scope]
# where each element can be either
# - the exact string, for example org.apache for the group, or 3.1
# for the version. In this case, the element is simply matched
# and left as it is
# - * (the star character, alone). In this case, anything will
# match and be left as it is. For example, using * on the
# position of the artifact field will match any artifact id
# All elements much match before a rule can be applied
# Example rule: match jar with groupid= junit, artifactid= junit
# and version starting with 3., this dependency is then removed
# from the POM
# junit junit jar s/3\\..*/3.x/
org.apache.maven.plugins maven-project-info-reports-plugin * * * *
org.apache.maven.plugins maven-scm-publish-plugin
org.codehaus.mojo clirr-maven-plugin * * * *
org.apache.maven.doxia doxia-core test-jar * * *
org.apache.maven.doxia doxia-test-docs * * * *
org.apache.rat apache-rat-plugin
xmlunit xmlunit
# Include here properties to pass to Maven during the build.
# For example:
maven.test.skip=true
project.build.sourceEncoding=UTF-8
# Maven rules - transform Maven dependencies and plugins
# Format of this file is:
# [group] [artifact] [type] [version] [classifier] [scope]
# where each element can be either
# - the exact string, for example org.apache for the group, or 3.1
# for the version. In this case, the element is simply matched
# and left as it is
# - * (the star character, alone). In this case, anything will
# match and be left as it is. For example, using * on the
# position of the artifact field will match any artifact id
# - a regular expression of the form s/match/replace/
# in this case, elements that match are transformed using
# the regex rule.
# All elements much match before a rule can be applied
# Example rule: match jar with groupid= junit, artifactid= junit
# and version starting with 3., replacing the version with 3.x
# junit junit jar s/3\\..*/3.x/
com.lowagie itext jar 1.4 * *
commons-collections commons-collections * s/.*/3.x/ * *
junit junit jar s/.*/4.x/ * *
log4j log4j jar s/1\.2\..*/1.2.x/ * *
org.codehaus.plexus plexus-container-default jar s/.*/1.5.5/ * *
org.apache.maven maven-parent pom s/.*/debian/ * *
#!/bin/sh -e
VERSION=$2
TAR=../doxia_$VERSION.orig.tar.xz
DIR=doxia-$VERSION
TAG=$(echo "doxia-$VERSION" | sed -re's/~(alpha|beta)/-\1-/')
svn export http://svn.apache.org/repos/asf/maven/doxia/doxia/tags/${TAG}/ $DIR
XZ_OPT=--best tar -c -J -f $TAR --exclude '*.jar' --exclude '*.class' $DIR
rm -rf $DIR ../$TAG
Description: Port to fop-2.0
Author: Michael Simacek <msimacek@redhat.com>
--- a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java
+++ b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java
@@ -24,6 +24,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.net.URI;
import java.util.Date;
import javax.xml.transform.Result;
@@ -38,6 +39,7 @@
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
+import org.apache.fop.apps.FopFactoryBuilder;
import org.apache.fop.apps.MimeConstants;
import org.apache.maven.doxia.document.DocumentModel;
import org.codehaus.plexus.util.IOUtil;
@@ -52,28 +54,11 @@
*/
public class FoUtils
{
- /** To reuse the FopFactory **/
- private static final FopFactory FOP_FACTORY = FopFactory.newInstance();
-
/** To reuse the TransformerFactory **/
private static final TransformerFactory TRANSFORMER_FACTORY = TransformerFactory.newInstance();
- /**
- * Converts an FO file to a PDF file using FOP.
- *
- * @param fo the FO file, not null.
- * @param pdf the target PDF file, not null.
- * @param resourceDir The base directory for relative path resolution, could be null.
- * If null, defaults to the parent directory of fo.
- * @param documentModel the document model to add PDF metadatas like author, title and keywords, could be null.
- * @throws javax.xml.transform.TransformerException In case of a conversion problem.
- * @since 1.1.1
- */
- public static void convertFO2PDF( File fo, File pdf, String resourceDir, DocumentModel documentModel )
- throws TransformerException
- {
- FOUserAgent foUserAgent = getDefaultUserAgent( fo, resourceDir );
+ private static void prepareUserAgent( FOUserAgent foUserAgent, DocumentModel documentModel ) {
if ( documentModel != null && documentModel.getMeta() != null )
{
// http://xmlgraphics.apache.org/fop/embedding.html#user-agent
@@ -113,8 +98,6 @@
{
foUserAgent.setCreationDate( new Date() );
}
-
- convertFO2PDF( fo, pdf, resourceDir, foUserAgent );
}
/**
@@ -124,16 +107,13 @@
* @param pdf the target PDF file, not null.
* @param resourceDir The base directory for relative path resolution, could be null.
* If null, defaults to the parent directory of fo.
- * @param foUserAgent the FOUserAgent to use.
- * May be null, in which case a default user agent will be used.
+ * @param documentModel the document model to add PDF metadatas like author, title and keywords, could be null.
* @throws javax.xml.transform.TransformerException In case of a conversion problem.
* @since 1.1.1
*/
- public static void convertFO2PDF( File fo, File pdf, String resourceDir, FOUserAgent foUserAgent )
+ public static void convertFO2PDF( File fo, File pdf, String resourceDir, DocumentModel documentModel )
throws TransformerException
{
- FOUserAgent userAgent = ( foUserAgent == null ? getDefaultUserAgent( fo, resourceDir ) : foUserAgent );
-
OutputStream out = null;
try
{
@@ -149,7 +129,11 @@
Result res = null;
try
{
- Fop fop = FOP_FACTORY.newFop( MimeConstants.MIME_PDF, userAgent, out );
+ URI baseURI = getBaseURI( fo, resourceDir );
+ FopFactory fopFactory = new FopFactoryBuilder( baseURI ).build();
+ FOUserAgent userAgent = fopFactory.newFOUserAgent();
+ prepareUserAgent( userAgent, documentModel );
+ Fop fop = fopFactory.newFop( MimeConstants.MIME_PDF, userAgent, out );
res = new SAXResult( fop.getDefaultHandler() );
}
catch ( FOPException e )
@@ -193,34 +177,22 @@
}
/**
- * Returns a base URL to be used by the FOUserAgent.
+ * Returns a base URI.
*
* @param fo the FO file.
* @param resourceDir the resource directory.
- * @return String.
+ * @return URI.
*/
- private static String getBaseURL( File fo, String resourceDir )
+ private static URI getBaseURI( File fo, String resourceDir )
{
- String url = null;
-
if ( resourceDir == null )
{
- url = "file:///" + fo.getParent() + "/";
+ return fo.getParentFile().toURI();
}
else
{
- url = "file:///" + resourceDir + "/";
+ return new File( resourceDir + "/" ).toURI();
}
-
- return url;
- }
-
- private static FOUserAgent getDefaultUserAgent( File fo, String resourceDir )
- {
- FOUserAgent foUserAgent = FOP_FACTORY.newFOUserAgent();
- foUserAgent.setBaseURL( getBaseURL( fo, resourceDir ) );
-
- return foUserAgent;
}
private FoUtils()
Description: Keep the RenderingContext class (moved to doxia-sitetools since the version 1.6)
to preserve the backward compatibility
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- /dev/null
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java
@@ -0,0 +1,194 @@
+package org.apache.maven.doxia.sink.render;
+
+/*
+ * 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.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.codehaus.plexus.util.PathTool;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * The rendering context of a document.
+ *
+ * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
+ * @version $Id: RenderingContext.java 1090706 2011-04-09 23:15:28Z hboutemy $
+ * @since 1.1
+ */
+public class RenderingContext
+{
+ private final File basedir;
+
+ private final String inputName;
+
+ private final String outputName;
+
+ private final String parserId;
+
+ private final String relativePath;
+
+ private final String extension;
+
+ private Map<String, String> attributes;
+
+ /**
+ * <p>Constructor for RenderingContext.</p>
+ *
+ * @param basedir a {@link java.io.File} object.
+ * @param document a {@link java.lang.String} object.
+ */
+ public RenderingContext( File basedir, String document )
+ {
+ this( basedir, document, null );
+ }
+
+ /**
+ * <p>Constructor for RenderingContext.</p>
+ *
+ * @param basedir a {@link java.io.File} object.
+ * @param document a {@link java.lang.String} object.
+ * @param parserId a {@link java.lang.String} object.
+ */
+ public RenderingContext( File basedir, String document, String parserId )
+ {
+ this( basedir, document, parserId, null );
+
+ }
+
+ /**
+ * <p>Constructor for RenderingContext.</p>
+ *
+ * @param basedir a {@link java.io.File} object.
+ * @param document a {@link java.lang.String} object.
+ * @param parserId a {@link java.lang.String} object.
+ * @param extension a {@link java.lang.String} object.
+ */
+ public RenderingContext( File basedir, String document, String parserId, String extension )
+ {
+ this.basedir = basedir;
+ this.extension = extension;
+ if ( StringUtils.isNotEmpty( extension ) )
+ {
+ // here we now the parserId we can play with this
+ // index.xml -> index.html
+ // index.xml.vm -> index.html
+ // download.apt.vm --> download.html
+ int startIndexOfExtension =
+ document.toLowerCase( Locale.ENGLISH ).indexOf( "." + extension.toLowerCase( Locale.ENGLISH ) );
+ String fileNameWithoutExt = document.substring( 0, startIndexOfExtension );
+ this.outputName = fileNameWithoutExt + ".html";
+ }
+ else
+ {
+ this.outputName = document.substring( 0, document.indexOf( '.' ) ).replace( '\\', '/' ) + ".html";
+ }
+ this.relativePath = PathTool.getRelativePath( basedir.getPath(), new File( basedir, document ).getPath() );
+
+ this.inputName = document;
+
+ this.parserId = parserId;
+
+ this.attributes = new HashMap<String, String>();
+ }
+
+ /**
+ * <p>Getter for the field <code>basedir</code>.</p>
+ *
+ * @return a {@link java.io.File} object.
+ */
+ public File getBasedir()
+ {
+ return basedir;
+ }
+
+ /**
+ * <p>Getter for the field <code>inputName</code>.</p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ public String getInputName()
+ {
+ return inputName;
+ }
+
+ /**
+ * <p>Getter for the field <code>outputName</code>.</p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ public String getOutputName()
+ {
+ return outputName;
+ }
+
+ /**
+ * <p>Getter for the field <code>parserId</code>.</p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ public String getParserId()
+ {
+ return parserId;
+ }
+
+ /**
+ * <p>Getter for the field <code>relativePath</code>.</p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ public String getRelativePath()
+ {
+ return relativePath;
+ }
+
+ /**
+ * <p>setAttribute.</p>
+ *
+ * @param key a {@link java.lang.String} object.
+ * @param value a {@link java.lang.String} object.
+ */
+ public void setAttribute( String key, String value )
+ {
+ attributes.put( key, value );
+ }
+
+ /**
+ * <p>getAttribute.</p>
+ *
+ * @param key a {@link java.lang.String} object.
+ * @return a {@link java.lang.String} object.
+ */
+ public String getAttribute( String key )
+ {
+ return (String) attributes.get( key );
+ }
+
+ /**
+ * <p>Getter for the field <code>extension</code>.</p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ public String getExtension()
+ {
+ return extension;
+ }
+}
0008-fop2-compatibility.patch
0009-preserve-rendering-context.patch
#!/usr/bin/make -f
%:
dh $@
version=3
opts="uversionmangle=s/-(alpha|beta)-/~$1/" \
http://svn.apache.org/repos/asf/maven/doxia/doxia/tags/ \
doxia-(\d.*)/ debian debian/orig-tar.sh
<?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.7</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>doxia-core</artifactId>
<name>Doxia :: Core</name>
<description>Doxia core classes and interfaces.</description>
<dependencies>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-sink-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-logging-api</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.0.1</version>
</dependency>
<!-- test -->
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.5</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources/</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<executions>
<execution>
<id>descriptor</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
<goal>xpp3-reader</goal>
<goal>xpp3-writer</goal>
<goal>xsd</goal>
</goals>
</execution>
<execution>
<id>docs</id>
<phase>pre-site</phase>
<goals>
<goal>xdoc</goal>
<goal>xsd</goal>
</goals>
</execution>
</executions>
<configuration>
<version>1.0.1</version>
<models>
<model>src/main/mdo/document.mdo</model>
</models>
</configuration>
</plugin>
</plugins>
</build>
</project>
package org.apache.maven.doxia;
/*
* 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.logging.PlexusLoggerWrapper;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.parser.Parser;
import org.apache.maven.doxia.parser.manager.ParserManager;
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 java.io.Reader;
/**
* Simple implementation of the Doxia interface:
* uses a ParserManager to lookup a parser.
*
* @author Jason van Zyl
* @version $Id: DefaultDoxia.java 1345590 2012-06-02 21:36:10Z hboutemy $
* @since 1.0
*/
@Component( role = Doxia.class )
public class DefaultDoxia
extends AbstractLogEnabled
implements Doxia
{
@Requirement
private ParserManager parserManager;
// ----------------------------------------------------------------------
// This remains because the sinks are not threadsafe which they probably
// should be. In some places a constructor is used to initialize a sink
// which can probably be done away with.
// ----------------------------------------------------------------------
/** {@inheritDoc} */
public void parse( Reader source, String parserId, Sink sink )
throws ParserNotFoundException, ParseException
{
Parser parser = parserManager.getParser( parserId );
parser.enableLogging( new PlexusLoggerWrapper( getLogger() ) );
parser.parse( source, sink );
}
/** {@inheritDoc} */
public Parser getParser( String parserId )
throws ParserNotFoundException
{
return parserManager.getParser( parserId );
}
}