[doxia] 32/35: Keep the RenderingContext class to preserve the backward compatibility
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Fri Jul 28 11:19:16 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to branch master
in repository doxia.
commit 7a4b2bfe550bef435ac8ebba3b498ea464d644ca
Author: Emmanuel Bourg <ebourg at apache.org>
Date: Fri Jul 28 11:47:30 2017 +0200
Keep the RenderingContext class to preserve the backward compatibility
---
debian/changelog | 1 +
.../patches/0009-preserve-rendering-context.patch | 201 +++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 203 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 542c7ac..5e5ec25 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ doxia (1.7-1) UNRELEASED; urgency=medium
- No longer build the doxia-book module (removed upstream)
- Ignore 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
diff --git a/debian/patches/0009-preserve-rendering-context.patch b/debian/patches/0009-preserve-rendering-context.patch
new file mode 100644
index 0000000..3f08864
--- /dev/null
+++ b/debian/patches/0009-preserve-rendering-context.patch
@@ -0,0 +1,201 @@
+Description: Keep the RenderingContext class (moved to doxia-sitetools since the version 1.6)
+ to preserve the backward compatibility
+Author: Emmanuel Bourg <ebourg at 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 at 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;
++ }
++}
diff --git a/debian/patches/series b/debian/patches/series
index 7664d14..f9ed988 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
0008-fop2-compatibility.patch
+0009-preserve-rendering-context.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/doxia.git
More information about the pkg-java-commits
mailing list