From a5a17890ada3d6f569131f82466fa3791330349a Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Fri, 9 Apr 2010 16:34:29 +0000 Subject: [PATCH] Moved ResourceEventProducer to org.apache.fop Renamed event model used by FOPTestEventModelFactory to "event-model.xml" git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@932497 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 9 +++--- .../java/embedding/events/ExampleEvents.java | 2 +- .../content/xdocs/trunk/events.xml | 4 +-- ....apache.fop.events.model.EventModelFactory | 2 +- .../{events => }/ResourceEventProducer.java | 4 ++- .../org/apache/fop/ResourceEventProducer.xml | 32 +++++++++++++++++++ .../org/apache/fop/area/AreaTreeParser.java | 2 +- .../fop/area/CachedRenderPagesModel.java | 2 +- src/java/org/apache/fop/cli/InputHandler.java | 2 +- .../fop/events/ResourceEventProducer.xml | 32 ------------------- .../apache/fop/fo/flow/ExternalGraphic.java | 2 +- .../fop/fo/flow/InstreamForeignObject.java | 2 +- .../CommonBorderPaddingBackground.java | 2 +- .../ExternalDocumentLayoutManager.java | 2 +- .../apache/fop/render/AbstractRenderer.java | 2 +- .../apache/fop/render/afp/AFPRenderer.java | 2 +- .../intermediate/AbstractIFPainter.java | 2 +- .../fop/render/java2d/Java2DRenderer.java | 2 +- .../apache/fop/render/pcl/PCLRenderer.java | 2 +- .../apache/fop/render/pdf/PDFRenderer.java | 2 +- .../org/apache/fop/render/ps/PSRenderer.java | 2 +- .../apache/fop/render/ps/ResourceHandler.java | 2 +- .../org/apache/fop/render/rtf/RTFHandler.java | 2 +- .../org/apache/fop/render/svg/SVGPainter.java | 2 +- .../fop/events/EventProcessingTestCase.java | 1 + .../fop/events/FOPTestEventModelFactory.java | 2 +- 26 files changed, 63 insertions(+), 59 deletions(-) rename src/java/org/apache/fop/{events => }/ResourceEventProducer.java (97%) create mode 100644 src/java/org/apache/fop/ResourceEventProducer.xml delete mode 100644 src/java/org/apache/fop/events/ResourceEventProducer.xml diff --git a/build.xml b/build.xml index df76aaa90..f85bceecd 100644 --- a/build.xml +++ b/build.xml @@ -366,10 +366,10 @@ list of possible build targets. - + - + - + diff --git a/examples/embedding/java/embedding/events/ExampleEvents.java b/examples/embedding/java/embedding/events/ExampleEvents.java index 4f0b5c0c2..5d690f18a 100644 --- a/examples/embedding/java/embedding/events/ExampleEvents.java +++ b/examples/embedding/java/embedding/events/ExampleEvents.java @@ -112,7 +112,7 @@ public class ExampleEvents { private static class MyEventListener implements EventListener { public void processEvent(Event event) { - if ("org.apache.fop.events.ResourceEventProducer.imageNotFound" + if ("org.apache.fop.ResourceEventProducer.imageNotFound" .equals(event.getEventID())) { //Get the FileNotFoundException that's part of the event's parameters diff --git a/src/documentation/content/xdocs/trunk/events.xml b/src/documentation/content/xdocs/trunk/events.xml index dc08b0099..017775f03 100644 --- a/src/documentation/content/xdocs/trunk/events.xml +++ b/src/documentation/content/xdocs/trunk/events.xml @@ -157,7 +157,7 @@ foUserAgent.getEventBroadcaster().addEventListener(new SysOutEventListener());]] + + + + [ (See position {loc})| (See {#gatherContextInfo})| (No context info available)] + Image not found.[ URI: {uri}.]{{locator}} + Image not available.[ URI: {uri}.] Reason:[ {reason}][ {e}]{{locator}} + I/O error while loading image.[ URI: {uri}.][ Reason: {ioe}]{{locator}} + The intrinsic dimensions of an instream-foreign-object could not be determined.{{locator}} + Error while handling URI: {uri}. Reason: {e}{{locator}} + Some XML content will be ignored. Could not render XML in namespace "{namespaceURI}".[ Reason: {e}] + Some XML content will be ignored. No handler defined for XML with namespace "{namespaceURI}". + Error while writing an image to the target file.[ Reason: {e}] + Temporary file could not be deleted: {tempFile} + Catalog resolver not found along the classpath + Error creating the catalog resolver: {message} + diff --git a/src/java/org/apache/fop/area/AreaTreeParser.java b/src/java/org/apache/fop/area/AreaTreeParser.java index ffffda7f4..e41f5e873 100644 --- a/src/java/org/apache/fop/area/AreaTreeParser.java +++ b/src/java/org/apache/fop/area/AreaTreeParser.java @@ -57,6 +57,7 @@ import org.apache.xmlgraphics.image.loader.ImageManager; import org.apache.xmlgraphics.image.loader.ImageSessionContext; import org.apache.xmlgraphics.util.QName; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.accessibility.AccessibilityEventProducer; import org.apache.fop.accessibility.StructureTreeBuilder; import org.apache.fop.apps.FOUserAgent; @@ -74,7 +75,6 @@ import org.apache.fop.area.inline.SpaceArea; import org.apache.fop.area.inline.TextArea; import org.apache.fop.area.inline.Viewport; import org.apache.fop.area.inline.WordArea; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.Constants; import org.apache.fop.fo.ElementMappingRegistry; import org.apache.fop.fo.expr.PropertyException; diff --git a/src/java/org/apache/fop/area/CachedRenderPagesModel.java b/src/java/org/apache/fop/area/CachedRenderPagesModel.java index 73c50fa17..729ca0c65 100644 --- a/src/java/org/apache/fop/area/CachedRenderPagesModel.java +++ b/src/java/org/apache/fop/area/CachedRenderPagesModel.java @@ -36,9 +36,9 @@ import org.xml.sax.SAXException; import org.apache.commons.io.IOUtils; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fonts.FontInfo; /** diff --git a/src/java/org/apache/fop/cli/InputHandler.java b/src/java/org/apache/fop/cli/InputHandler.java index 363cd0767..e7109fcfa 100644 --- a/src/java/org/apache/fop/cli/InputHandler.java +++ b/src/java/org/apache/fop/cli/InputHandler.java @@ -47,11 +47,11 @@ import org.xml.sax.XMLReader; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.fop.ResourceEventProducer; 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.events.ResourceEventProducer; import org.apache.fop.render.awt.viewer.Renderable; /** diff --git a/src/java/org/apache/fop/events/ResourceEventProducer.xml b/src/java/org/apache/fop/events/ResourceEventProducer.xml deleted file mode 100644 index bc8810099..000000000 --- a/src/java/org/apache/fop/events/ResourceEventProducer.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - [ (See position {loc})| (See {#gatherContextInfo})| (No context info available)] - Image not found.[ URI: {uri}.]{{locator}} - Image not available.[ URI: {uri}.] Reason:[ {reason}][ {e}]{{locator}} - I/O error while loading image.[ URI: {uri}.][ Reason: {ioe}]{{locator}} - The intrinsic dimensions of an instream-foreign-object could not be determined.{{locator}} - Error while handling URI: {uri}. Reason: {e}{{locator}} - Some XML content will be ignored. Could not render XML in namespace "{namespaceURI}".[ Reason: {e}] - Some XML content will be ignored. No handler defined for XML with namespace "{namespaceURI}". - Error while writing an image to the target file.[ Reason: {e}] - Temporary file could not be deleted: {tempFile} - Catalog resolver not found along the classpath - Error creating the catalog resolver: {message} - diff --git a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java index fa952000d..0dd8ed9f8 100644 --- a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java +++ b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java @@ -28,11 +28,11 @@ import org.apache.xmlgraphics.image.loader.ImageException; import org.apache.xmlgraphics.image.loader.ImageInfo; import org.apache.xmlgraphics.image.loader.ImageManager; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.URISpecification; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.FONode; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; diff --git a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java index fe478770e..02d25f8dd 100644 --- a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java +++ b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java @@ -25,9 +25,9 @@ import org.xml.sax.Locator; import org.apache.xmlgraphics.util.QName; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.Length; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.FONode; import org.apache.fop.fo.ValidationException; import org.apache.fop.fo.XMLObj; diff --git a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java index 8e3955cd8..7e68bbcea 100644 --- a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java +++ b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java @@ -28,11 +28,11 @@ import org.apache.xmlgraphics.image.loader.ImageInfo; import org.apache.xmlgraphics.image.loader.ImageManager; import org.apache.xmlgraphics.image.loader.ImageSessionContext; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.PercentBaseContext; import org.apache.fop.datatypes.URISpecification; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.Constants; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; diff --git a/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java index d6c727f68..b38874606 100644 --- a/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java @@ -34,6 +34,7 @@ import org.apache.xmlgraphics.image.loader.ImageInfo; import org.apache.xmlgraphics.image.loader.ImageManager; import org.apache.xmlgraphics.image.loader.util.ImageUtil; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.area.AreaTreeHandler; import org.apache.fop.area.Block; @@ -47,7 +48,6 @@ import org.apache.fop.area.inline.Image; import org.apache.fop.area.inline.Viewport; import org.apache.fop.datatypes.FODimension; import org.apache.fop.datatypes.URISpecification; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.Constants; import org.apache.fop.fo.extensions.ExternalDocument; import org.apache.fop.layoutmgr.inline.ImageLayout; diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index ed7682221..8233e480a 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -34,6 +34,7 @@ import org.w3c.dom.Document; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.area.Area; @@ -66,7 +67,6 @@ import org.apache.fop.area.inline.SpaceArea; import org.apache.fop.area.inline.TextArea; import org.apache.fop.area.inline.Viewport; import org.apache.fop.area.inline.WordArea; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.Constants; import org.apache.fop.fonts.FontInfo; diff --git a/src/java/org/apache/fop/render/afp/AFPRenderer.java b/src/java/org/apache/fop/render/afp/AFPRenderer.java index 2118ac2bc..d88deadfe 100644 --- a/src/java/org/apache/fop/render/afp/AFPRenderer.java +++ b/src/java/org/apache/fop/render/afp/AFPRenderer.java @@ -41,6 +41,7 @@ import org.apache.xmlgraphics.image.loader.ImageSessionContext; import org.apache.xmlgraphics.image.loader.util.ImageUtil; import org.apache.xmlgraphics.ps.ImageEncodingHelper; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.afp.AFPBorderPainter; import org.apache.fop.afp.AFPDataObjectInfo; import org.apache.fop.afp.AFPDitheredRectanglePainter; @@ -77,7 +78,6 @@ import org.apache.fop.area.inline.Image; import org.apache.fop.area.inline.Leader; import org.apache.fop.area.inline.TextArea; import org.apache.fop.datatypes.URISpecification; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.extensions.ExtensionAttachment; import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontCollection; diff --git a/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java b/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java index 7f6cce05a..1b870a7c5 100644 --- a/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java +++ b/src/java/org/apache/fop/render/intermediate/AbstractIFPainter.java @@ -43,9 +43,9 @@ import org.apache.xmlgraphics.image.loader.ImageManager; import org.apache.xmlgraphics.image.loader.ImageSessionContext; import org.apache.xmlgraphics.image.loader.util.ImageUtil; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.FopFactory; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.render.ImageHandler; import org.apache.fop.render.ImageHandlerRegistry; import org.apache.fop.render.ImageHandlerUtil; diff --git a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java index f09794ff2..4cb0c988e 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java +++ b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java @@ -54,6 +54,7 @@ import org.apache.xmlgraphics.image.loader.impl.ImageRendered; import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM; import org.apache.xmlgraphics.image.loader.util.ImageUtil; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.FopFactoryConfigurator; @@ -67,7 +68,6 @@ import org.apache.fop.area.inline.SpaceArea; import org.apache.fop.area.inline.TextArea; import org.apache.fop.area.inline.WordArea; import org.apache.fop.datatypes.URISpecification; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.Constants; import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontCollection; diff --git a/src/java/org/apache/fop/render/pcl/PCLRenderer.java b/src/java/org/apache/fop/render/pcl/PCLRenderer.java index 7b48dbccf..831dc99b4 100644 --- a/src/java/org/apache/fop/render/pcl/PCLRenderer.java +++ b/src/java/org/apache/fop/render/pcl/PCLRenderer.java @@ -58,6 +58,7 @@ import org.apache.xmlgraphics.java2d.GraphicContext; import org.apache.xmlgraphics.java2d.Graphics2DImagePainter; import org.apache.xmlgraphics.util.UnitConv; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.MimeConstants; @@ -79,7 +80,6 @@ import org.apache.fop.area.inline.TextArea; import org.apache.fop.area.inline.Viewport; import org.apache.fop.area.inline.WordArea; import org.apache.fop.datatypes.URISpecification; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontCollection; import org.apache.fop.fonts.FontInfo; diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index a4ba08911..c280ac6fb 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -44,6 +44,7 @@ import org.apache.xmlgraphics.image.loader.ImageManager; import org.apache.xmlgraphics.image.loader.ImageSessionContext; import org.apache.xmlgraphics.image.loader.util.ImageUtil; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.MimeConstants; @@ -68,7 +69,6 @@ import org.apache.fop.area.inline.TextArea; import org.apache.fop.area.inline.Viewport; import org.apache.fop.area.inline.WordArea; import org.apache.fop.datatypes.URISpecification; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.extensions.ExtensionAttachment; import org.apache.fop.fo.extensions.xmp.XMPMetadata; import org.apache.fop.fonts.Font; diff --git a/src/java/org/apache/fop/render/ps/PSRenderer.java b/src/java/org/apache/fop/render/ps/PSRenderer.java index 14924996e..103d714bf 100644 --- a/src/java/org/apache/fop/render/ps/PSRenderer.java +++ b/src/java/org/apache/fop/render/ps/PSRenderer.java @@ -61,6 +61,7 @@ import org.apache.xmlgraphics.ps.dsc.ResourceTracker; import org.apache.xmlgraphics.ps.dsc.events.DSCCommentBoundingBox; import org.apache.xmlgraphics.ps.dsc.events.DSCCommentHiResBoundingBox; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.area.Area; @@ -79,7 +80,6 @@ import org.apache.fop.area.inline.SpaceArea; import org.apache.fop.area.inline.TextArea; import org.apache.fop.area.inline.WordArea; import org.apache.fop.datatypes.URISpecification; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.extensions.ExtensionAttachment; import org.apache.fop.fonts.Font; import org.apache.fop.fonts.LazyFont; diff --git a/src/java/org/apache/fop/render/ps/ResourceHandler.java b/src/java/org/apache/fop/render/ps/ResourceHandler.java index 1590363a1..502242c17 100644 --- a/src/java/org/apache/fop/render/ps/ResourceHandler.java +++ b/src/java/org/apache/fop/render/ps/ResourceHandler.java @@ -63,8 +63,8 @@ import org.apache.xmlgraphics.ps.dsc.events.PostScriptComment; import org.apache.xmlgraphics.ps.dsc.events.PostScriptLine; import org.apache.xmlgraphics.ps.dsc.tools.DSCTools; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOUserAgent; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fonts.FontInfo; import org.apache.fop.render.ImageHandler; import org.apache.fop.render.ImageHandlerRegistry; diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java index d3762a436..fc42a1b8f 100644 --- a/src/java/org/apache/fop/render/rtf/RTFHandler.java +++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java @@ -50,11 +50,11 @@ import org.apache.xmlgraphics.image.loader.impl.ImageRawStream; import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM; import org.apache.xmlgraphics.image.loader.util.ImageUtil; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.datatypes.LengthBase; import org.apache.fop.datatypes.PercentBaseContext; -import org.apache.fop.events.ResourceEventProducer; import org.apache.fop.fo.Constants; import org.apache.fop.fo.FOEventHandler; import org.apache.fop.fo.FONode; diff --git a/src/sandbox/org/apache/fop/render/svg/SVGPainter.java b/src/sandbox/org/apache/fop/render/svg/SVGPainter.java index 1466197a6..c5a19818d 100644 --- a/src/sandbox/org/apache/fop/render/svg/SVGPainter.java +++ b/src/sandbox/org/apache/fop/render/svg/SVGPainter.java @@ -44,7 +44,7 @@ import org.apache.xmlgraphics.image.loader.ImageSessionContext; import org.apache.xmlgraphics.xmp.Metadata; import org.apache.fop.apps.MimeConstants; -import org.apache.fop.events.ResourceEventProducer; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.render.ImageHandlerUtil; import org.apache.fop.render.RenderingContext; import org.apache.fop.render.intermediate.AbstractIFPainter; diff --git a/test/java/org/apache/fop/events/EventProcessingTestCase.java b/test/java/org/apache/fop/events/EventProcessingTestCase.java index c1fc757a8..0c42ec5e1 100644 --- a/test/java/org/apache/fop/events/EventProcessingTestCase.java +++ b/test/java/org/apache/fop/events/EventProcessingTestCase.java @@ -37,6 +37,7 @@ import org.apache.commons.io.output.NullOutputStream; import org.apache.xmlgraphics.util.MimeConstants; +import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.Fop; import org.apache.fop.apps.FopFactory; diff --git a/test/java/org/apache/fop/events/FOPTestEventModelFactory.java b/test/java/org/apache/fop/events/FOPTestEventModelFactory.java index 796a9cfb5..244cd5fec 100644 --- a/test/java/org/apache/fop/events/FOPTestEventModelFactory.java +++ b/test/java/org/apache/fop/events/FOPTestEventModelFactory.java @@ -27,7 +27,7 @@ import org.apache.fop.events.model.EventModel; */ public class FOPTestEventModelFactory extends AbstractEventModelFactory { - private static final String EVENT_MODEL_FILENAME = "test-event-model.xml"; + private static final String EVENT_MODEL_FILENAME = "event-model.xml"; /** {@inheritDoc} */ public EventModel createEventModel() { -- 2.39.5