Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

Merged branch https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ProcessingFeedback into Trunk. Changes on branch: ........ r615153 | jeremias | 2008-01-25 10:07:21 +0100 (Fr, 25 Jan 2008) | 1 line Created temporary branch for processing feedback. ........ r615155 | jeremias | 2008-01-25 10:11:59 +0100 (Fr, 25 Jan 2008) | 1 line Initial commit of what I've built already for those who prefer code to minimalistic design docs. ........ r615278 | jeremias | 2008-01-25 18:25:00 +0100 (Fr, 25 Jan 2008) | 1 line EventProducer interfaces now operational. ........ r615773 | jeremias | 2008-01-28 10:06:16 +0100 (Mo, 28 Jan 2008) | 1 line No casting in client code when creating EventProducer instances. ........ r616242 | vhennebert | 2008-01-29 11:34:45 +0100 (Di, 29 Jan 2008) | 3 lines Trick to avoid hard-coding the class name of EventProducer in the source file. Feel free to revert if it's not ok. ........ r616900 | jeremias | 2008-01-30 21:59:31 +0100 (Mi, 30 Jan 2008) | 1 line Generate event model XMLs in to the build directory: build/gensrc and build/test-gensrc (the latter is new and needs to be setup as source folder in your IDE!) ........ r616907 | jeremias | 2008-01-30 22:12:59 +0100 (Mi, 30 Jan 2008) | 1 line Added an XMLResourceBundle that uses an XML file instead of a properties file to load the translations. The XML format is the same as for Cocoon's XMLResourceBundle. ........ r617097 | vhennebert | 2008-01-31 11:53:21 +0100 (Do, 31 Jan 2008) | 2 lines Minor typo + slight improvement of Javadoc ........ r617176 | jeremias | 2008-01-31 19:14:19 +0100 (Do, 31 Jan 2008) | 5 lines Renamed FopEvent to Event as suggested by Simon. EventProducerCollectorTask.java now reads the EventSeverity from a doclet tag. Added generation of EventProducer translations (including simple merging, no validation, yet) EventFormatter introduced (only basic functionality, yet). Added a simple EventListener implementation that uses EventFormatter to convert the events to human-readable, localized messages that are sent to the log via Commons Logging. ........ r617362 | jeremias | 2008-02-01 08:18:07 +0100 (Fr, 01 Feb 2008) | 1 line Some remaining rename operations based on an earlier discussion. ........ r617413 | jeremias | 2008-02-01 10:46:26 +0100 (Fr, 01 Feb 2008) | 2 lines Extracted formatting functionality into utility class AdvancedMessageFormat.java. AdvancedMessageFormat.java now supports conditional sub-groups (delimited by []). ........ r618682 | jeremias | 2008-02-05 17:07:08 +0100 (Di, 05 Feb 2008) | 1 line Add support for special object formatters (where toString() isn't good enough). ATM, it's hard-coded but could later be hooked into dynamic discovery if we have multiple such formatters. The SAX Locator is the only example for now. ........ r618686 | jeremias | 2008-02-05 17:12:56 +0100 (Di, 05 Feb 2008) | 3 lines Hooked most of FONode into the new event mechanism. The FOUserAgent provides a DefaultEventBroadcaster instance. If a producer method declares throwing an exception, the event is automatically marked FATAL and the dynamic proxy throws an exception right after notifying the listeners. The exceptions are created through the EventExceptionManager. It currently contains only one exception factory for ValidationException. If we need more such factories it's better to register them dynamically. Right now, they're hard-coded. ........ r619313 | jeremias | 2008-02-07 10:14:15 +0100 (Do, 07 Feb 2008) | 1 line Make sure no events are now just silently swallowed because after upgrading a user doesn't know about the event system. ........ r619314 | jeremias | 2008-02-07 10:14:46 +0100 (Do, 07 Feb 2008) | 1 line Log what translation file is being written. ........ r619320 | jeremias | 2008-02-07 10:31:00 +0100 (Do, 07 Feb 2008) | 2 lines FObj hooked into the event system. Code reduction using a protected method on FONode to acquire a FOValidationEventProducer. ........ r619359 | jeremias | 2008-02-07 11:59:19 +0100 (Do, 07 Feb 2008) | 2 lines Fop's QName now extends XGCommons' QName to initiate a transition. Hooked PropertyList into the event mechanism. ........ r631252 | jeremias | 2008-02-26 16:24:33 +0100 (Di, 26 Feb 2008) | 1 line Removed superfluous warning. ........ r631268 | jeremias | 2008-02-26 17:08:11 +0100 (Di, 26 Feb 2008) | 1 line Deprecated two methods which are a problem for localization. Also helps finding additional spots to switch over to the event mechanism. ........ r633852 | jeremias | 2008-03-05 15:20:24 +0100 (Mi, 05 Mrz 2008) | 1 line Add severity to formatting parameters. ........ r633855 | jeremias | 2008-03-05 15:21:57 +0100 (Mi, 05 Mrz 2008) | 4 lines Added support for additional field styles: {<fieldname>,if,<true-text>,<false-text>} {<fieldname>,equals,<test-string>,<true-text>,<false-text>} ........ r633856 | jeremias | 2008-03-05 15:24:04 +0100 (Mi, 05 Mrz 2008) | 2 lines Javadocs and TODOs. EventListeners can change the event severity. ........ r633857 | jeremias | 2008-03-05 15:27:08 +0100 (Mi, 05 Mrz 2008) | 4 lines Javadocs. Moved out event listener registration into a CompositeEventListener. Event broadcaster uses the events effective severity, not the initial value (for the case where listeners override the initial value). Set up a special EventBroadCaster in the FOUserAgent that filters events through a class (FOValidationEventListenerProxy) that adjusts the event severity for relaxed validation. ........ r633858 | jeremias | 2008-03-05 15:32:07 +0100 (Mi, 05 Mrz 2008) | 2 lines Instead of always decentrally checking whether strict validation is enabled or not, this is now done in a special event listener. The event producer method caller simply indicates whether it can recover from the error condition and continue. Started switching to event production in table FOs. ........ r634027 | jeremias | 2008-03-05 21:58:35 +0100 (Mi, 05 Mrz 2008) | 7 lines Moved AdvancedMessageFormat into its own package. AdvancedMessageFormat got the following added functionality: - Alternative conditional regions [ bla {field}] -> [ bla {field1}| even more bla {field2}] - Functions: functions get access to the parameters and they can produce an object that is then formatted ({#gatherContextInfo}) - "if" and "equals" format moved to top-level classes and added by dynamic registration. EventFormatter now supports includes in the form {{includeName}} so you can include other entries from the resource bundle for better reuse. Some more events in table code. ........ r634031 | jeremias | 2008-03-05 22:05:22 +0100 (Mi, 05 Mrz 2008) | 1 line SVN Props ........ r634208 | jeremias | 2008-03-06 11:26:52 +0100 (Do, 06 Mrz 2008) | 2 lines Improved context gathering. Moved GatherContextInfoFunction to an inner class of FONode to reduce visibilities. ........ r634209 | jeremias | 2008-03-06 11:28:14 +0100 (Do, 06 Mrz 2008) | 1 line Made FOPException localizable. ........ r634280 | jeremias | 2008-03-06 15:38:30 +0100 (Do, 06 Mrz 2008) | 2 lines ExceptionFactory is now dynamically registered. More table warnings and errors switch to events. ........ r634326 | jeremias | 2008-03-06 17:08:16 +0100 (Do, 06 Mrz 2008) | 1 line Remaining table FOs switched to events. ........ r634328 | jeremias | 2008-03-06 17:09:21 +0100 (Do, 06 Mrz 2008) | 1 line Deprecated FOP's QName. Mixing with Commons' variant only produces problems. ........ r634381 | jeremias | 2008-03-06 20:12:57 +0100 (Do, 06 Mrz 2008) | 2 lines Made the "invalidChild" event fully localizable by adding a "lookup" field for the optional rule to be displayed. And a few switches to the event system. ........ r634692 | jeremias | 2008-03-07 15:31:43 +0100 (Fr, 07 Mrz 2008) | 1 line More FO tree stuff switched to events. ........ r634712 | jeremias | 2008-03-07 16:19:21 +0100 (Fr, 07 Mrz 2008) | 1 line Avoid an NPE that says nothing (ex. could happen if the message template is wrong). ........ r634738 | jeremias | 2008-03-07 17:38:21 +0100 (Fr, 07 Mrz 2008) | 2 lines Non-FO children were not properly run through validation by FOTreeBuilder. Unified the way that non-FO elements are validated. Some FOs were already fixed. I now fixed the rest, so foreign elements can occur everywhere. ........ r637833 | jeremias | 2008-03-17 12:01:41 +0100 (Mo, 17 Mrz 2008) | 1 line Exception while cloning for RetrieveMarker to be handled by user as suggested by Andreas. ........ r637835 | jeremias | 2008-03-17 12:03:31 +0100 (Mo, 17 Mrz 2008) | 1 line Throw a RuntimeException of no other Exception class is specified for an event as a fallback if someone just sets the event severity to FATAL. ........ r637838 | jeremias | 2008-03-17 12:06:10 +0100 (Mo, 17 Mrz 2008) | 1 line Throw a meaningful exception when the property name is wrong. Otherwise, there will be an ArrayIndexOutOfBoundsException. ........ r637859 | jeremias | 2008-03-17 13:35:26 +0100 (Mo, 17 Mrz 2008) | 1 line Throw a meaningful exception when the property name is wrong. Otherwise, there will be an ArrayIndexOutOfBoundsException. ........ r637938 | jeremias | 2008-03-17 16:19:51 +0100 (Mo, 17 Mrz 2008) | 1 line Switched pagination package to events. ........ r637947 | jeremias | 2008-03-17 16:45:16 +0100 (Mo, 17 Mrz 2008) | 1 line Removed unlocalizable validation helper methods. ........ r637952 | jeremias | 2008-03-17 16:59:02 +0100 (Mo, 17 Mrz 2008) | 1 line Events on FOTreeBuilder. ........ r638299 | jeremias | 2008-03-18 11:09:30 +0100 (Di, 18 Mrz 2008) | 2 lines Added support for java.util.text's ChoiceFormat to AdvancedMessageFormat. Reuse the regexes as constants. ........ r638302 | jeremias | 2008-03-18 11:17:06 +0100 (Di, 18 Mrz 2008) | 1 line Events for inline-level layout managers. ........ r638774 | jeremias | 2008-03-19 11:17:36 +0100 (Mi, 19 Mrz 2008) | 1 line Added DEBUG level. ........ r638777 | jeremias | 2008-03-19 11:23:40 +0100 (Mi, 19 Mrz 2008) | 3 lines Generalized FOValidationEventListenerProxy into FOPEventListenerProxy, the main proxy for FOP's own event manipulation proxy. Done because of support for overflow="hidden" vs. overflow="error-if-overflow". Switched block-level layout managers to events. Some cleanup along the way. ........ r639222 | jeremias | 2008-03-20 10:27:34 +0100 (Do, 20 Mrz 2008) | 2 lines Some initial work for event forwarding from Batik. Missing errors/exceptions converted to events in PageSequenceMaster. ........ r639270 | jeremias | 2008-03-20 13:50:35 +0100 (Do, 20 Mrz 2008) | 1 line Removed DEBUG event severity again. Promoted constrained geometry adjustment event to INFO level as per discussion. ........ r640395 | jeremias | 2008-03-24 13:39:13 +0100 (Mo, 24 Mrz 2008) | 3 lines Moved the creation of the fallback LoggingEventListener to FOUserAgent so event before the startDocument() SAX event arrive in the log. Dynamic discovery of event models. Renderers and extensions can register renderer-specific event models. Switched the most important parts of the renderers to events (maybe not everything is converted). ........ r640397 | jeremias | 2008-03-24 13:43:04 +0100 (Mo, 24 Mrz 2008) | 1 line Remaining fixcrlfs. Xalan likes to mix CRLF and LF on Windows. ........ r640398 | jeremias | 2008-03-24 13:43:54 +0100 (Mo, 24 Mrz 2008) | 1 line Ignore namespace declarations for property handling. ........ r640463 | jeremias | 2008-03-24 17:59:52 +0100 (Mo, 24 Mrz 2008) | 2 lines Event in area package. Exposed getUserAgent() in Renderer interface (was already public in AbstractRenderer). ........ r642972 | jeremias | 2008-03-31 14:18:39 +0200 (Mo, 31 Mrz 2008) | 1 line Code restructured a bit. ........ r642975 | jeremias | 2008-03-31 14:24:07 +0200 (Mo, 31 Mrz 2008) | 2 lines Plugged fonts package into the event subsystem. Note: I did not follow the same pattern as for the rest as the font package is to be considered FOP-external, so I just added a manual adapter for the FontEventListener. This demonstrates how an external library can be integrated with the event system. Missing warning for unknown formatting objects added. Warning is not issued by the ElementMappingRegistry anymore but by FOTreeBuilder which has access to more context information. ........ r642997 | jeremias | 2008-03-31 16:10:08 +0200 (Mo, 31 Mrz 2008) | 1 line Added an example to demonstrate how to write your own event listener and how to deal with the exceptions thrown in the process. ........ r642998 | jeremias | 2008-03-31 16:13:40 +0200 (Mo, 31 Mrz 2008) | 1 line Removed unused method. Event formatting should not be part of the Event class. Use EventFormatter.format(Event) instead. ........ r643066 | jeremias | 2008-03-31 19:18:54 +0200 (Mo, 31 Mrz 2008) | 1 line First part of the event subsystem documentation (DRAFT). ........ r643784 | jeremias | 2008-04-02 10:05:33 +0200 (Mi, 02 Apr 2008) | 1 line More documentation. ........ r643785 | jeremias | 2008-04-02 10:06:38 +0200 (Mi, 02 Apr 2008) | 1 line Some nits. ........ r643787 | jeremias | 2008-04-02 10:24:41 +0200 (Mi, 02 Apr 2008) | 1 line Completed javadocs ........ r643824 | jeremias | 2008-04-02 12:00:30 +0200 (Mi, 02 Apr 2008) | 1 line Javadocs. ........ r645847 | vhennebert | 2008-04-08 12:54:16 +0200 (Di, 08 Apr 2008) | 2 lines Minor typo fixes ........ r645848 | vhennebert | 2008-04-08 12:58:30 +0200 (Di, 08 Apr 2008) | 2 lines Another small typo fix ........ r647678 | jeremias | 2008-04-14 09:20:26 +0200 (Mo, 14 Apr 2008) | 1 line Renamed *EventProducer.Factory.create() to *EventProducer.Provider.get() to better reflect what the method does (instances may be cached and reused). ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@647742 13f79535-47bb-0310-9956-ffa450edef68
16 роки тому
Fop.java gets two new constructors: Fop(String) and Fop(String, FOUserAgent) where the String is the MIME type for the desired output format. MimeConstants provides a comprehensive list of MIME types used in Fop.java. Non-standard, FOP-specific MIME types changed to a uniform pattern: application/X-fop-awt-preview, application/X-fop-print and application/X-fop-areatree. RendererFactory now supports manual registration and dynamic discovery of Renderers and FOEventHandlers by their MIME types. Instantitation is done using MIME types everywhere. The RENDER_* constants are mapped to MIME types in Fop.java. RendererFactory is now an instantiable class whose reference is held by FOUserAgent just like it is done for the XLMHandlers. Renderers and FOEventHandlers now each have a *Maker class which is a kind of factory class which is used to register a Renderer/FOEventHandler and additionally serves to provide additional information about the thing, such as the MIME types it supports and if the implementation requires an OutputStream. The command-line gets a new option: -out application/pdf myfile.pdf is the generic way to create an output file. If someone created a WordML output handler and provided the right service resource file he could specify "-out text/xml+msword out.xml". ".out list" lists all MIME types that are available for output. Renderers can now potionally expose a Graphics2DAdapter which in concert with Graphics2DImagePainter can be used by FOP extensions to paint their content directly using a Graphics2D instance. That makes it possible to avoid a detour via SVG/Batik in certain cases. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@332549 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
Fop.java gets two new constructors: Fop(String) and Fop(String, FOUserAgent) where the String is the MIME type for the desired output format. MimeConstants provides a comprehensive list of MIME types used in Fop.java. Non-standard, FOP-specific MIME types changed to a uniform pattern: application/X-fop-awt-preview, application/X-fop-print and application/X-fop-areatree. RendererFactory now supports manual registration and dynamic discovery of Renderers and FOEventHandlers by their MIME types. Instantitation is done using MIME types everywhere. The RENDER_* constants are mapped to MIME types in Fop.java. RendererFactory is now an instantiable class whose reference is held by FOUserAgent just like it is done for the XLMHandlers. Renderers and FOEventHandlers now each have a *Maker class which is a kind of factory class which is used to register a Renderer/FOEventHandler and additionally serves to provide additional information about the thing, such as the MIME types it supports and if the implementation requires an OutputStream. The command-line gets a new option: -out application/pdf myfile.pdf is the generic way to create an output file. If someone created a WordML output handler and provided the right service resource file he could specify "-out text/xml+msword out.xml". ".out list" lists all MIME types that are available for output. Renderers can now potionally expose a Graphics2DAdapter which in concert with Graphics2DImagePainter can be used by FOP extensions to paint their content directly using a Graphics2D instance. That makes it possible to avoid a detour via SVG/Batik in certain cases. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@332549 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-664698 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r638937 | jeremias | 2008-03-19 18:08:57 +0100 (Mi, 19 Mrz 2008) | 1 line A nit. ........ r640889 | vhennebert | 2008-03-25 17:43:55 +0100 (Di, 25 Mrz 2008) | 2 lines Set the final release date and added a news item about the 0.95beta release (the change was made before updating the website) ........ r642906 | jeremias | 2008-03-31 09:12:40 +0200 (Mo, 31 Mrz 2008) | 3 lines Added version number to xml-apis-ext (as suggested by Karel Vervaeke). Moved xml-apis to same version as xml-apis-ext. Added missing licensing info about xml-apis-ext. ........ r647403 | jeremias | 2008-04-12 11:02:01 +0200 (Sa, 12 Apr 2008) | 1 line Fixed NullPointerException when loading a TrueType font using XML font metric files. ........ r647537 | jeremias | 2008-04-13 09:36:00 +0200 (So, 13 Apr 2008) | 1 line Performance improvement when encoding images: Fixed an important hotspot by extending CloseBlocker from ProxyOutputStream instead of FilterOutputStream as the latter routes all write(byte[]) calls through write(int). ........ r648984 | jeremias | 2008-04-17 09:00:22 +0200 (Do, 17 Apr 2008) | 1 line HeadURL was missing in the properties. ........ r649006 | jeremias | 2008-04-17 10:42:52 +0200 (Do, 17 Apr 2008) | 1 line Fixed text extraction problem with ZapfDingbats and Symbol font in PDF output. These fonts are symbolic and must not use an Encoding value in PDF. Applies to the built-in base 14 variant and to the case where these fonts are explicitely embedded. ........ r649014 | jeremias | 2008-04-17 11:10:15 +0200 (Do, 17 Apr 2008) | 1 line Added missing change information. ........ r650550 | vhennebert | 2008-04-22 17:22:31 +0200 (Di, 22 Apr 2008) | 4 lines Bugzilla 41621: - length of the penalty now correctly computed; - AssertionError fixed. ........ r651302 | jeremias | 2008-04-24 18:08:53 +0200 (Do, 24 Apr 2008) | 3 lines Fixed regression causing bad positioning of block-containers if used as descendant of a table-cell. This was not caught because of the lack of a test case that would have shown the problem in visual testing with BatchDiffer. See also: http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200804.mbox/%3c20080424164128.973A.DEV@jeremias-maerki.ch%3e ........ r653537 | vhennebert | 2008-05-05 19:47:28 +0200 (Mo, 05 Mai 2008) | 2 lines Bugfix: the before border of cells below a column-spanning cell had their value taken from the leading case, instead of the normal one. ........ r654453 | jeremias | 2008-05-08 11:14:04 +0200 (Do, 08 Mai 2008) | 2 lines Added /usr/local/share/fonts as additional possible location for fonts on Unixes. ........ r656286 | jeremias | 2008-05-14 16:16:49 +0200 (Mi, 14 Mai 2008) | 1 line Restored plug-in API compatibility with FOP 0.94. Fixes a NoSuchMethodError when Barcode4J is run. ........ r656524 | jeremias | 2008-05-15 09:07:18 +0200 (Do, 15 Mai 2008) | 1 line Fixed rendering of fixed block-containers in AFP output. The break-out was actually never implemented which is necessary for supporting fixed positioned viewports. ........ r657520 | maxberger | 2008-05-18 11:38:45 +0200 (So, 18 Mai 2008) | 1 line Updated as per suggestions in bug 45019 ........ r661580 | maxberger | 2008-05-30 08:42:17 +0200 (Fr, 30 Mai 2008) | 1 line added my key to KEYS, it is used for signing mvn artifacts ........ r663482 | jeremias | 2008-06-05 09:06:37 +0200 (Do, 05 Jun 2008) | 1 line Fixed positioning of absolutely positioned block-containers in multi-column documents. ........ r664692 | jeremias | 2008-06-09 14:49:45 +0200 (Mo, 09 Jun 2008) | 1 line Restored PSImageUtils. I had deleted it prematurely. Extensions like Barcode4J rely on this class. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@665691 13f79535-47bb-0310-9956-ffa450edef68
16 роки тому
Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-664698 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r638937 | jeremias | 2008-03-19 18:08:57 +0100 (Mi, 19 Mrz 2008) | 1 line A nit. ........ r640889 | vhennebert | 2008-03-25 17:43:55 +0100 (Di, 25 Mrz 2008) | 2 lines Set the final release date and added a news item about the 0.95beta release (the change was made before updating the website) ........ r642906 | jeremias | 2008-03-31 09:12:40 +0200 (Mo, 31 Mrz 2008) | 3 lines Added version number to xml-apis-ext (as suggested by Karel Vervaeke). Moved xml-apis to same version as xml-apis-ext. Added missing licensing info about xml-apis-ext. ........ r647403 | jeremias | 2008-04-12 11:02:01 +0200 (Sa, 12 Apr 2008) | 1 line Fixed NullPointerException when loading a TrueType font using XML font metric files. ........ r647537 | jeremias | 2008-04-13 09:36:00 +0200 (So, 13 Apr 2008) | 1 line Performance improvement when encoding images: Fixed an important hotspot by extending CloseBlocker from ProxyOutputStream instead of FilterOutputStream as the latter routes all write(byte[]) calls through write(int). ........ r648984 | jeremias | 2008-04-17 09:00:22 +0200 (Do, 17 Apr 2008) | 1 line HeadURL was missing in the properties. ........ r649006 | jeremias | 2008-04-17 10:42:52 +0200 (Do, 17 Apr 2008) | 1 line Fixed text extraction problem with ZapfDingbats and Symbol font in PDF output. These fonts are symbolic and must not use an Encoding value in PDF. Applies to the built-in base 14 variant and to the case where these fonts are explicitely embedded. ........ r649014 | jeremias | 2008-04-17 11:10:15 +0200 (Do, 17 Apr 2008) | 1 line Added missing change information. ........ r650550 | vhennebert | 2008-04-22 17:22:31 +0200 (Di, 22 Apr 2008) | 4 lines Bugzilla 41621: - length of the penalty now correctly computed; - AssertionError fixed. ........ r651302 | jeremias | 2008-04-24 18:08:53 +0200 (Do, 24 Apr 2008) | 3 lines Fixed regression causing bad positioning of block-containers if used as descendant of a table-cell. This was not caught because of the lack of a test case that would have shown the problem in visual testing with BatchDiffer. See also: http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200804.mbox/%3c20080424164128.973A.DEV@jeremias-maerki.ch%3e ........ r653537 | vhennebert | 2008-05-05 19:47:28 +0200 (Mo, 05 Mai 2008) | 2 lines Bugfix: the before border of cells below a column-spanning cell had their value taken from the leading case, instead of the normal one. ........ r654453 | jeremias | 2008-05-08 11:14:04 +0200 (Do, 08 Mai 2008) | 2 lines Added /usr/local/share/fonts as additional possible location for fonts on Unixes. ........ r656286 | jeremias | 2008-05-14 16:16:49 +0200 (Mi, 14 Mai 2008) | 1 line Restored plug-in API compatibility with FOP 0.94. Fixes a NoSuchMethodError when Barcode4J is run. ........ r656524 | jeremias | 2008-05-15 09:07:18 +0200 (Do, 15 Mai 2008) | 1 line Fixed rendering of fixed block-containers in AFP output. The break-out was actually never implemented which is necessary for supporting fixed positioned viewports. ........ r657520 | maxberger | 2008-05-18 11:38:45 +0200 (So, 18 Mai 2008) | 1 line Updated as per suggestions in bug 45019 ........ r661580 | maxberger | 2008-05-30 08:42:17 +0200 (Fr, 30 Mai 2008) | 1 line added my key to KEYS, it is used for signing mvn artifacts ........ r663482 | jeremias | 2008-06-05 09:06:37 +0200 (Do, 05 Jun 2008) | 1 line Fixed positioning of absolutely positioned block-containers in multi-column documents. ........ r664692 | jeremias | 2008-06-09 14:49:45 +0200 (Mo, 09 Jun 2008) | 1 line Restored PSImageUtils. I had deleted it prematurely. Extensions like Barcode4J rely on this class. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@665691 13f79535-47bb-0310-9956-ffa450edef68
16 роки тому
Merged revisions 636407-637074,637076-637118,637120-637790,637792-637856,637858-637992,637994-638047,638049-638307,638309-638315,638318-664698 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95 ........ r638937 | jeremias | 2008-03-19 18:08:57 +0100 (Mi, 19 Mrz 2008) | 1 line A nit. ........ r640889 | vhennebert | 2008-03-25 17:43:55 +0100 (Di, 25 Mrz 2008) | 2 lines Set the final release date and added a news item about the 0.95beta release (the change was made before updating the website) ........ r642906 | jeremias | 2008-03-31 09:12:40 +0200 (Mo, 31 Mrz 2008) | 3 lines Added version number to xml-apis-ext (as suggested by Karel Vervaeke). Moved xml-apis to same version as xml-apis-ext. Added missing licensing info about xml-apis-ext. ........ r647403 | jeremias | 2008-04-12 11:02:01 +0200 (Sa, 12 Apr 2008) | 1 line Fixed NullPointerException when loading a TrueType font using XML font metric files. ........ r647537 | jeremias | 2008-04-13 09:36:00 +0200 (So, 13 Apr 2008) | 1 line Performance improvement when encoding images: Fixed an important hotspot by extending CloseBlocker from ProxyOutputStream instead of FilterOutputStream as the latter routes all write(byte[]) calls through write(int). ........ r648984 | jeremias | 2008-04-17 09:00:22 +0200 (Do, 17 Apr 2008) | 1 line HeadURL was missing in the properties. ........ r649006 | jeremias | 2008-04-17 10:42:52 +0200 (Do, 17 Apr 2008) | 1 line Fixed text extraction problem with ZapfDingbats and Symbol font in PDF output. These fonts are symbolic and must not use an Encoding value in PDF. Applies to the built-in base 14 variant and to the case where these fonts are explicitely embedded. ........ r649014 | jeremias | 2008-04-17 11:10:15 +0200 (Do, 17 Apr 2008) | 1 line Added missing change information. ........ r650550 | vhennebert | 2008-04-22 17:22:31 +0200 (Di, 22 Apr 2008) | 4 lines Bugzilla 41621: - length of the penalty now correctly computed; - AssertionError fixed. ........ r651302 | jeremias | 2008-04-24 18:08:53 +0200 (Do, 24 Apr 2008) | 3 lines Fixed regression causing bad positioning of block-containers if used as descendant of a table-cell. This was not caught because of the lack of a test case that would have shown the problem in visual testing with BatchDiffer. See also: http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200804.mbox/%3c20080424164128.973A.DEV@jeremias-maerki.ch%3e ........ r653537 | vhennebert | 2008-05-05 19:47:28 +0200 (Mo, 05 Mai 2008) | 2 lines Bugfix: the before border of cells below a column-spanning cell had their value taken from the leading case, instead of the normal one. ........ r654453 | jeremias | 2008-05-08 11:14:04 +0200 (Do, 08 Mai 2008) | 2 lines Added /usr/local/share/fonts as additional possible location for fonts on Unixes. ........ r656286 | jeremias | 2008-05-14 16:16:49 +0200 (Mi, 14 Mai 2008) | 1 line Restored plug-in API compatibility with FOP 0.94. Fixes a NoSuchMethodError when Barcode4J is run. ........ r656524 | jeremias | 2008-05-15 09:07:18 +0200 (Do, 15 Mai 2008) | 1 line Fixed rendering of fixed block-containers in AFP output. The break-out was actually never implemented which is necessary for supporting fixed positioned viewports. ........ r657520 | maxberger | 2008-05-18 11:38:45 +0200 (So, 18 Mai 2008) | 1 line Updated as per suggestions in bug 45019 ........ r661580 | maxberger | 2008-05-30 08:42:17 +0200 (Fr, 30 Mai 2008) | 1 line added my key to KEYS, it is used for signing mvn artifacts ........ r663482 | jeremias | 2008-06-05 09:06:37 +0200 (Do, 05 Jun 2008) | 1 line Fixed positioning of absolutely positioned block-containers in multi-column documents. ........ r664692 | jeremias | 2008-06-09 14:49:45 +0200 (Mo, 09 Jun 2008) | 1 line Restored PSImageUtils. I had deleted it prematurely. Extensions like Barcode4J rely on this class. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@665691 13f79535-47bb-0310-9956-ffa450edef68
16 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes. The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
18 роки тому
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.render.xml;
  19. // Java
  20. import java.awt.Color;
  21. import java.awt.Rectangle;
  22. import java.awt.geom.Rectangle2D;
  23. import java.io.IOException;
  24. import java.io.OutputStream;
  25. import java.util.Iterator;
  26. import java.util.List;
  27. import java.util.Map;
  28. import javax.xml.transform.TransformerConfigurationException;
  29. import javax.xml.transform.sax.SAXTransformerFactory;
  30. import javax.xml.transform.sax.TransformerHandler;
  31. import javax.xml.transform.stream.StreamResult;
  32. import org.w3c.dom.Document;
  33. import org.xml.sax.SAXException;
  34. import org.apache.xmlgraphics.util.QName;
  35. import org.apache.xmlgraphics.util.XMLizable;
  36. import org.apache.fop.apps.FOPException;
  37. import org.apache.fop.apps.FOUserAgent;
  38. import org.apache.fop.apps.MimeConstants;
  39. import org.apache.fop.area.Area;
  40. import org.apache.fop.area.AreaTreeObject;
  41. import org.apache.fop.area.BeforeFloat;
  42. import org.apache.fop.area.Block;
  43. import org.apache.fop.area.BlockViewport;
  44. import org.apache.fop.area.BodyRegion;
  45. import org.apache.fop.area.BookmarkData;
  46. import org.apache.fop.area.CTM;
  47. import org.apache.fop.area.DestinationData;
  48. import org.apache.fop.area.Footnote;
  49. import org.apache.fop.area.LineArea;
  50. import org.apache.fop.area.MainReference;
  51. import org.apache.fop.area.NormalFlow;
  52. import org.apache.fop.area.OffDocumentExtensionAttachment;
  53. import org.apache.fop.area.OffDocumentItem;
  54. import org.apache.fop.area.PageSequence;
  55. import org.apache.fop.area.PageViewport;
  56. import org.apache.fop.area.RegionReference;
  57. import org.apache.fop.area.RegionViewport;
  58. import org.apache.fop.area.Span;
  59. import org.apache.fop.area.Trait;
  60. import org.apache.fop.area.Trait.Background;
  61. import org.apache.fop.area.Trait.InternalLink;
  62. import org.apache.fop.area.inline.Container;
  63. import org.apache.fop.area.inline.ForeignObject;
  64. import org.apache.fop.area.inline.Image;
  65. import org.apache.fop.area.inline.InlineArea;
  66. import org.apache.fop.area.inline.InlineBlockParent;
  67. import org.apache.fop.area.inline.InlineParent;
  68. import org.apache.fop.area.inline.InlineViewport;
  69. import org.apache.fop.area.inline.Leader;
  70. import org.apache.fop.area.inline.Space;
  71. import org.apache.fop.area.inline.SpaceArea;
  72. import org.apache.fop.area.inline.TextArea;
  73. import org.apache.fop.area.inline.WordArea;
  74. import org.apache.fop.fo.Constants;
  75. import org.apache.fop.fo.extensions.ExtensionAttachment;
  76. import org.apache.fop.fonts.FontInfo;
  77. import org.apache.fop.fonts.FontTriplet;
  78. import org.apache.fop.render.Renderer;
  79. import org.apache.fop.render.RendererContext;
  80. import org.apache.fop.render.XMLHandler;
  81. import org.apache.fop.util.ColorUtil;
  82. /**
  83. * Renderer that renders areas to XML for debugging purposes.
  84. * This creates an xml that contains the information of the area
  85. * tree. It does not output any state or derived information.
  86. * The output can be used to build a new area tree which can be
  87. * rendered to any renderer.
  88. */
  89. public class XMLRenderer extends AbstractXMLRenderer {
  90. /** XML MIME type */
  91. public static final String XML_MIME_TYPE = MimeConstants.MIME_FOP_AREA_TREE;
  92. private boolean startedSequence = false;
  93. private boolean compactFormat = false;
  94. /** If not null, the XMLRenderer will mimic another renderer by using its font setup. */
  95. protected Renderer mimic;
  96. /**
  97. * Creates a new XML renderer.
  98. */
  99. public XMLRenderer() {
  100. context = new RendererContext(this, XML_MIME_TYPE);
  101. }
  102. /**
  103. * {@inheritDoc}
  104. */
  105. @Override
  106. public void setUserAgent(FOUserAgent agent) {
  107. super.setUserAgent(agent);
  108. XMLHandler xmlHandler = new XMLXMLHandler();
  109. userAgent.getXMLHandlerRegistry().addXMLHandler(xmlHandler);
  110. Boolean b = (Boolean)userAgent.getRendererOptions().get("compact-format");
  111. if (b != null) {
  112. setCompactFormat(b.booleanValue());
  113. }
  114. }
  115. /**
  116. * Call this method to make the XMLRenderer mimic a different renderer by using its font
  117. * setup. This is useful when working with the intermediate format parser.
  118. * @param renderer the renderer to mimic
  119. */
  120. public void mimicRenderer(Renderer renderer) {
  121. this.mimic = renderer;
  122. }
  123. /** {@inheritDoc} */
  124. @Override
  125. public void setupFontInfo(FontInfo inFontInfo) throws FOPException {
  126. if (mimic != null) {
  127. mimic.setupFontInfo(inFontInfo);
  128. } else {
  129. super.setupFontInfo(inFontInfo);
  130. }
  131. }
  132. /**
  133. * Controls whether to create a more compact format which omit certain attributes.
  134. * @param compact true to activate the compact format
  135. */
  136. public void setCompactFormat(boolean compact) {
  137. this.compactFormat = compact;
  138. }
  139. private boolean isDetailedFormat() {
  140. return !this.compactFormat;
  141. }
  142. /**
  143. * Adds the general Area attributes.
  144. * @param area Area to extract attributes from
  145. */
  146. protected void addAreaAttributes(Area area) {
  147. addAttribute("ipd", area.getIPD());
  148. addAttribute("bpd", area.getBPD());
  149. if (isDetailedFormat()) {
  150. if (area.getIPD() != 0) {
  151. addAttribute("ipda", area.getAllocIPD());
  152. }
  153. if (area.getBPD() != 0) {
  154. addAttribute("bpda", area.getAllocBPD());
  155. }
  156. addAttribute("bap", area.getBorderAndPaddingWidthStart() + " "
  157. + area.getBorderAndPaddingWidthEnd() + " "
  158. + area.getBorderAndPaddingWidthBefore() + " "
  159. + area.getBorderAndPaddingWidthAfter());
  160. }
  161. }
  162. /**
  163. * Adds attributes from traits of an Area.
  164. * @param area Area to extract traits from
  165. */
  166. protected void addTraitAttributes(Area area) {
  167. Map traitMap = area.getTraits();
  168. if (traitMap != null) {
  169. Iterator iter = traitMap.entrySet().iterator();
  170. while (iter.hasNext()) {
  171. Map.Entry traitEntry = (Map.Entry) iter.next();
  172. Object key = traitEntry.getKey();
  173. String name = Trait.getTraitName(key);
  174. Class clazz = Trait.getTraitClass(key);
  175. if ("break-before".equals(name) || "break-after".equals(name)) {
  176. continue;
  177. }
  178. Object value = traitEntry.getValue();
  179. if (key == Trait.FONT) {
  180. FontTriplet triplet = (FontTriplet)value;
  181. addAttribute("font-name", triplet.getName());
  182. addAttribute("font-style", triplet.getStyle());
  183. addAttribute("font-weight", triplet.getWeight());
  184. } else if (clazz.equals(InternalLink.class)) {
  185. InternalLink iLink = (InternalLink)value;
  186. addAttribute(name, iLink.xmlAttribute());
  187. } else if (clazz.equals(Background.class)) {
  188. Background bkg = (Background)value;
  189. //TODO Remove the following line (makes changes in the test checks necessary)
  190. addAttribute(name, bkg.toString());
  191. if (bkg.getColor() != null) {
  192. addAttribute("bkg-color", ColorUtil.colorToString(bkg.getColor()));
  193. }
  194. if (bkg.getURL() != null) {
  195. addAttribute("bkg-img", bkg.getURL());
  196. String repString;
  197. int repeat = bkg.getRepeat();
  198. switch (repeat) {
  199. case Constants.EN_REPEAT:
  200. repString = "repeat";
  201. break;
  202. case Constants.EN_REPEATX:
  203. repString = "repeat-x";
  204. break;
  205. case Constants.EN_REPEATY:
  206. repString = "repeat-y";
  207. break;
  208. case Constants.EN_NOREPEAT:
  209. repString = "no-repeat";
  210. break;
  211. default:
  212. throw new IllegalStateException(
  213. "Illegal value for repeat encountered: " + repeat);
  214. }
  215. addAttribute("bkg-repeat", repString);
  216. addAttribute("bkg-horz-offset", bkg.getHoriz());
  217. addAttribute("bkg-vert-offset", bkg.getVertical());
  218. }
  219. } else if (clazz.equals(Color.class)) {
  220. Color c = (Color)value;
  221. addAttribute(name, ColorUtil.colorToString(c));
  222. } else if (key == Trait.START_INDENT || key == Trait.END_INDENT) {
  223. if (((Integer)value).intValue() != 0) {
  224. addAttribute(name, value.toString());
  225. }
  226. } else {
  227. addAttribute(name, value.toString());
  228. }
  229. }
  230. }
  231. transferForeignObjects(area);
  232. }
  233. private void transferForeignObjects(AreaTreeObject ato) {
  234. Map prefixes = new java.util.HashMap();
  235. Iterator iter = ato.getForeignAttributes().entrySet().iterator();
  236. while (iter.hasNext()) {
  237. Map.Entry entry = (Map.Entry)iter.next();
  238. QName qname = (QName)entry.getKey();
  239. prefixes.put(qname.getPrefix(), qname.getNamespaceURI());
  240. addAttribute(qname, (String)entry.getValue());
  241. }
  242. //Namespace declarations
  243. iter = prefixes.entrySet().iterator();
  244. while (iter.hasNext()) {
  245. Map.Entry entry = (Map.Entry)iter.next();
  246. String qn = "xmlns:" + (String)entry.getKey();
  247. atts.addAttribute("", (String)entry.getKey(), qn,
  248. CDATA, (String)entry.getValue());
  249. }
  250. }
  251. /** {@inheritDoc} */
  252. @Override
  253. public void processOffDocumentItem(OffDocumentItem oDI) {
  254. if (oDI instanceof BookmarkData) {
  255. renderBookmarkTree((BookmarkData) oDI);
  256. } else if (oDI instanceof DestinationData) {
  257. renderDestination((DestinationData) oDI);
  258. } else if (oDI instanceof OffDocumentExtensionAttachment) {
  259. ExtensionAttachment attachment = ((OffDocumentExtensionAttachment)oDI).getAttachment();
  260. if (extensionAttachments == null) {
  261. extensionAttachments = new java.util.ArrayList();
  262. }
  263. extensionAttachments.add(attachment);
  264. } else {
  265. String warn = "Ignoring OffDocumentItem: " + oDI;
  266. log.warn(warn);
  267. }
  268. }
  269. /**
  270. * Renders a BookmarkTree object
  271. * @param bookmarkRoot the BookmarkData object representing the top of the tree
  272. */
  273. @Override
  274. protected void renderBookmarkTree(BookmarkData bookmarkRoot) {
  275. if (bookmarkRoot.getWhenToProcess() == OffDocumentItem.END_OF_DOC) {
  276. endPageSequence();
  277. }
  278. /* If this kind of handling is also necessary for other renderers, then
  279. better add endPageSequence to the Renderer interface and call it
  280. explicitly from model.endDocument() */
  281. startElement("bookmarkTree");
  282. for (int i = 0; i < bookmarkRoot.getCount(); i++) {
  283. renderBookmarkItem(bookmarkRoot.getSubData(i));
  284. }
  285. endElement("bookmarkTree");
  286. }
  287. private void renderBookmarkItem(BookmarkData bm) {
  288. atts.clear();
  289. addAttribute("title", bm.getBookmarkTitle());
  290. addAttribute("show-children", String.valueOf(bm.showChildItems()));
  291. PageViewport pv = bm.getPageViewport();
  292. String pvKey = pv == null ? null : pv.getKey();
  293. addAttribute("internal-link",
  294. InternalLink.makeXMLAttribute(pvKey, bm.getIDRef()));
  295. startElement("bookmark", atts);
  296. for (int i = 0; i < bm.getCount(); i++) {
  297. renderBookmarkItem(bm.getSubData(i));
  298. }
  299. endElement("bookmark");
  300. }
  301. /**
  302. * Renders a DestinationData object (named destination)
  303. * @param destination the destination object
  304. */
  305. protected void renderDestination(DestinationData destination) {
  306. if (destination.getWhenToProcess() == OffDocumentItem.END_OF_DOC) {
  307. endPageSequence();
  308. }
  309. atts.clear();
  310. PageViewport pv = destination.getPageViewport();
  311. String pvKey = pv == null ? null : pv.getKey();
  312. addAttribute("internal-link",
  313. InternalLink.makeXMLAttribute(pvKey, destination.getIDRef()));
  314. startElement("destination", atts);
  315. endElement("destination");
  316. }
  317. /** {@inheritDoc} */
  318. @Override
  319. public void startRenderer(OutputStream outputStream)
  320. throws IOException {
  321. log.debug("Rendering areas to Area Tree XML");
  322. if (this.handler == null) {
  323. SAXTransformerFactory factory
  324. = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
  325. try {
  326. TransformerHandler transformerHandler = factory.newTransformerHandler();
  327. this.handler = transformerHandler;
  328. StreamResult res = new StreamResult(outputStream);
  329. transformerHandler.setResult(res);
  330. } catch (TransformerConfigurationException tce) {
  331. throw new RuntimeException(tce.getMessage());
  332. }
  333. this.out = outputStream;
  334. }
  335. try {
  336. handler.startDocument();
  337. } catch (SAXException saxe) {
  338. handleSAXException(saxe);
  339. }
  340. if (userAgent.getProducer() != null) {
  341. comment("Produced by " + userAgent.getProducer());
  342. }
  343. startElement("areaTree");
  344. }
  345. /** {@inheritDoc} */
  346. @Override
  347. public void stopRenderer() throws IOException {
  348. endPageSequence();
  349. endElement("areaTree");
  350. try {
  351. handler.endDocument();
  352. } catch (SAXException saxe) {
  353. handleSAXException(saxe);
  354. }
  355. if (this.out != null) {
  356. this.out.flush();
  357. }
  358. log.debug("Written out Area Tree XML");
  359. }
  360. /** {@inheritDoc} */
  361. @Override
  362. public void renderPage(PageViewport page) throws IOException, FOPException {
  363. atts.clear();
  364. addAttribute("bounds", page.getViewArea());
  365. addAttribute("key", page.getKey());
  366. addAttribute("nr", page.getPageNumber());
  367. addAttribute("formatted-nr", page.getPageNumberString());
  368. if (page.getSimplePageMasterName() != null) {
  369. addAttribute("simple-page-master-name", page.getSimplePageMasterName());
  370. }
  371. if (page.isBlank()) {
  372. addAttribute("blank", "true");
  373. }
  374. transferForeignObjects(page);
  375. startElement("pageViewport", atts);
  376. startElement("page");
  377. handlePageExtensionAttachments(page);
  378. super.renderPage(page);
  379. endElement("page");
  380. endElement("pageViewport");
  381. }
  382. /** {@inheritDoc} */
  383. @Override
  384. protected void handleExtensionAttachments(List attachments) {
  385. if (attachments != null && attachments.size() > 0) {
  386. startElement("extension-attachments");
  387. Iterator i = attachments.iterator();
  388. while (i.hasNext()) {
  389. ExtensionAttachment attachment = (ExtensionAttachment)i.next();
  390. if (attachment instanceof XMLizable) {
  391. try {
  392. ((XMLizable)attachment).toSAX(this.handler);
  393. } catch (SAXException e) {
  394. log.error("Error while serializing Extension Attachment", e);
  395. }
  396. } else {
  397. String warn = "Ignoring non-XMLizable ExtensionAttachment: " + attachment;
  398. log.warn(warn);
  399. }
  400. }
  401. endElement("extension-attachments");
  402. }
  403. }
  404. /** {@inheritDoc} */
  405. @Override
  406. public void startPageSequence(PageSequence pageSequence) {
  407. handleDocumentExtensionAttachments();
  408. endPageSequence(); // move this before handleDocumentExtensionAttachments() ?
  409. startedSequence = true;
  410. atts.clear();
  411. if (pageSequence.getLanguage() != null) {
  412. addAttribute("language", pageSequence.getLanguage());
  413. }
  414. if (pageSequence.getCountry() != null) {
  415. addAttribute("country", pageSequence.getCountry());
  416. }
  417. transferForeignObjects(pageSequence);
  418. startElement("pageSequence", atts);
  419. handleExtensionAttachments(pageSequence.getExtensionAttachments());
  420. LineArea seqTitle = pageSequence.getTitle();
  421. if (seqTitle != null) {
  422. startElement("title");
  423. List children = seqTitle.getInlineAreas();
  424. for (int count = 0; count < children.size(); count++) {
  425. InlineArea inline = (InlineArea) children.get(count);
  426. renderInlineArea(inline);
  427. }
  428. endElement("title");
  429. }
  430. }
  431. /**
  432. * Tells the renderer to finish the current PageSequence
  433. */
  434. public void endPageSequence() {
  435. if (startedSequence) {
  436. endElement("pageSequence");
  437. }
  438. startedSequence = false;
  439. }
  440. /**
  441. * {@inheritDoc}
  442. */
  443. @Override
  444. protected void renderRegionViewport(RegionViewport port) {
  445. if (port != null) {
  446. atts.clear();
  447. addAreaAttributes(port);
  448. addTraitAttributes(port);
  449. addAttribute("rect", port.getViewArea());
  450. if (port.hasClip()) {
  451. addAttribute("clipped", "true");
  452. }
  453. startElement("regionViewport", atts);
  454. RegionReference region = port.getRegionReference();
  455. atts.clear();
  456. addAreaAttributes(region);
  457. addTraitAttributes(region);
  458. addAttribute("name", region.getRegionName());
  459. addAttribute("ctm", region.getCTM().toString());
  460. if (region.getRegionClass() == FO_REGION_BEFORE) {
  461. startElement("regionBefore", atts);
  462. renderRegion(region);
  463. endElement("regionBefore");
  464. } else if (region.getRegionClass() == FO_REGION_START) {
  465. startElement("regionStart", atts);
  466. renderRegion(region);
  467. endElement("regionStart");
  468. } else if (region.getRegionClass() == FO_REGION_BODY) {
  469. BodyRegion body = (BodyRegion)region;
  470. if (body.getColumnCount() != 1) {
  471. addAttribute("columnGap", body.getColumnGap());
  472. addAttribute("columnCount", body.getColumnCount());
  473. }
  474. startElement("regionBody", atts);
  475. renderBodyRegion(body);
  476. endElement("regionBody");
  477. } else if (region.getRegionClass() == FO_REGION_END) {
  478. startElement("regionEnd", atts);
  479. renderRegion(region);
  480. endElement("regionEnd");
  481. } else if (region.getRegionClass() == FO_REGION_AFTER) {
  482. startElement("regionAfter", atts);
  483. renderRegion(region);
  484. endElement("regionAfter");
  485. }
  486. endElement("regionViewport");
  487. }
  488. }
  489. @Override
  490. protected void startVParea(CTM ctm, Rectangle clippingRect) {
  491. //only necessary for graphical output
  492. }
  493. /** {@inheritDoc} */
  494. @Override
  495. protected void endVParea() {
  496. //only necessary for graphical output
  497. }
  498. /**
  499. * {@inheritDoc}
  500. * org.apache.fop.area.inline.InlineArea)
  501. */
  502. @Override
  503. protected void renderInlineAreaBackAndBorders(InlineArea area) {
  504. //only necessary for graphical output
  505. }
  506. /**
  507. * {@inheritDoc}
  508. */
  509. @Override
  510. protected void renderBeforeFloat(BeforeFloat bf) {
  511. startElement("beforeFloat");
  512. super.renderBeforeFloat(bf);
  513. endElement("beforeFloat");
  514. }
  515. /**
  516. * {@inheritDoc}
  517. */
  518. @Override
  519. protected void renderFootnote(Footnote footnote) {
  520. atts.clear();
  521. addAttribute("top-offset", footnote.getTop());
  522. startElement("footnote", atts);
  523. super.renderFootnote(footnote);
  524. endElement("footnote");
  525. }
  526. /**
  527. * {@inheritDoc}
  528. */
  529. @Override
  530. protected void renderMainReference(MainReference mr) {
  531. atts.clear();
  532. addAreaAttributes(mr);
  533. addTraitAttributes(mr);
  534. if (mr.getColumnCount() != 1) {
  535. addAttribute("columnGap", mr.getColumnGap());
  536. }
  537. startElement("mainReference", atts);
  538. Span span = null;
  539. List spans = mr.getSpans();
  540. for (int count = 0; count < spans.size(); count++) {
  541. span = (Span) spans.get(count);
  542. atts.clear();
  543. if (span.getColumnCount() != 1) {
  544. addAttribute("columnCount", span.getColumnCount());
  545. }
  546. addAreaAttributes(span);
  547. addTraitAttributes(span);
  548. startElement("span", atts);
  549. for (int c = 0; c < span.getColumnCount(); c++) {
  550. NormalFlow flow = span.getNormalFlow(c);
  551. renderFlow(flow);
  552. }
  553. endElement("span");
  554. }
  555. endElement("mainReference");
  556. }
  557. /**
  558. * {@inheritDoc}
  559. */
  560. @Override
  561. protected void renderFlow(NormalFlow flow) {
  562. // the normal flow reference area contains stacked blocks
  563. atts.clear();
  564. addAreaAttributes(flow);
  565. addTraitAttributes(flow);
  566. startElement("flow", atts);
  567. super.renderFlow(flow);
  568. endElement("flow");
  569. }
  570. /** {@inheritDoc} */
  571. @Override
  572. protected void renderReferenceArea(Block block) {
  573. handleBlockTraits(block);
  574. List children = block.getChildAreas();
  575. if (children != null) {
  576. renderBlocks(block, children);
  577. }
  578. }
  579. /** {@inheritDoc} */
  580. @Override
  581. protected void renderBlock(Block block) {
  582. atts.clear();
  583. addAreaAttributes(block);
  584. addTraitAttributes(block);
  585. int positioning = block.getPositioning();
  586. if (block instanceof BlockViewport) {
  587. BlockViewport bvp = (BlockViewport)block;
  588. boolean abspos = false;
  589. if (bvp.getPositioning() == Block.ABSOLUTE
  590. || bvp.getPositioning() == Block.FIXED) {
  591. abspos = true;
  592. }
  593. if (abspos) {
  594. addAttribute("left-position", bvp.getXOffset());
  595. addAttribute("top-position", bvp.getYOffset());
  596. }
  597. addAttribute("ctm", bvp.getCTM().toString());
  598. if (bvp.hasClip()) {
  599. addAttribute("clipped", "true");
  600. }
  601. } else {
  602. if (block.getXOffset() != 0) {
  603. addAttribute("left-offset", block.getXOffset());
  604. }
  605. if (block.getYOffset() != 0) {
  606. addAttribute("top-offset", block.getYOffset());
  607. }
  608. }
  609. switch (positioning) {
  610. case Block.RELATIVE:
  611. addAttribute("positioning", "relative");
  612. break;
  613. case Block.ABSOLUTE:
  614. addAttribute("positioning", "absolute");
  615. break;
  616. case Block.FIXED:
  617. addAttribute("positioning", "fixed");
  618. break;
  619. default: //nop
  620. }
  621. startElement("block", atts);
  622. super.renderBlock(block);
  623. endElement("block");
  624. }
  625. /**
  626. * {@inheritDoc}
  627. */
  628. @Override
  629. protected void renderLineArea(LineArea line) {
  630. atts.clear();
  631. addAreaAttributes(line);
  632. addTraitAttributes(line);
  633. startElement("lineArea", atts);
  634. super.renderLineArea(line);
  635. endElement("lineArea");
  636. }
  637. /**
  638. * {@inheritDoc}
  639. */
  640. @Override
  641. protected void renderInlineArea(InlineArea inlineArea) {
  642. atts.clear();
  643. if (inlineArea.getClass() == InlineArea.class) {
  644. // Generic inline area. This is implemented to allow the 0x0 "dummy"
  645. // area generated by fo:wrapper to pass its id.
  646. addAreaAttributes(inlineArea);
  647. addTraitAttributes(inlineArea);
  648. startElement("inline", atts);
  649. endElement("inline");
  650. } else {
  651. super.renderInlineArea(inlineArea);
  652. // calls specific renderers for Text, Space, Viewport, etc. etc.
  653. }
  654. }
  655. /**
  656. * {@inheritDoc}
  657. */
  658. @Override
  659. protected void renderInlineViewport(InlineViewport viewport) {
  660. atts.clear();
  661. addAreaAttributes(viewport);
  662. addTraitAttributes(viewport);
  663. addAttribute("offset", viewport.getOffset());
  664. addAttribute("pos", viewport.getContentPosition());
  665. if (viewport.hasClip()) {
  666. addAttribute("clip", "true");
  667. }
  668. startElement("viewport", atts);
  669. super.renderInlineViewport(viewport);
  670. endElement("viewport");
  671. }
  672. /**
  673. * {@inheritDoc}
  674. */
  675. @Override
  676. public void renderImage(Image image, Rectangle2D pos) {
  677. atts.clear();
  678. addAreaAttributes(image);
  679. addTraitAttributes(image);
  680. addAttribute("url", image.getURL());
  681. //addAttribute("pos", pos);
  682. startElement("image", atts);
  683. endElement("image");
  684. }
  685. /**
  686. * {@inheritDoc}
  687. */
  688. @Override
  689. public void renderContainer(Container cont) {
  690. startElement("container");
  691. super.renderContainer(cont);
  692. endElement("container");
  693. }
  694. /**
  695. * Renders an fo:foreing-object.
  696. * @param fo the foreign object
  697. * @param pos the position of the foreign object
  698. * @see org.apache.fop.render.AbstractRenderer#renderForeignObject(ForeignObject, Rectangle2D)
  699. */
  700. @Override
  701. public void renderForeignObject(ForeignObject fo, Rectangle2D pos) {
  702. atts.clear();
  703. addAreaAttributes(fo);
  704. addTraitAttributes(fo);
  705. String ns = fo.getNameSpace();
  706. addAttribute("ns", ns);
  707. startElement("foreignObject", atts);
  708. Document doc = fo.getDocument();
  709. context.setProperty(XMLXMLHandler.HANDLER, handler);
  710. renderXML(context, doc, ns);
  711. endElement("foreignObject");
  712. }
  713. /**
  714. * {@inheritDoc}
  715. */
  716. @Override
  717. protected void renderInlineSpace(Space space) {
  718. atts.clear();
  719. addAreaAttributes(space);
  720. addTraitAttributes(space);
  721. addAttribute("offset", space.getOffset());
  722. startElement("space", atts);
  723. endElement("space");
  724. }
  725. /**
  726. * {@inheritDoc}
  727. */
  728. @Override
  729. protected void renderText(TextArea text) {
  730. atts.clear();
  731. if (text.getTextWordSpaceAdjust() != 0) {
  732. addAttribute("twsadjust", text.getTextWordSpaceAdjust());
  733. }
  734. if (text.getTextLetterSpaceAdjust() != 0) {
  735. addAttribute("tlsadjust", text.getTextLetterSpaceAdjust());
  736. }
  737. addAttribute("offset", text.getOffset());
  738. addAttribute("baseline", text.getBaselineOffset());
  739. addAreaAttributes(text);
  740. addTraitAttributes(text);
  741. startElement("text", atts);
  742. super.renderText(text);
  743. endElement("text");
  744. }
  745. /**
  746. * {@inheritDoc}
  747. */
  748. @Override
  749. protected void renderWord(WordArea word) {
  750. atts.clear();
  751. addAttribute("offset", word.getOffset());
  752. int[] letterAdjust = word.getLetterAdjustArray();
  753. if (letterAdjust != null) {
  754. StringBuffer sb = new StringBuffer(64);
  755. boolean nonZeroFound = false;
  756. for (int i = 0, c = letterAdjust.length; i < c; i++) {
  757. if (i > 0) {
  758. sb.append(' ');
  759. }
  760. sb.append(letterAdjust[i]);
  761. nonZeroFound |= (letterAdjust[i] != 0);
  762. }
  763. if (nonZeroFound) {
  764. addAttribute("letter-adjust", sb.toString());
  765. }
  766. }
  767. startElement("word", atts);
  768. characters(word.getWord());
  769. endElement("word");
  770. super.renderWord(word);
  771. }
  772. /**
  773. * {@inheritDoc}
  774. */
  775. @Override
  776. protected void renderSpace(SpaceArea space) {
  777. atts.clear();
  778. addAttribute("offset", space.getOffset());
  779. if (!space.isAdjustable()) {
  780. addAttribute("adj", "false"); //default is true
  781. }
  782. startElement("space", atts);
  783. characters(space.getSpace());
  784. endElement("space");
  785. super.renderSpace(space);
  786. }
  787. /**
  788. * {@inheritDoc}
  789. */
  790. @Override
  791. protected void renderInlineParent(InlineParent ip) {
  792. atts.clear();
  793. addAreaAttributes(ip);
  794. addTraitAttributes(ip);
  795. addAttribute("offset", ip.getOffset());
  796. startElement("inlineparent", atts);
  797. super.renderInlineParent(ip);
  798. endElement("inlineparent");
  799. }
  800. /**
  801. * {@inheritDoc}
  802. */
  803. @Override
  804. protected void renderInlineBlockParent(InlineBlockParent ibp) {
  805. atts.clear();
  806. addAreaAttributes(ibp);
  807. addTraitAttributes(ibp);
  808. addAttribute("offset", ibp.getOffset());
  809. startElement("inlineblockparent", atts);
  810. super.renderInlineBlockParent(ibp);
  811. endElement("inlineblockparent");
  812. }
  813. /**
  814. * {@inheritDoc}
  815. */
  816. @Override
  817. protected void renderLeader(Leader area) {
  818. atts.clear();
  819. addAreaAttributes(area);
  820. addTraitAttributes(area);
  821. addAttribute("offset", area.getOffset());
  822. addAttribute("ruleStyle", area.getRuleStyleAsString());
  823. addAttribute("ruleThickness", area.getRuleThickness());
  824. startElement("leader", atts);
  825. endElement("leader");
  826. super.renderLeader(area);
  827. }
  828. /** {@inheritDoc} */
  829. public String getMimeType() {
  830. return XML_MIME_TYPE;
  831. }
  832. }