Browse Source

FOP-2733: Drop dependency on Avalon-Framework


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1851806 13f79535-47bb-0310-9956-ffa450edef68
pull/47/head
ssteiner 9 months ago
parent
commit
bd7d504878
73 changed files with 863 additions and 396 deletions
  1. 0
    10
      fop-core/pom.xml
  2. 48
    0
      fop-core/src/main/java/org/apache/fop/activity/ContainerUtil.java
  3. 24
    0
      fop-core/src/main/java/org/apache/fop/activity/Initializable.java
  4. 2
    2
      fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java
  5. 3
    3
      fop-core/src/main/java/org/apache/fop/apps/FopConfParser.java
  6. 1
    1
      fop-core/src/main/java/org/apache/fop/apps/FopFactory.java
  7. 1
    2
      fop-core/src/main/java/org/apache/fop/apps/FopFactoryBuilder.java
  8. 1
    2
      fop-core/src/main/java/org/apache/fop/apps/FopFactoryConfig.java
  9. 0
    3
      fop-core/src/main/java/org/apache/fop/cli/Main.java
  10. 24
    0
      fop-core/src/main/java/org/apache/fop/configuration/Configurable.java
  11. 61
    0
      fop-core/src/main/java/org/apache/fop/configuration/Configuration.java
  12. 30
    0
      fop-core/src/main/java/org/apache/fop/configuration/ConfigurationException.java
  13. 293
    0
      fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java
  14. 76
    0
      fop-core/src/main/java/org/apache/fop/configuration/DefaultConfigurationBuilder.java
  15. 124
    0
      fop-core/src/main/java/org/apache/fop/configuration/NullConfiguration.java
  16. 2
    2
      fop-core/src/main/java/org/apache/fop/fonts/DefaultFontConfig.java
  17. 2
    3
      fop-core/src/main/java/org/apache/fop/fonts/FontConfig.java
  18. 2
    2
      fop-core/src/main/java/org/apache/fop/fonts/FontManagerConfigurator.java
  19. 1
    2
      fop-core/src/main/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
  20. 1
    2
      fop-core/src/main/java/org/apache/fop/render/RendererConfig.java
  21. 2
    0
      fop-core/src/main/java/org/apache/fop/render/RendererConfigOption.java
  22. 2
    2
      fop-core/src/main/java/org/apache/fop/render/XMLHandlerConfigurator.java
  23. 3
    3
      fop-core/src/main/java/org/apache/fop/render/afp/AFPFontConfig.java
  24. 1
    2
      fop-core/src/main/java/org/apache/fop/render/afp/AFPInfo.java
  25. 2
    2
      fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererConfig.java
  26. 2
    3
      fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererContext.java
  27. 5
    0
      fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererOption.java
  28. 1
    1
      fop-core/src/main/java/org/apache/fop/render/afp/AFPShadingMode.java
  29. 13
    3
      fop-core/src/main/java/org/apache/fop/render/bitmap/BitmapRendererConfig.java
  30. 1
    2
      fop-core/src/main/java/org/apache/fop/render/bitmap/PNGRendererConfig.java
  31. 1
    2
      fop-core/src/main/java/org/apache/fop/render/bitmap/TIFFRendererConfig.java
  32. 1
    2
      fop-core/src/main/java/org/apache/fop/render/intermediate/IFRendererConfig.java
  33. 1
    2
      fop-core/src/main/java/org/apache/fop/render/java2d/Java2DRendererConfig.java
  34. 5
    0
      fop-core/src/main/java/org/apache/fop/render/java2d/Java2DRendererOption.java
  35. 17
    6
      fop-core/src/main/java/org/apache/fop/render/pcl/Java2DRendererOption.java
  36. 1
    2
      fop-core/src/main/java/org/apache/fop/render/pcl/PCLRendererConfig.java
  37. 8
    4
      fop-core/src/main/java/org/apache/fop/render/pdf/PDFRendererConfig.java
  38. 1
    1
      fop-core/src/main/java/org/apache/fop/render/pdf/PDFSVGHandler.java
  39. 2
    2
      fop-core/src/main/java/org/apache/fop/render/ps/PSRendererConfig.java
  40. 1
    2
      fop-core/src/main/java/org/apache/fop/render/ps/PSSVGHandler.java
  41. 1
    2
      fop-core/src/main/java/org/apache/fop/render/txt/TxtRendererConfig.java
  42. 4
    4
      fop-core/src/main/java/org/apache/fop/svg/AbstractFOPTranscoder.java
  43. 2
    3
      fop-core/src/main/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java
  44. 1
    2
      fop-core/src/main/java/org/apache/fop/svg/PDFTranscoder.java
  45. 2
    3
      fop-core/src/test/java/org/apache/fop/apps/AbstractRendererConfigParserTester.java
  46. 1
    2
      fop-core/src/test/java/org/apache/fop/apps/AbstractRendererConfiguratorTest.java
  47. 1
    2
      fop-core/src/test/java/org/apache/fop/apps/MutableConfig.java
  48. 1
    1
      fop-core/src/test/java/org/apache/fop/config/BaseUserConfigTest.java
  49. 4
    4
      fop-core/src/test/java/org/apache/fop/threading/AvalonAdapter.java
  50. 20
    18
      fop-core/src/test/java/org/apache/fop/threading/FOPTestbed.java
  51. 12
    8
      fop-core/src/test/java/org/apache/fop/threading/FOProcessorImpl.java
  52. 13
    8
      fop-core/src/test/java/org/apache/fop/threading/IFProcessorImpl.java
  53. 6
    7
      fop-core/src/test/java/org/apache/fop/threading/Main.java
  54. 4
    1
      fop-core/src/test/java/org/apache/fop/threading/Processor.java
  55. 3
    3
      fop-core/src/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java
  56. 4
    4
      fop-core/src/test/java/org/apache/fop/visual/BatchDiffer.java
  57. 3
    1
      fop-core/src/test/java/org/apache/fop/visual/BitmapProducer.java
  58. 3
    3
      fop-core/src/test/java/org/apache/fop/visual/BitmapProducerJava2D.java
  59. 3
    4
      fop-core/src/test/java/org/apache/fop/visual/ReferenceBitmapLoader.java
  60. 0
    12
      fop-servlet/pom.xml
  61. 0
    11
      fop-transcoder-allinone/pom.xml
  62. 0
    4
      fop-transcoder-allinone/src/tools/resources/assembly/assembly.xml
  63. 1
    8
      fop/build.xml
  64. 0
    1
      fop/examples/embedding/build.xml
  65. 1
    3
      fop/examples/embedding/java/embedding/ExampleAWTViewer.java
  66. 4
    4
      fop/examples/embedding/java/embedding/ExampleEPS.java
  67. 3
    3
      fop/examples/embedding/java/embedding/ExampleJava2D2PDF.java
  68. 0
    8
      fop/lib/README.txt
  69. BIN
      fop/lib/avalon-framework-api-4.3.1.jar
  70. BIN
      fop/lib/avalon-framework-impl-4.3.1.jar
  71. 0
    175
      fop/lib/avalon-framework.LICENSE.txt
  72. 0
    11
      fop/lib/avalon-framework.NOTICE.TXT
  73. 0
    1
      pom.xml

+ 0
- 10
fop-core/pom.xml View File

@@ -87,16 +87,6 @@
<artifactId>ant</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.avalon.framework</groupId>
<artifactId>avalon-framework-api</artifactId>
<version>${avalon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.avalon.framework</groupId>
<artifactId>avalon-framework-impl</artifactId>
<version>${avalon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>fontbox</artifactId>

+ 48
- 0
fop-core/src/main/java/org/apache/fop/activity/ContainerUtil.java View File

@@ -0,0 +1,48 @@
/*
* 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.
*/

/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
package org.apache.fop.activity;

import org.apache.fop.configuration.Configurable;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;

public final class ContainerUtil {

private ContainerUtil() {
// Never invoked.
}

public static void configure(Configurable configurable, Configuration configuration) {
try {
configurable.configure(configuration);
} catch (ConfigurationException e) {
e.printStackTrace();
throw new IllegalStateException(e);
}
}

public static void initialize(Initializable initializable) {
try {
initializable.initialize();
} catch (Exception e) {
e.printStackTrace();
throw new IllegalStateException(e);
}
}
}

+ 24
- 0
fop-core/src/main/java/org/apache/fop/activity/Initializable.java View File

@@ -0,0 +1,24 @@
/*
* 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.
*/

/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
package org.apache.fop.activity;

public interface Initializable {

void initialize() throws Exception;
}

+ 2
- 2
fop-core/src/main/java/org/apache/fop/apps/FOUserAgent.java View File

@@ -30,8 +30,6 @@ import java.util.Map;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@@ -47,6 +45,8 @@ import org.apache.fop.accessibility.Accessibility;
import org.apache.fop.accessibility.DummyStructureTreeEventHandler;
import org.apache.fop.accessibility.StructureTreeEventHandler;
import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.events.DefaultEventBroadcaster;
import org.apache.fop.events.Event;
import org.apache.fop.events.EventBroadcaster;

+ 3
- 3
fop-core/src/main/java/org/apache/fop/apps/FopConfParser.java View File

@@ -31,9 +31,6 @@ import java.util.Map;

import org.xml.sax.SAXException;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@@ -43,6 +40,9 @@ import org.apache.xmlgraphics.io.ResourceResolver;

import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.apps.io.ResourceResolverFactory;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.configuration.DefaultConfigurationBuilder;
import org.apache.fop.fonts.FontManagerConfigurator;
import org.apache.fop.hyphenation.HyphenationTreeCache;
import org.apache.fop.hyphenation.Hyphenator;

+ 1
- 1
fop-core/src/main/java/org/apache/fop/apps/FopFactory.java View File

@@ -30,7 +30,6 @@ import java.util.Set;

import org.xml.sax.SAXException;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@@ -41,6 +40,7 @@ import org.apache.xmlgraphics.util.UnitConv;

import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.apps.io.ResourceResolverFactory;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fo.ElementMapping;
import org.apache.fop.fo.ElementMappingRegistry;
import org.apache.fop.fonts.FontManager;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/apps/FopFactoryBuilder.java View File

@@ -26,8 +26,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.xmlgraphics.image.loader.ImageContext;
import org.apache.xmlgraphics.image.loader.ImageManager;
import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver;
@@ -35,6 +33,7 @@ import org.apache.xmlgraphics.io.ResourceResolver;

import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.apps.io.ResourceResolverFactory;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.FontManager;
import org.apache.fop.layoutmgr.LayoutManagerMaker;


+ 1
- 2
fop-core/src/main/java/org/apache/fop/apps/FopFactoryConfig.java View File

@@ -23,13 +23,12 @@ import java.net.URI;
import java.util.Map;
import java.util.Set;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.xmlgraphics.image.loader.ImageManager;
import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver;
import org.apache.xmlgraphics.io.ResourceResolver;

import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.FontManager;
import org.apache.fop.layoutmgr.LayoutManagerMaker;


+ 0
- 3
fop-core/src/main/java/org/apache/fop/cli/Main.java View File

@@ -112,9 +112,6 @@ public final class Main {
try {
//System.out.println(Thread.currentThread().getContextClassLoader());
Class clazz = Class.forName("org.apache.commons.io.IOUtils");
if (clazz != null) {
clazz = Class.forName("org.apache.avalon.framework.configuration.Configuration");
}
return (clazz != null);
} catch (Exception e) {
return false;

+ 24
- 0
fop-core/src/main/java/org/apache/fop/configuration/Configurable.java View File

@@ -0,0 +1,24 @@
/*
* 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.
*/

/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
package org.apache.fop.configuration;

public interface Configurable {

void configure(Configuration cfg) throws ConfigurationException;
}

+ 61
- 0
fop-core/src/main/java/org/apache/fop/configuration/Configuration.java View File

@@ -0,0 +1,61 @@
/*
* 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.
*/

/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
package org.apache.fop.configuration;

public interface Configuration {

Configuration getChild(String key);

Configuration getChild(String key, boolean required);

Configuration[] getChildren(String key);

String[] getAttributeNames();

String getAttribute(String key) throws ConfigurationException;

String getAttribute(String key, String defaultValue);

boolean getAttributeAsBoolean(String key, boolean defaultValue);

float getAttributeAsFloat(String key) throws ConfigurationException;

float getAttributeAsFloat(String key, float defaultValue);

int getAttributeAsInteger(String key, int defaultValue);

String getValue() throws ConfigurationException;

String getValue(String defaultValue);

boolean getValueAsBoolean() throws ConfigurationException;

boolean getValueAsBoolean(boolean defaultValue);

int getValueAsInteger() throws ConfigurationException;

int getValueAsInteger(int defaultValue);

float getValueAsFloat() throws ConfigurationException;

float getValueAsFloat(float defaultValue);

String getLocation();

}

+ 30
- 0
fop-core/src/main/java/org/apache/fop/configuration/ConfigurationException.java View File

@@ -0,0 +1,30 @@
/*
* 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.
*/

/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
package org.apache.fop.configuration;

public class ConfigurationException extends Exception {

public ConfigurationException(String message) {
super(message);
}

public ConfigurationException(String message, Throwable cause) {
super(message, cause);
}
}

+ 293
- 0
fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java View File

@@ -0,0 +1,293 @@
/*
* 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.
*/

/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
package org.apache.fop.configuration;

import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class DefaultConfiguration implements Configuration {

static final DocumentBuilderFactory DBF = DocumentBuilderFactory.newInstance();

static {
DBF.setNamespaceAware(false);
DBF.setValidating(false);
DBF.setIgnoringComments(true);
DBF.setIgnoringElementContentWhitespace(true);
DBF.setExpandEntityReferences(true);
}

/**
* @deprecated For debug only.
*/
public static String toString(Document document) {
try {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
//initialize StreamResult with File object to save to file
StreamResult result = new StreamResult(new StringWriter());
DOMSource source = new DOMSource(document);
transformer.transform(source, result);
return result.getWriter().toString();
} catch (TransformerException e) {
throw new IllegalStateException(e);
}
}

private Element element;

public DefaultConfiguration(String key) {
DocumentBuilder builder = null;
try {
builder = DBF.newDocumentBuilder();
} catch (ParserConfigurationException e) {
e.printStackTrace();
throw new IllegalStateException(e);
}
Document doc = builder.newDocument();
// create the root element node
element = doc.createElement(key);
doc.appendChild(element);
}

DefaultConfiguration(Element element) {
this.element = element;
}

Element getElement() {
return element;
}

public void addChild(DefaultConfiguration configuration) {
Element node = (Element) element.getOwnerDocument().importNode(configuration.getElement(), true);
element.appendChild(node);
}

String getValue0() {
String result = element.getTextContent();
if (result == null) {
result = "";
}
return result;
}

@Override
public Configuration getChild(String key) {
NodeList nl = element.getElementsByTagName(key);
for (int i = 0; i < nl.getLength(); ++i) {
Node n = nl.item(i);
if (n.getNodeName().equals(key)) {
return new DefaultConfiguration((Element) n);
}
}
return NullConfiguration.INSTANCE;
}

@Override
public Configuration getChild(String key, boolean required) {
Configuration result = getChild(key);
if (!required && result == NullConfiguration.INSTANCE) {
return null;
}
if (required && (result == null || result == NullConfiguration.INSTANCE)) {
// throw new IllegalStateException("No child '" + key + "'");
return NullConfiguration.INSTANCE;
}
return result;
}

@Override
public Configuration[] getChildren(String key) {
NodeList nl = element.getElementsByTagName(key);
Configuration[] result = new Configuration[nl.getLength()];
for (int i = 0; i < nl.getLength(); ++i) {
Node n = nl.item(i);
result[i] = new DefaultConfiguration((Element) n);
}
return result;
}

@Override
public String[] getAttributeNames() {
NamedNodeMap nnm = element.getAttributes();
String[] result = new String[nnm.getLength()];
for (int i = 0; i < nnm.getLength(); ++i) {
Node n = nnm.item(i);
result[i] = n.getNodeName();
}
return result;
}

@Override
public String getAttribute(String key) {
String result = element.getAttribute(key);
if ("".equals(result)) {
result = null;
}
return result;
}

@Override
public String getAttribute(String key, String defaultValue) {
String result = getAttribute(key);
if (result == null || "".equals(result)) {
result = defaultValue;
}
return result;
}

@Override
public boolean getAttributeAsBoolean(String key, boolean defaultValue) {
String result = getAttribute(key);
if (result == null || "".equals(result)) {
return defaultValue;
}
return "true".equalsIgnoreCase(result) || "yes".equalsIgnoreCase(result);
}

@Override
public float getAttributeAsFloat(String key) throws ConfigurationException {
return Float.parseFloat(getAttribute(key));
}

@Override
public float getAttributeAsFloat(String key, float defaultValue) {
String result = getAttribute(key);
if (result == null || "".equals(result)) {
return defaultValue;
}
return Float.parseFloat(result);
}

@Override
public int getAttributeAsInteger(String key, int defaultValue) {
String result = getAttribute(key);
if (result == null || "".equals(result)) {
return defaultValue;
}
return Integer.parseInt(result);
}

@Override
public String getValue() throws ConfigurationException {
String result = getValue0();
if (result == null || "".equals(result)) {
throw new ConfigurationException("No value in " + element.getNodeName());
}
return result;
}

@Override
public String getValue(String defaultValue) {
String result = getValue0();
if (result == null || "".equals(result)) {
result = defaultValue;
}
return result;
}

@Override
public boolean getValueAsBoolean() throws ConfigurationException {
return Boolean.parseBoolean(getValue0());
}

@Override
public boolean getValueAsBoolean(boolean defaultValue) {
String result = getValue0().trim();
if ("".equals(result)) {
return defaultValue;
}
return Boolean.parseBoolean(result);
}

@Override
public int getValueAsInteger() throws ConfigurationException {
try {
return Integer.parseInt(getValue0());
} catch (NumberFormatException e) {
throw new ConfigurationException("Not an integer", e);
}
}

@Override
public int getValueAsInteger(int defaultValue) {
String result = getValue0();
if (result == null || "".equals(result)) {
return defaultValue;
}
return Integer.parseInt(result);
}

@Override
public float getValueAsFloat() throws ConfigurationException {
try {
return Float.parseFloat(getValue0());
} catch (NumberFormatException e) {
throw new ConfigurationException("Not a float", e);
}
}

@Override
public float getValueAsFloat(float defaultValue) {
String result = getValue0();
if (result == null || "".equals(result)) {
return defaultValue;
}
return Float.parseFloat(getValue0());
}

@Override
public String getLocation() {
List<String> path = new ArrayList<String>();
for (Node el = element; el != null; el = el.getParentNode()) {
if (el instanceof Element) {
path.add(((Element) el).getTagName());
}
}
Collections.reverse(path);

StringBuilder sb = new StringBuilder();
for (String s : path) {
if (sb.length() > 0) {
sb.append("/");
}
sb.append(s);
}
return sb.toString();
}
}

+ 76
- 0
fop-core/src/main/java/org/apache/fop/configuration/DefaultConfigurationBuilder.java View File

@@ -0,0 +1,76 @@
/*
* 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.
*/

/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
package org.apache.fop.configuration;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class DefaultConfigurationBuilder {

private static final Log LOG = LogFactory.getLog(DefaultConfigurationBuilder.class.getName());

public DefaultConfiguration build(InputStream confStream) throws ConfigurationException {
try {
DocumentBuilder builder = DefaultConfiguration.DBF.newDocumentBuilder();
Document document = builder.parse(confStream);
return new DefaultConfiguration(document.getDocumentElement());
} catch (DOMException e) {
throw new ConfigurationException("xml parse error", e);
} catch (ParserConfigurationException e) {
throw new ConfigurationException("xml parse error", e);
} catch (IOException e) {
throw new ConfigurationException("xml parse error", e);
} catch (SAXException e) {
throw new ConfigurationException("xml parse error", e);
} finally {
try {
confStream.close();
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
}

public DefaultConfiguration buildFromFile(File file) throws ConfigurationException {
try {
DocumentBuilder builder = DefaultConfiguration.DBF.newDocumentBuilder();
Document document = builder.parse(file);
return new DefaultConfiguration(document.getDocumentElement());
} catch (DOMException e) {
throw new ConfigurationException("xml parse error", e);
} catch (ParserConfigurationException e) {
throw new ConfigurationException("xml parse error", e);
} catch (IOException e) {
throw new ConfigurationException("xml parse error", e);
} catch (SAXException e) {
throw new ConfigurationException("xml parse error", e);
}
}
}

+ 124
- 0
fop-core/src/main/java/org/apache/fop/configuration/NullConfiguration.java View File

@@ -0,0 +1,124 @@
/*
* 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.
*/

/* $Id: Accessibility.java 1343632 2012-05-29 09:48:03Z vhennebert $ */
package org.apache.fop.configuration;

final class NullConfiguration implements Configuration {

static final NullConfiguration INSTANCE = new NullConfiguration();

private NullConfiguration() {

}

@Override
public Configuration getChild(String key) {
return INSTANCE;
}

@Override
public Configuration getChild(String key, boolean required) {
return INSTANCE;
}

@Override
public Configuration[] getChildren(String key) {
return new Configuration[0];
}

@Override
public String[] getAttributeNames() {
return new String[0];
}

@Override
public String getAttribute(String key) throws ConfigurationException {
return "";
}

@Override
public String getAttribute(String key, String defaultValue) {
return defaultValue;
}

@Override
public boolean getAttributeAsBoolean(String key, boolean defaultValue) {
return defaultValue;
}

@Override
public float getAttributeAsFloat(String key) throws ConfigurationException {
return 0;
}

@Override
public float getAttributeAsFloat(String key, float defaultValue) {
return defaultValue;
}

@Override
public int getAttributeAsInteger(String key, int defaultValue) {
return defaultValue;
}

@Override
public String getValue() throws ConfigurationException {
// return null;
throw new ConfigurationException("missing value");
}

@Override
public String getValue(String defaultValue) {
return defaultValue;
}

@Override
public boolean getValueAsBoolean() throws ConfigurationException {
return false;
}

@Override
public boolean getValueAsBoolean(boolean defaultValue) {
return defaultValue;
}

@Override
public int getValueAsInteger() throws ConfigurationException {
return 0;
}

@Override
public int getValueAsInteger(int defaultValue) {
return defaultValue;
}

@Override
public float getValueAsFloat() throws ConfigurationException {
return 0;
}

@Override
public float getValueAsFloat(float defaultValue) {
return defaultValue;
}

@Override
public String getLocation() {
return "<no-location>";
}
}

+ 2
- 2
fop-core/src/main/java/org/apache/fop/fonts/DefaultFontConfig.java View File

@@ -23,12 +23,12 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.fop.apps.FOPException;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.events.EventProducer;
import org.apache.fop.util.LogUtil;


+ 2
- 3
fop-core/src/main/java/org/apache/fop/fonts/FontConfig.java View File

@@ -19,9 +19,8 @@

package org.apache.fop.fonts;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.fop.apps.FOPException;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.events.EventProducer;

/**
@@ -45,6 +44,6 @@ public interface FontConfig {
* @throws FOPException if an error occurs creating the font configuration object
*/
FontConfig parse(Configuration cfg, FontManager fontManager, boolean strict,
EventProducer eventProducer) throws FOPException;
EventProducer eventProducer) throws FOPException;
}
}

+ 2
- 2
fop-core/src/main/java/org/apache/fop/fonts/FontManagerConfigurator.java View File

@@ -24,8 +24,6 @@ import java.net.URISyntaxException;
import java.util.List;
import java.util.regex.Pattern;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@@ -34,6 +32,8 @@ import org.apache.xmlgraphics.io.ResourceResolver;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.apps.io.ResourceResolverFactory;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.fonts.substitute.FontSubstitutions;
import org.apache.fop.fonts.substitute.FontSubstitutionsConfigurator;
import org.apache.fop.util.LogUtil;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java View File

@@ -19,9 +19,8 @@

package org.apache.fop.fonts.substitute;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.fop.apps.FOPException;
import org.apache.fop.configuration.Configuration;

/**
* Configures a font substitution catalog

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/RendererConfig.java View File

@@ -19,10 +19,9 @@

package org.apache.fop.render;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.FontConfig;

/**

+ 2
- 0
fop-core/src/main/java/org/apache/fop/render/RendererConfigOption.java View File

@@ -26,4 +26,6 @@ package org.apache.fop.render;
public interface RendererConfigOption {
/** The name of the option. */
String getName();

Object getDefaultValue();
}

+ 2
- 2
fop-core/src/main/java/org/apache/fop/render/XMLHandlerConfigurator.java View File

@@ -19,13 +19,13 @@

package org.apache.fop.render;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;

/**
* Configurator for XMLHandler objects.

+ 3
- 3
fop-core/src/main/java/org/apache/fop/render/afp/AFPFontConfig.java View File

@@ -27,8 +27,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@@ -44,6 +42,8 @@ import org.apache.fop.afp.fonts.RasterFont;
import org.apache.fop.afp.util.AFPResourceAccessor;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.events.EventProducer;
import org.apache.fop.fonts.EmbedFontInfo;
import org.apache.fop.fonts.FontConfig;
@@ -85,7 +85,7 @@ public final class AFPFontConfig implements FontConfig {

/** {@inheritDoc}} */
public AFPFontConfig parse(Configuration cfg, FontManager fontManager, boolean strict,
EventProducer eventProducer) throws FOPException {
EventProducer eventProducer) throws FOPException {
try {
return new ParserHelper(cfg, fontManager, strict,
(AFPEventProducer) eventProducer).fontConfig;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/afp/AFPInfo.java View File

@@ -19,12 +19,11 @@

package org.apache.fop.render.afp;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.fop.afp.AFPGraphics2D;
import org.apache.fop.afp.AFPPaintingState;
import org.apache.fop.afp.AFPResourceInfo;
import org.apache.fop.afp.AFPResourceManager;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.FontInfo;

/**

+ 2
- 2
fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererConfig.java View File

@@ -23,8 +23,6 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.util.EnumMap;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@@ -38,6 +36,8 @@ import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.fonts.FontManager;
import org.apache.fop.render.RendererConfig;
import org.apache.fop.render.afp.AFPFontConfig.AFPFontInfoConfigParser;

+ 2
- 3
fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererContext.java View File

@@ -21,12 +21,11 @@ package org.apache.fop.render.afp;

import java.util.Map;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.fop.afp.AFPPaintingState;
import org.apache.fop.afp.AFPResourceInfo;
import org.apache.fop.afp.AFPResourceManager;
import org.apache.fop.afp.modca.ResourceObject;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.render.AbstractRenderer;
import org.apache.fop.render.ImageHandlerUtil;
import org.apache.fop.render.RendererContext;
@@ -58,7 +57,7 @@ public class AFPRendererContext extends RendererContext {
info.setHeight((Integer) getProperty(RendererContextConstants.HEIGHT));
info.setX((Integer) getProperty(RendererContextConstants.XPOS));
info.setY((Integer) getProperty(RendererContextConstants.YPOS));
info.setHandlerConfiguration((Configuration)getProperty(
info.setHandlerConfiguration((Configuration) getProperty(
RendererContextConstants.HANDLER_CONFIGURATION));
info.setFontInfo((org.apache.fop.fonts.FontInfo)getProperty(
AFPRendererContextConstants.AFP_FONT_INFO));

+ 5
- 0
fop-core/src/main/java/org/apache/fop/render/afp/AFPRendererOption.java View File

@@ -61,4 +61,9 @@ public enum AFPRendererOption implements RendererConfigOption {
public Class<?> getType() {
return type;
}

@Override
public Object getDefaultValue() {
return null;
}
}

+ 1
- 1
fop-core/src/main/java/org/apache/fop/render/afp/AFPShadingMode.java View File

@@ -49,7 +49,7 @@ public enum AFPShadingMode {
* @return the enumeration object
*/
public static AFPShadingMode getValueOf(String name) {
if (COLOR.getName().equalsIgnoreCase(name)) {
if (name == null || "".equals(name) || COLOR.getName().equalsIgnoreCase(name)) {
return COLOR;
} else if (DITHERED.getName().equalsIgnoreCase(name)) {
return DITHERED;

+ 13
- 3
fop-core/src/main/java/org/apache/fop/render/bitmap/BitmapRendererConfig.java View File

@@ -23,10 +23,9 @@ import java.awt.Color;
import java.awt.image.BufferedImage;
import java.util.EnumMap;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.DefaultFontConfig;
import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
import org.apache.fop.fonts.FontEventAdapter;
@@ -170,7 +169,18 @@ public class BitmapRendererConfig implements RendererConfig {
}

private String getValue(Configuration cfg, BitmapRendererOption option) {
return cfg.getChild(option.getName()).getValue(null);
Object defaultValue = option.getDefaultValue();
Object result = cfg.getChild(option.getName()).getValue(null);
if (result == null || "".equals(result)) {
result = defaultValue;
}
if (result == null) {
return null;
}
if (result instanceof Color) {
return ColorUtil.colorToString((Color) result);
}
return result.toString();
}

public String getMimeType() {

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/bitmap/PNGRendererConfig.java View File

@@ -17,12 +17,11 @@

package org.apache.fop.render.bitmap;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.xmlgraphics.util.MimeConstants;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.DefaultFontConfig;
import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
import org.apache.fop.fonts.FontEventAdapter;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/bitmap/TIFFRendererConfig.java View File

@@ -21,13 +21,12 @@ package org.apache.fop.render.bitmap;

import java.util.EnumMap;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.xmlgraphics.image.writer.Endianness;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.DefaultFontConfig;
import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
import org.apache.fop.fonts.FontEventAdapter;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/intermediate/IFRendererConfig.java View File

@@ -19,10 +19,9 @@

package org.apache.fop.render.intermediate;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.DefaultFontConfig;
import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
import org.apache.fop.fonts.FontConfig;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/java2d/Java2DRendererConfig.java View File

@@ -21,10 +21,9 @@ package org.apache.fop.render.java2d;

import java.util.EnumMap;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.DefaultFontConfig;
import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
import org.apache.fop.fonts.FontEventAdapter;

+ 5
- 0
fop-core/src/main/java/org/apache/fop/render/java2d/Java2DRendererOption.java View File

@@ -34,4 +34,9 @@ public enum Java2DRendererOption implements RendererConfigOption {
public String getName() {
return name;
}

@Override
public Object getDefaultValue() {
return null;
}
}

+ 17
- 6
fop-core/src/main/java/org/apache/fop/render/pcl/Java2DRendererOption.java View File

@@ -25,19 +25,25 @@ import org.apache.fop.render.RendererConfigOption;
*/
public enum Java2DRendererOption implements RendererConfigOption {

RENDERING_MODE("rendering", PCLRenderingMode.class),
TEXT_RENDERING("text-rendering", Boolean.class),
DISABLE_PJL("disable-pjl", Boolean.class),
OPTIMIZE_RESOURCES("optimize-resources", Boolean.class),
MODE_COLOR("color", Boolean.class);
RENDERING_MODE("rendering", PCLRenderingMode.class, PCLRenderingMode.QUALITY),
TEXT_RENDERING("text-rendering", Boolean.class, Boolean.FALSE),
DISABLE_PJL("disable-pjl", Boolean.class, Boolean.FALSE),
OPTIMIZE_RESOURCES("optimize-resources", Boolean.class, Boolean.FALSE),
MODE_COLOR("color", Boolean.class, Boolean.FALSE);

private final String name;

private final Class<?> type;

private Java2DRendererOption(String name, Class<?> type) {
private final Object defaultValue;

private Java2DRendererOption(String name, Class<?> type, Object defaultValue) {
this.name = name;
this.type = type;
this.defaultValue = defaultValue;
if (defaultValue != null && !(type.isAssignableFrom(defaultValue.getClass()))) {
throw new IllegalArgumentException("default value " + defaultValue + " is not of type " + type);
}
}

/** {@inheritDoc} */
@@ -48,4 +54,9 @@ public enum Java2DRendererOption implements RendererConfigOption {
Class<?> getType() {
return type;
}

@Override
public Object getDefaultValue() {
return defaultValue;
}
}

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/pcl/PCLRendererConfig.java View File

@@ -22,11 +22,10 @@ package org.apache.fop.render.pcl;
import java.util.EnumMap;
import java.util.Map;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.DefaultFontConfig;
import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
import org.apache.fop.fonts.FontEventAdapter;

+ 8
- 4
fop-core/src/main/java/org/apache/fop/render/pdf/PDFRendererConfig.java View File

@@ -25,15 +25,14 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.fonts.DefaultFontConfig;
import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
import org.apache.fop.fonts.FontEventAdapter;
@@ -217,7 +216,12 @@ public final class PDFRendererConfig implements RendererConfig {

private String parseConfig(Configuration cfg, RendererConfigOption option) {
Configuration child = cfg.getChild(option.getName());
return child.getValue(null);
String value = child.getValue(null);
if (value == null || "".equals(value)) {
Object v = option.getDefaultValue();
return v == null ? null : v.toString();
}
return value;
}

private boolean doesValueExist(Configuration cfg, RendererConfigOption option) {

+ 1
- 1
fop-core/src/main/java/org/apache/fop/render/pdf/PDFSVGHandler.java View File

@@ -22,10 +22,10 @@ package org.apache.fop.render.pdf;
import java.io.OutputStream;
import java.util.Map;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.pdf.PDFDocument;
import org.apache.fop.pdf.PDFPage;

+ 2
- 2
fop-core/src/main/java/org/apache/fop/render/ps/PSRendererConfig.java View File

@@ -22,14 +22,14 @@ package org.apache.fop.render.ps;
import java.util.EnumMap;
import java.util.Locale;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.fonts.DefaultFontConfig;
import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
import org.apache.fop.fonts.FontEventAdapter;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/ps/PSSVGHandler.java View File

@@ -26,8 +26,6 @@ import java.util.Map;

import org.w3c.dom.Document;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.GVTBuilder;
import org.apache.batik.gvt.GraphicsNode;
@@ -35,6 +33,7 @@ import org.apache.batik.gvt.GraphicsNode;
import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
import org.apache.xmlgraphics.ps.PSGenerator;

import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.image.loader.batik.BatikUtil;
import org.apache.fop.render.AbstractGenericSVGHandler;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/render/txt/TxtRendererConfig.java View File

@@ -21,11 +21,10 @@ package org.apache.fop.render.txt;

import java.util.EnumMap;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.DefaultFontConfig;
import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
import org.apache.fop.fonts.FontEventAdapter;

+ 4
- 4
fop-core/src/main/java/org/apache/fop/svg/AbstractFOPTranscoder.java View File

@@ -28,10 +28,6 @@ import javax.xml.transform.stream.StreamSource;
import org.w3c.dom.DOMImplementation;
import org.xml.sax.EntityResolver;

import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.configuration.DefaultConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.impl.SimpleLog;

@@ -55,6 +51,10 @@ import org.apache.xmlgraphics.image.loader.ImageSessionContext;
import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext;
import org.apache.xmlgraphics.util.UnitConv;

import org.apache.fop.configuration.Configurable;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.configuration.DefaultConfiguration;
import org.apache.fop.svg.font.FOPFontFamilyResolver;

/**

+ 2
- 3
fop-core/src/main/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java View File

@@ -23,12 +23,11 @@ import java.io.File;
import java.net.URI;
import java.util.List;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.apps.io.ResourceResolverFactory;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.fonts.DefaultFontConfig;
import org.apache.fop.fonts.DefaultFontConfigurator;
import org.apache.fop.fonts.EmbedFontInfo;

+ 1
- 2
fop-core/src/main/java/org/apache/fop/svg/PDFTranscoder.java View File

@@ -27,8 +27,6 @@ import java.io.OutputStream;
import org.w3c.dom.Document;
import org.w3c.dom.svg.SVGLength;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.UnitProcessor;
import org.apache.batik.ext.awt.RenderingHintsKeyExt;
@@ -37,6 +35,7 @@ import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.image.ImageTranscoder;

import org.apache.fop.Version;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.svg.font.FOPFontFamilyResolverImpl;


+ 2
- 3
fop-core/src/test/java/org/apache/fop/apps/AbstractRendererConfigParserTester.java View File

@@ -22,10 +22,9 @@ package org.apache.fop.apps;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;

import org.apache.fop.apps.FopConfBuilder.RendererConfBuilder;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.DefaultConfigurationBuilder;
import org.apache.fop.events.DefaultEventBroadcaster;
import org.apache.fop.fonts.FontManager;
import org.apache.fop.render.RendererConfig;

+ 1
- 2
fop-core/src/test/java/org/apache/fop/apps/AbstractRendererConfiguratorTest.java View File

@@ -27,9 +27,8 @@ import org.xml.sax.SAXException;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import org.apache.avalon.framework.configuration.ConfigurationException;

import org.apache.fop.apps.FopConfBuilder.RendererConfBuilder;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.render.PrintRendererConfigurator;
import org.apache.fop.render.intermediate.IFDocumentHandler;


+ 1
- 2
fop-core/src/test/java/org/apache/fop/apps/MutableConfig.java View File

@@ -21,13 +21,12 @@ import java.net.URI;
import java.util.Map;
import java.util.Set;

import org.apache.avalon.framework.configuration.Configuration;

import org.apache.xmlgraphics.image.loader.ImageManager;
import org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.FallbackResolver;
import org.apache.xmlgraphics.io.ResourceResolver;

import org.apache.fop.apps.io.InternalResourceResolver;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.fonts.FontManager;
import org.apache.fop.layoutmgr.LayoutManagerMaker;


+ 1
- 1
fop-core/src/test/java/org/apache/fop/config/BaseUserConfigTest.java View File

@@ -25,11 +25,11 @@ import java.io.InputStream;

import org.xml.sax.SAXException;

import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.configuration.DefaultConfigurationBuilder;
import org.apache.fop.render.pdf.BasePDFTest;

import static org.apache.fop.FOPTestUtils.getBaseDir;

+ 4
- 4
fop-core/src/test/java/org/apache/fop/threading/AvalonAdapter.java View File

@@ -19,7 +19,7 @@

package org.apache.fop.threading;

import org.apache.avalon.framework.logger.Logger;
import org.apache.commons.logging.Log;

import org.apache.fop.events.Event;
import org.apache.fop.events.EventFormatter;
@@ -31,10 +31,10 @@ import org.apache.fop.events.model.EventSeverity;
*/
class AvalonAdapter implements EventListener {

private final Logger logger;
private final Log logger;
private String filename;

public AvalonAdapter(Logger logger, String filename) {
public AvalonAdapter(Log logger, String filename) {
this.logger = logger;
this.filename = filename;
}
@@ -49,7 +49,7 @@ class AvalonAdapter implements EventListener {
} else if (severity == EventSeverity.ERROR) {
logger.error(filename + ": " + msg);
} else if (severity == EventSeverity.FATAL) {
logger.fatalError(filename + ": " + msg);
logger.fatal(filename + ": " + msg);
} else {
assert false;
}

+ 20
- 18
fop-core/src/test/java/org/apache/fop/threading/FOPTestbed.java View File

@@ -31,25 +31,27 @@ import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;

import org.apache.avalon.framework.CascadingRuntimeException;
import org.apache.avalon.framework.activity.Executable;
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.container.ContainerUtil;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.CountingOutputStream;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.fop.activity.ContainerUtil;
import org.apache.fop.activity.Initializable;
import org.apache.fop.configuration.Configurable;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;

/**
* Testbed for multi-threading tests. The class can run a configurable set of task a number of
* times in a configurable number of threads to easily reproduce multi-threading issues.
*/
public class FOPTestbed extends AbstractLogEnabled
public class FOPTestbed
implements Configurable, Initializable {

private static final Log LOG = LogFactory.getLog(FOPTestbed.class);

private int repeat;
private List taskList = new java.util.ArrayList();
private int threads;
@@ -85,7 +87,7 @@ public class FOPTestbed extends AbstractLogEnabled
* Starts the stress test.
*/
public void doStressTest() {
getLogger().info("Starting stress test...");
LOG.info("Starting stress test...");
long start = System.currentTimeMillis();
this.counter = 0;

@@ -94,7 +96,7 @@ public class FOPTestbed extends AbstractLogEnabled
List threadList = new java.util.LinkedList();
for (int ti = 0; ti < this.threads; ti++) {
TaskRunner runner = new TaskRunner();
ContainerUtil.enableLogging(runner, getLogger());
// ContainerUtil.enableLogging(runner, logger);
Thread thread = new Thread(workerGroup, runner, "Worker- " + ti);
threadList.add(thread);
}
@@ -150,7 +152,7 @@ public class FOPTestbed extends AbstractLogEnabled
}
}

private class TaskRunner extends AbstractLogEnabled implements Runnable {
private class TaskRunner implements Runnable {

public void run() {
try {
@@ -158,12 +160,12 @@ public class FOPTestbed extends AbstractLogEnabled
for (Object aTaskList : taskList) {
TaskDef def = (TaskDef) aTaskList;
final Task task = new Task(def, counter++, foprocessor);
ContainerUtil.enableLogging(task, getLogger());
// ContainerUtil.enableLogging(task, logger);
task.execute();
}
}
} catch (Exception e) {
getLogger().error("Thread ended with an exception", e);
LOG.error("Thread ended with an exception", e);
}
}

@@ -178,12 +180,12 @@ public class FOPTestbed extends AbstractLogEnabled
Class clazz = Class.forName(this.fopCfg.getAttribute("class",
"org.apache.fop.threading.FOProcessorImpl"));
Processor fop = (Processor)clazz.getDeclaredConstructor().newInstance();
ContainerUtil.enableLogging(fop, getLogger());
// ContainerUtil.enableLogging(fop, logger);
ContainerUtil.configure(fop, this.fopCfg);
ContainerUtil.initialize(fop);
return fop;
} catch (Exception e) {
throw new CascadingRuntimeException("Error creating FO Processor", e);
throw new RuntimeException("Error creating FO Processor", e);
}
}

@@ -243,7 +245,7 @@ public class FOPTestbed extends AbstractLogEnabled
}


private class Task extends AbstractLogEnabled implements Executable {
private class Task {

private TaskDef def;
private int num;
@@ -257,7 +259,7 @@ public class FOPTestbed extends AbstractLogEnabled


public void execute() throws Exception {
getLogger().info("Processing: " + def);
LOG.info("Processing: " + def);
long start = System.currentTimeMillis();
try {
DecimalFormat df = new DecimalFormat("00000");

+ 12
- 8
fop-core/src/test/java/org/apache/fop/threading/FOProcessorImpl.java View File

@@ -36,25 +36,29 @@ import javax.xml.transform.sax.SAXResult;

import org.xml.sax.SAXException;

import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.commons.io.FilenameUtils;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.fop.activity.Initializable;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.configuration.Configurable;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;

/**
* Default implementation of the {@link Processor} interface using FOP.
*/
public class FOProcessorImpl extends AbstractLogEnabled
public class FOProcessorImpl
implements Processor, Configurable, Initializable {

private static final Log LOG = LogFactory.getLog(FOProcessorImpl.class);

private FopFactory fopFactory;
private TransformerFactory factory = TransformerFactory.newInstance();
private URI userconfig;
@@ -74,7 +78,7 @@ public class FOProcessorImpl extends AbstractLogEnabled

public void initialize() throws Exception {
if (this.userconfig != null) {
getLogger().debug("Setting user config: " + userconfig);
LOG.debug("Setting user config: " + userconfig);
fopFactory = FopFactory.newInstance(new File(userconfig));
} else {
fopFactory = FopFactory.newInstance(new File(".").toURI());
@@ -92,7 +96,7 @@ public class FOProcessorImpl extends AbstractLogEnabled
URL url = new URL(src.getSystemId());
String filename = FilenameUtils.getName(url.getPath());
foUserAgent.getEventBroadcaster().addEventListener(
new AvalonAdapter(getLogger(), filename));
new AvalonAdapter(LOG, filename));
} catch (MalformedURLException mfue) {
throw new RuntimeException(mfue);
}

+ 13
- 8
fop-core/src/test/java/org/apache/fop/threading/IFProcessorImpl.java View File

@@ -35,17 +35,19 @@ import javax.xml.transform.stream.StreamResult;

import org.xml.sax.ContentHandler;

import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.commons.io.FilenameUtils;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.apache.fop.activity.Initializable;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.configuration.Configurable;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.render.intermediate.IFDocumentHandler;
import org.apache.fop.render.intermediate.IFException;
import org.apache.fop.render.intermediate.IFParser;
@@ -54,9 +56,12 @@ import org.apache.fop.render.intermediate.IFUtil;
/**
* Implementation of the {@link Processor} interface that renders IF XML to a final output format.
*/
public class IFProcessorImpl extends AbstractLogEnabled
public class IFProcessorImpl
implements Processor, Configurable, Initializable {

private static final Log LOGGER = LogFactory.getLog(IFProcessorImpl.class);


private FopFactory fopFactory;
private TransformerFactory factory = TransformerFactory.newInstance();
private String userconfig;
@@ -73,7 +78,7 @@ public class IFProcessorImpl extends AbstractLogEnabled
/** {@inheritDoc} */
public void initialize() throws Exception {
if (this.userconfig != null) {
getLogger().debug("Setting user config: " + userconfig);
LOGGER.debug("Setting user config: " + userconfig);
fopFactory = FopFactory.newInstance(new File(this.userconfig));
} else {
fopFactory = FopFactory.newInstance(new File(".").toURI());
@@ -89,7 +94,7 @@ public class IFProcessorImpl extends AbstractLogEnabled
URL url = new URL(src.getSystemId());
String filename = FilenameUtils.getName(url.getPath());
foUserAgent.getEventBroadcaster().addEventListener(
new AvalonAdapter(getLogger(), filename));
new AvalonAdapter(LOGGER, filename));
} catch (MalformedURLException mfue) {
throw new RuntimeException(mfue);
}

+ 6
- 7
fop-core/src/test/java/org/apache/fop/threading/Main.java View File

@@ -23,11 +23,9 @@ import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;

import org.apache.avalon.framework.ExceptionUtil;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.avalon.framework.container.ContainerUtil;
import org.apache.avalon.framework.logger.ConsoleLogger;
import org.apache.fop.activity.ContainerUtil;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.DefaultConfigurationBuilder;

/**
* Starter class for the multi-threading testbed.
@@ -61,7 +59,7 @@ public final class Main {

//Setup testbed
FOPTestbed testbed = new FOPTestbed();
ContainerUtil.enableLogging(testbed, new ConsoleLogger(ConsoleLogger.LEVEL_INFO));
// ContainerUtil.enableLogging(testbed, new ConsoleLogger(ConsoleLogger.LEVEL_INFO));
ContainerUtil.configure(testbed, cfg);
ContainerUtil.initialize(testbed);

@@ -70,7 +68,8 @@ public final class Main {

System.exit(0);
} catch (Exception e) {
System.err.println(ExceptionUtil.printStackTrace(e));
// System.err.println(ExceptionUtil.printStackTrace(e));
e.printStackTrace(System.err);
System.exit(-1);
}
}

+ 4
- 1
fop-core/src/test/java/org/apache/fop/threading/Processor.java View File

@@ -24,10 +24,13 @@ import java.io.OutputStream;
import javax.xml.transform.Source;
import javax.xml.transform.Templates;

import org.apache.fop.activity.Initializable;
import org.apache.fop.configuration.Configurable;

/**
* Represents a processor.
*/
public interface Processor {
public interface Processor extends Configurable, Initializable {

/**
* Process a file.

+ 3
- 3
fop-core/src/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java View File

@@ -32,14 +32,14 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;

import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.commons.io.IOUtils;

import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.configuration.Configurable;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.util.DefaultErrorListener;

/**

+ 4
- 4
fop-core/src/test/java/org/apache/fop/visual/BatchDiffer.java View File

@@ -30,10 +30,6 @@ import javax.xml.transform.stream.StreamSource;

import org.xml.sax.SAXException;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
import org.apache.avalon.framework.container.ContainerUtil;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.AndFileFilter;
import org.apache.commons.io.filefilter.IOFileFilter;
@@ -44,6 +40,10 @@ import org.apache.commons.logging.LogFactory;

import org.apache.xmlgraphics.image.writer.ImageWriterUtil;

import org.apache.fop.activity.ContainerUtil;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.configuration.DefaultConfigurationBuilder;
import org.apache.fop.layoutengine.LayoutEngineTestUtils;

/**

+ 3
- 1
fop-core/src/test/java/org/apache/fop/visual/BitmapProducer.java View File

@@ -22,10 +22,12 @@ package org.apache.fop.visual;
import java.awt.image.BufferedImage;
import java.io.File;

import org.apache.fop.configuration.Configurable;

/**
* Interface for a converter.
*/
public interface BitmapProducer {
public interface BitmapProducer extends Configurable {

/**
* Produces a BufferedImage from the source file by invoking the FO processor and

+ 3
- 3
fop-core/src/test/java/org/apache/fop/visual/BitmapProducerJava2D.java View File

@@ -30,15 +30,15 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;

import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.commons.io.IOUtils;

import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.configuration.Configurable;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;
import org.apache.fop.util.DefaultErrorListener;

/**

+ 3
- 4
fop-core/src/test/java/org/apache/fop/visual/ReferenceBitmapLoader.java View File

@@ -23,9 +23,9 @@ import java.awt.image.BufferedImage;
import java.io.File;
import java.net.URI;

import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.fop.configuration.Configurable;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.ConfigurationException;

/**
* BitmapProducer implementation that simply loads preproduced reference bitmaps from a
@@ -47,7 +47,6 @@ public class ReferenceBitmapLoader extends AbstractBitmapProducer implements Con
super(baseUri);
}

/** @see org.apache.avalon.framework.configuration.Configurable */
public void configure(Configuration cfg) throws ConfigurationException {
this.bitmapDirectory = new File(cfg.getChild("directory").getValue(null));
if (!bitmapDirectory.exists()) {

+ 0
- 12
fop-servlet/pom.xml View File

@@ -44,16 +44,6 @@
<artifactId>commons-logging</artifactId>
<version>${commons.logging.version}</version>
</dependency>
<dependency>
<groupId>org.apache.avalon.framework</groupId>
<artifactId>avalon-framework-api</artifactId>
<version>${avalon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.avalon.framework</groupId>
<artifactId>avalon-framework-impl</artifactId>
<version>${avalon.version}</version>
</dependency>
</dependencies>

<build>
@@ -63,8 +53,6 @@
<version>${war.plugin.version}</version>
<configuration>
<packagingIncludes>
WEB-INF/lib/avalon-framework-api-${avalon.version}.jar,
WEB-INF/lib/avalon-framework-impl-${avalon.version}.jar,
WEB-INF/lib/batik-all-*.jar,
WEB-INF/lib/commons-io-${commons.io.version}.jar,
WEB-INF/lib/commons-logging-${commons.logging.version}.jar,

+ 0
- 11
fop-transcoder-allinone/pom.xml View File

@@ -41,17 +41,6 @@
<artifactId>commons-logging</artifactId>
<version>${commons.logging.version}</version>
</dependency>
<dependency>
<groupId>org.apache.avalon.framework</groupId>
<artifactId>avalon-framework-api</artifactId>
<version>${avalon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.avalon.framework</groupId>
<artifactId>avalon-framework-impl</artifactId>
<version>${avalon.version}</version>
</dependency>
<!-- test deps -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

+ 0
- 4
fop-transcoder-allinone/src/tools/resources/assembly/assembly.xml View File

@@ -22,10 +22,6 @@
<unpack>true</unpack>
<unpackOptions>
<includes>
<include>org/apache/avalon/framework/*</include>
<include>org/apache/avalon/framework/activity/*</include>
<include>org/apache/avalon/framework/configuration/*</include>
<include>org/apache/avalon/framework/container/*</include>
<include>org/apache/commons/io/*.class</include>
<include>org/apache/commons/io/filefilter/*.class</include>
<include>org/apache/commons/io/output/*.class</include>

+ 1
- 8
fop/build.xml View File

@@ -73,7 +73,6 @@ list of possible build targets.
<fileset dir="${basedir}/.." id="dist.bin.lib">
<patternset id="dist.lib">
<include name="fop/lib/README*"/>
<include name="fop/lib/avalon-framework*"/>
<include name="fop/lib/batik*"/>
<include name="fop/lib/commons-io*"/>
<include name="fop/lib/commons-logging*"/>
@@ -597,7 +596,6 @@ list of possible build targets.
<echo message="Creating the WAR file"/>
<war warfile="${build.dir}/fop.war" webxml="${servlet.src.dir}/main/webapp/WEB-INF/web.xml">
<lib dir="${lib.dir}">
<include name="avalon-framework*.jar"/>
<include name="commons-logging*.jar"/>
<include name="batik*.jar"/>
<include name="commons-io*.jar"/>
@@ -642,6 +640,7 @@ list of possible build targets.
<include name="org/apache/fop/util/DecimalFormatCache*.class"/>
<include name="org/apache/fop/util/ImageObject.class"/>
<include name="org/apache/fop/util/HexEncoder.class"/>
<include name="org/apache/fop/configuration/**"/>
</patternset>
<!-- PDF transcoder -->
<patternset>
@@ -665,7 +664,6 @@ list of possible build targets.
</fileset>
<fileset dir="${lib.dir}" id="transcoder-lib-files">
<include name="commons-io*.jar"/>
<include name="avalon-framework*.jar"/>
<include name="commons-logging*.jar"/>
<include name="xmlgraphics-commons*.jar"/>
</fileset>
@@ -698,10 +696,6 @@ list of possible build targets.
<mkdir dir="${transcoder-deps}"/>
<unjar dest="${transcoder-deps}">
<patternset>
<include name="org/apache/avalon/framework/*"/>
<include name="org/apache/avalon/framework/activity/*"/>
<include name="org/apache/avalon/framework/configuration/*"/>
<include name="org/apache/avalon/framework/container/*"/>
<include name="org/apache/commons/logging/**"/>
<include name="org/apache/commons/io/*.class"/>
<include name="org/apache/commons/io/filefilter/*.class"/>
@@ -712,7 +706,6 @@ list of possible build targets.
<mkdir dir="${transcoder-deps}/legal"/>
<copy todir="${transcoder-deps}/legal">
<fileset dir="${lib.dir}">
<include name="avalon.LICENSE.txt"/>
<include name="commons-io.LICENSE.txt"/>
<include name="commons-logging.LICENSE.txt"/>
</fileset>

+ 0
- 1
fop/examples/embedding/build.xml View File

@@ -33,7 +33,6 @@
<!-- stuff -->
<path id="project.class.path">
<fileset dir="${fop.lib.dir}">
<include name="avalon-framework*.jar"/>
<include name="batik*.jar"/>
<include name="xml-apis*.jar"/>
<include name="xerces*.jar"/>

+ 1
- 3
fop/examples/embedding/java/embedding/ExampleAWTViewer.java View File

@@ -31,8 +31,6 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;

import org.apache.avalon.framework.ExceptionUtil;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
@@ -103,7 +101,7 @@ public class ExampleAWTViewer {

System.out.println("Success!");
} catch (Exception e) {
System.err.println(ExceptionUtil.printStackTrace(e));
// System.err.println(ExceptionUtil.printStackTrace(e));
System.exit(-1);
}
}

+ 4
- 4
fop/examples/embedding/java/embedding/ExampleEPS.java View File

@@ -21,12 +21,12 @@
package embedding;

import java.awt.Font;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;

import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;

import org.apache.fop.configuration.Configuration;
import org.apache.fop.configuration.DefaultConfigurationBuilder;
import org.apache.xmlgraphics.java2d.GraphicContext;
import org.apache.xmlgraphics.java2d.ps.EPSDocumentGraphics2D;

@@ -43,7 +43,7 @@ public class ExampleEPS {
try {
String configFile = "examples/fop-eps.xconf";
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
Configuration c = cfgBuilder.buildFromFile(configFile);
Configuration c = cfgBuilder.buildFromFile(new File(configFile));

FontInfo fontInfo = PDFDocumentGraphics2DConfigurator.createFontInfo(c, false);


+ 3
- 3
fop/examples/embedding/java/embedding/ExampleJava2D2PDF.java