You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by je...@apache.org on 2008/05/05 09:00:40 UTC

svn commit: r653319 - in /xmlgraphics/site/deploy/fop: skin/images/Thumbs.db trunk/events.html trunk/events.pdf trunk/events.xml

Author: jeremias
Date: Mon May  5 00:00:40 2008
New Revision: 653319

URL: http://svn.apache.org/viewvc?rev=653319&view=rev
Log:
Publish from forrestbot

Added:
    xmlgraphics/site/deploy/fop/skin/images/Thumbs.db   (with props)
    xmlgraphics/site/deploy/fop/trunk/events.html   (with props)
    xmlgraphics/site/deploy/fop/trunk/events.pdf   (with props)
    xmlgraphics/site/deploy/fop/trunk/events.xml   (with props)

Added: xmlgraphics/site/deploy/fop/skin/images/Thumbs.db
URL: http://svn.apache.org/viewvc/xmlgraphics/site/deploy/fop/skin/images/Thumbs.db?rev=653319&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/site/deploy/fop/skin/images/Thumbs.db
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: xmlgraphics/site/deploy/fop/trunk/events.html
URL: http://svn.apache.org/viewvc/xmlgraphics/site/deploy/fop/trunk/events.html?rev=653319&view=auto
==============================================================================
--- xmlgraphics/site/deploy/fop/trunk/events.html (added)
+++ xmlgraphics/site/deploy/fop/trunk/events.html Mon May  5 00:00:40 2008
@@ -0,0 +1,687 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta content="Apache Forrest" name="Generator">
+<meta name="Forrest-version" content="0.9-dev">
+<meta name="Forrest-skin-name" content="pelt">
+<title>Events/Processing Feedback</title>
+<link type="text/css" href="../skin/basic.css" rel="stylesheet">
+<link media="screen" type="text/css" href="../skin/screen.css" rel="stylesheet">
+<link media="print" type="text/css" href="../skin/print.css" rel="stylesheet">
+<link type="text/css" href="../skin/profile.css" rel="stylesheet">
+<script src="../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../skin/fontsize.js" language="javascript" type="text/javascript"></script>
+<link rel="shortcut icon" href="../">
+</head>
+<body onload="init()">
+<script type="text/javascript">ndeSetTextSize();</script>
+<div id="top">
+<!--+
+    |header
+    +-->
+<div class="header">
+<!--+
+    |start group logo
+    +-->
+<div class="grouplogo">
+<a href="http://xmlgraphics.apache.org/"><img class="logoImage" alt="Apache XML Graphics" src="../images/group-logo.gif" title="Apache XML Graphics is responsible for the creation and maintenance of software for managing the conversion of XML formats to graphical output, and the creation and maintenance of related software components, based on software licensed to the Foundation"></a>
+</div>
+<!--+
+    |end group logo
+    +-->
+<!--+
+    |start Project Logo
+    +-->
+<div class="projectlogo">
+<a href="http://xmlgraphics.apache.org/fop/"><img class="logoImage" alt="Apache FOP" src="../images/logo.jpg" title="Apache FOP (Formatting Objects Processor) is the world's first output independent formatter. Output formats currently supported include PDF, PCL, PS, SVG, XML (area tree representation), Print, AWT, MIF and TXT. The primary output target is PDF."></a>
+</div>
+<!--+
+    |end Project Logo
+    +-->
+<!--+
+    |start Search
+    +-->
+<div class="searchbox">
+<form action="http://www.google.com/search" method="get" class="roundtopsmall">
+<input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google">&nbsp; 
+                    <input name="Search" value="Search" type="submit">
+</form>
+</div>
+<!--+
+    |end search
+    +-->
+<!--+
+    |start Tabs
+    +-->
+<ul id="tabs">
+<li>
+<a class="unselected" href="../index.html">Home</a>
+</li>
+<li>
+<a class="unselected" href="../0.94/index.html">Version 0.94</a>
+</li>
+<li>
+<a class="unselected" href="../0.95/index.html">Version 0.95beta</a>
+</li>
+<li class="current">
+<a class="selected" href="../trunk/index.html">FOP Trunk</a>
+</li>
+<li>
+<a class="unselected" href="../dev/index.html">Development</a>
+</li>
+</ul>
+<!--+
+    |end Tabs
+    +-->
+</div>
+</div>
+<div id="main">
+<div id="publishedStrip">
+<!--+
+    |start Subtabs
+    +-->
+<div id="level2tabs"></div>
+<!--+
+    |end Endtabs
+    +-->
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+//  --></script>
+</div>
+<!--+
+    |breadtrail
+    +-->
+<div class="breadtrail">
+<a href="http://www.apache.org/">apache.org</a> &gt; <a href="http://xml.apache.org/">XML Federation</a> &gt; <a href="http://xmlgraphics.apache.org/">xmlgraphics.apache.org</a><script src="../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
+</div>
+<!--+
+    |start Menu, mainarea
+    +-->
+<!--+
+    |start Menu
+    +-->
+<div id="menu">
+<div onclick="SwitchMenu('menu_selected_1.1', '../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">FOP Trunk (dev)</div>
+<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a href="../trunk/index.html">About</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/upgrading.html">Upgrading</a>
+</div>
+<div onclick="SwitchMenu('menu_1.1.3', '../skin/')" id="menu_1.1.3Title" class="menutitle">Using FOP</div>
+<div id="menu_1.1.3" class="menuitemgroup">
+<div class="menuitem">
+<a href="../trunk/compiling.html">Build</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/configuration.html">Configure</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/running.html">Run</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/embedding.html">Embed</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/servlets.html">Servlets</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/anttask.html">Ant Task</a>
+</div>
+</div>
+<div onclick="SwitchMenu('menu_selected_1.1.4', '../skin/')" id="menu_selected_1.1.4Title" class="menutitle" style="background-image: url('../skin/images/chapter_open.gif');">Features</div>
+<div id="menu_selected_1.1.4" class="selectedmenuitemgroup" style="display: block;">
+<div class="menuitem">
+<a href="../trunk/output.html">Output Targets</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/intermediate.html">Intermediate Format</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/pdfencryption.html">PDF Encryption</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/pdfa.html">PDF/A</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/pdfx.html">PDF/X</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/graphics.html">Graphics</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/fonts.html">Fonts</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/hyphenation.html">Hyphenation</a>
+</div>
+<div class="menuitem">
+<a href="../trunk/extensions.html">Extensions</a>
+</div>
+<div class="menupage">
+<div class="menupagetitle">Events</div>
+</div>
+</div>
+</div>
+<div id="credit"></div>
+<div id="roundbottom">
+<img style="display: none" class="corner" height="15" width="15" alt="" src="../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
+<!--+
+  |alternative credits
+  +-->
+<div id="credit2">
+<a href="http://eu.apachecon.com/"><img border="0" title="ApacheCon Europe 2008" alt="ApacheCon Europe 2008 - logo" src="http://apache.org/ads/ApacheCon/2008-europe-125x125.png" style="width: 125px;height: 125px;"></a><a href="http://us.apachecon.com/"><img border="0" title="ApacheCon US 2008" alt="ApacheCon US 2008 - logo" src="http://apache.org/ads/ApacheCon/2008-usa-125x125.png" style="width: 125px;height: 125px;"></a>
+</div>
+</div>
+<!--+
+    |end Menu
+    +-->
+<!--+
+    |start content
+    +-->
+<div id="content">
+<div title="raw XML" class="xmllink">
+<a class="dida" href="events.xml"><img alt="XML - icon" src="../skin/images/xmldoc.gif" class="skin"><br>
+        XML</a>
+</div>
+<div title="Portable Document Format" class="pdflink">
+<a class="dida" href="events.pdf"><img alt="PDF -icon" src="../skin/images/pdfdoc.gif" class="skin"><br>
+        PDF</a>
+</div>
+<div class="trail">Font size: 
+	          &nbsp;<input value="Reset" class="resetfont" title="Reset text" onclick="ndeSetTextSize('reset'); return false;" type="button">      
+	          &nbsp;<input value="-a" class="smallerfont" title="Shrink text" onclick="ndeSetTextSize('decr'); return false;" type="button">
+	          &nbsp;<input value="+a" class="biggerfont" title="Enlarge text" onclick="ndeSetTextSize('incr'); return false;" type="button">
+</div>
+<h1>Events/Processing Feedback</h1>
+<div id="front-matter">
+<div id="minitoc-area">
+<ul class="minitoc">
+<li>
+<a href="#introduction">Introduction</a>
+</li>
+<li>
+<a href="#consumer">The consumer side</a>
+<ul class="minitoc">
+<li>
+<a href="#write-listener">Writing an EventListener</a>
+</li>
+<li>
+<a href="#add-listener">Adding an EventListener</a>
+</li>
+<li>
+<a href="#listener-example1">An additional listener example</a>
+</li>
+</ul>
+</li>
+<li>
+<a href="#producer">The producer side (for FOP developers)</a>
+<ul class="minitoc">
+<li>
+<a href="#basic-event-production">Producing and sending an event</a>
+</li>
+<li>
+<a href="#event-producer">The EventProducer interface</a>
+</li>
+<li>
+<a href="#event-model">The event model</a>
+</li>
+<li>
+<a href="#event-severity">Event severity</a>
+</li>
+<li>
+<a href="#plug-ins">Plug-ins to the event subsystem</a>
+</li>
+<li>
+<a href="#l10n">Localization (L10n)</a>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+    
+<a name="N10011"></a><a name="introduction"></a>
+<h2 class="underlined_10">Introduction</h2>
+<div class="section">
+<p>
+        In versions until 0.20.5, FOP used
+        <a class="external" href="http://excalibur.apache.org/framework/index.html">Avalon-style Logging</a> where
+        it was possible to supply a logger per processing run. During the redesign
+        the logging infrastructure was switched over to
+        <a class="external" href="http://commons.apache.org/logging/">Commons Logging</a> which is (like Log4J or
+        java.util.logging) a "static" logging framework (the logger is accessed through static
+        variables). This made it very difficult in a multi-threaded system to retrieve information
+        for a single processing run.
+      </p>
+<p>
+        With FOP's event subsystem, we'd like to close this gap again and even go further. The
+        first point is to realize that we have two kinds of "logging". Firstly, we have the logging
+        infrastructure for the (FOP) developer who needs to be able to enable finer log messages
+        for certain parts of FOP to track down a certain problem. Secondly, we have the user who
+        would like to be informed about missing images, overflowing lines or substituted fonts.
+        These messages (or events) are targeted at less technical people and may ideally be
+        localized (translated). Furthermore, tool and solution builders would like to integrate
+        FOP into their own solutions. For example, an FO editor should be able to point the user
+        to the right place where a particular problem occurred while developing a document template.
+        Finally, some integrators would like to abort processing if a resource (an image or a font)
+        has not been found, while others would simply continue. The event system allows to
+        react on these events.
+      </p>
+<p>
+        On this page, we won't discuss logging as such. We will show how the event subsystem can
+        be used for various tasks. We'll first look at the event subsystem from the consumer side.
+        Finally, the production of events inside FOP will be discussed (this is mostly interesting
+        for FOP developers only).
+      </p>
+</div>
+    
+<a name="N10029"></a><a name="consumer"></a>
+<h2 class="underlined_10">The consumer side</h2>
+<div class="section">
+<p>
+        The event subsystem is located in the <span class="codefrag">org.apache.fop.events</span> package and its
+        base is the <span class="codefrag">Event</span> class. An instance is created for each event and is sent
+        to a set of <span class="codefrag">EventListener</span> instances by the <span class="codefrag">EventBroadcaster</span>.
+        An <span class="codefrag">Event</span> contains:
+      </p>
+<ul>
+        
+<li>an event ID,</li>
+        
+<li>a source object (which generated the event),</li>
+        
+<li>a severity level (Info, Warning, Error and Fatal Error) and</li>
+        
+<li>a map of named parameters.</li>
+      
+</ul>
+<p>
+        The <span class="codefrag">EventFormatter</span> class can be used to translate the events into
+        human-readable, localized messages.
+      </p>
+<p>
+        A full example of what is shown here can be found in the
+        <span class="codefrag">examples/embedding/java/embedding/events</span> directory in the FOP distribution.
+        The example can also be accessed
+        <a class="external" href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/events/">via the web</a>.
+      </p>
+<a name="N10060"></a><a name="write-listener"></a>
+<h3 class="underlined_5">Writing an EventListener</h3>
+<p>
+          The following code sample shows a very simple EventListener. It basically just sends
+          all events to System.out (stdout) or System.err (stderr) depending on the event severity.
+        </p>
+<pre class="code">import org.apache.fop.events.Event;
+import org.apache.fop.events.EventFormatter;
+import org.apache.fop.events.EventListener;
+import org.apache.fop.events.model.EventSeverity;
+
+/** A simple event listener that writes the events to stdout and stderr. */
+public class SysOutEventListener implements EventListener {
+
+    /** {@inheritDoc} */
+    public void processEvent(Event event) {
+        String msg = EventFormatter.format(event);
+        EventSeverity severity = event.getSeverity();
+        if (severity == EventSeverity.INFO) {
+            System.out.println("[INFO ] " + msg);
+        } else if (severity == EventSeverity.WARN) {
+            System.out.println("[WARN ] " + msg);
+        } else if (severity == EventSeverity.ERROR) {
+            System.err.println("[ERROR] " + msg);
+        } else if (severity == EventSeverity.FATAL) {
+            System.err.println("[FATAL] " + msg);
+        } else {
+            assert false;
+        }
+    }
+}</pre>
+<p>
+          You can see that for every event the method <span class="codefrag">processEvent</span> of the
+          <span class="codefrag">EventListener</span> will be called. Inside this method you can do whatever
+          processing you would like including throwing a <span class="codefrag">RuntimeException</span>, if you want
+          to abort the current processing run.
+        </p>
+<p>
+          The code above also shows how you can turn an event into a human-readable, localized
+          message that can be presented to a user. The <span class="codefrag">EventFormatter</span> class does
+          this for you. It provides additional methods if you'd like to explicitly specify
+          the locale.
+        </p>
+<p>
+          It is possible to gather all events for a whole processing run so they can be
+          evaluated afterwards. However, care should be taken about memory consumption since
+          the events provide references to objects inside FOP which may themselves have
+          references to other objects. So holding on to these objects may mean that whole
+          object trees cannot be released!
+        </p>
+<a name="N10083"></a><a name="add-listener"></a>
+<h3 class="underlined_5">Adding an EventListener</h3>
+<p>
+          To register the event listener with FOP, get the <span class="codefrag">EventBroadcaster</span> which
+          is associated with the user agent (<span class="codefrag">FOUserAgent</span>) and add it there:
+        </p>
+<pre class="code">FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
+foUserAgent.getEventBroadcaster().addEventListener(new SysOutEventListener());</pre>
+<p>
+          Please note that this is done separately for each processing run, i.e. for each
+          new user agent.
+        </p>
+<a name="N1009A"></a><a name="listener-example1"></a>
+<h3 class="underlined_5">An additional listener example</h3>
+<p>
+          Here's an additional example of an event listener:
+        </p>
+<p>
+          By default, FOP continues processing even if an image wasn't found. If you have
+          more strict requirements and want FOP to stop if an image is not available, you can
+          do something like the following:
+        </p>
+<pre class="code">public class MyEventListener implements EventListener {
+
+    public void processEvent(Event event) {
+        if ("org.apache.fop.events.ResourceEventProducer.imageNotFound"
+                .equals(event.getEventID())) {
+            
+            //Get the FileNotFoundException that's part of the event's parameters
+            FileNotFoundException fnfe = (FileNotFoundException)event.getParam("fnfe");
+
+            throw new RuntimeException(EventFormatter.format(event), fnfe);
+        } else {
+            //ignore all other events (or do something of your choice)
+        }
+    }
+    
+}</pre>
+<p>
+          This throws a <span class="codefrag">RuntimeException</span> with the <span class="codefrag">FileNotFoundException</span>
+          as the cause. Further processing effectively stops in FOP. You can catch the exception
+          in your code and react as you see necessary.
+        </p>
+</div>
+    
+<a name="N100B5"></a><a name="producer"></a>
+<h2 class="underlined_10">The producer side (for FOP developers)</h2>
+<div class="section">
+<p>
+        This section is primarily for FOP and FOP plug-in developers. It describes how to use
+        the event subsystem for producing events.
+      </p>
+<div class="note">
+<div class="label">Note</div>
+<div class="content">
+        The event package has been designed in order to be theoretically useful for use cases
+        outside FOP. If you think this is interesting independently from FOP, please talk to
+        <a href="mailto:fop-dev.at.xmlgraphics.apache.org">us</a>.
+      </div>
+</div>
+<a name="N100C5"></a><a name="basic-event-production"></a>
+<h3 class="underlined_5">Producing and sending an event</h3>
+<p>
+          The basics are very simple. Just instantiate an <span class="codefrag">Event</span> object and fill
+          it with the necessary parameters. Then pass it to the <span class="codefrag">EventBroadcaster</span>
+          which distributes the events to the interested listeneners. Here's a code example:
+        </p>
+<pre class="code">Event ev = new Event(this, "complain", EventSeverity.WARN,
+        Event.paramsBuilder()
+            .param("reason", "I'm tired")
+            .param("blah", new Integer(23))
+            .build());
+EventBroadcaster broadcaster = [get it from somewhere];
+broadcaster.broadcastEvent(ev);
+</pre>
+<p>
+          The <span class="codefrag">Event.paramsBuilder()</span> is a
+          <a class="external" href="http://en.wikipedia.org/wiki/Fluent_interface">fluent interface</a>
+          to help with the build-up of the parameters. You could just as well instantiate a
+          <span class="codefrag">Map</span> (<span class="codefrag">Map&lt;String, Object&gt;</span>) and fill it with values.
+        </p>
+<a name="N100E9"></a><a name="event-producer"></a>
+<h3 class="underlined_5">The EventProducer interface</h3>
+<p>
+          To simplify event production, the event subsystem provides the <span class="codefrag">EventProducer</span>
+          interface. You can create interfaces which extend <span class="codefrag">EventProducer</span>. These
+          interfaces will contain one method per event to be generated. By contract, each event
+          method must have as its first parameter a parameter named "source" (Type Object) which
+          indicates the object that generated the event. After that come an arbitrary number of
+          parameters of any type as needed by the event.
+        </p>
+<p>
+          The event producer interface does not need to have any implementation. The implementation
+          is produced at runtime by a dynamic proxy created by <span class="codefrag">DefaultEventBroadcaster</span>.
+          The dynamic proxy creates <span class="codefrag">Event</span> instances for each method call against
+          the event producer interface. Each parameter (except "source") is added to the event's
+          parameter map.
+        </p>
+<p>
+          To simplify the code needed to get an instance of the event producer interface it is
+          suggested to create a public inner provider class inside the interface.
+        </p>
+<p>
+          Here's an example of such an event producer interface:
+        </p>
+<pre class="code">public interface MyEventProducer extends EventProducer {
+
+    public class Provider {
+        
+        public static MyEventProducer get(EventBroadcaster broadcaster) {
+            return (MyEventProducer)broadcaster.getEventProducerFor(MyEventProducer.class);
+        }
+    }
+
+    /**
+     * Complain about something.
+     * @param source the event source
+     * @param reason the reason for the complaint
+     * @param blah the complaint
+     * @event.severity WARN
+     */
+    void complain(Object source, String reason, int blah);
+    
+}</pre>
+<p>
+          To produce the same event as in the first example above, you'd use the following code:
+        </p>
+<pre class="code">EventBroadcaster broadcaster = [get it from somewhere];
+TestEventProducer producer = TestEventProducer.Provider.get(broadcaster);
+producer.complain(this, "I'm tired", 23);</pre>
+<a name="N10113"></a><a name="event-model"></a>
+<h3 class="underlined_5">The event model</h3>
+<p>
+          Inside an invocation handler for a dynamic proxy, there's no information about
+          the names of each parameter. The JVM doesn't provide it. The only thing you know is
+          the interface and method name. In order to properly fill the <span class="codefrag">Event</span>'s
+          parameter map we need to know the parameter names. These are retrieved from an
+          event object model. This is found in the <span class="codefrag">org.apache.fop.events.model</span>
+          package. The data for the object model is retrieved from an XML representation of the
+          event model that is loaded as a resource. The XML representation is generated using an
+          Ant task at build time (<span class="codefrag">ant resourcegen</span>). The Ant task (found in
+          <span class="codefrag">src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java</span>)
+          scans FOP's sources for descendants of the <span class="codefrag">EventProducer</span> interface and
+          uses <a class="external" href="http://qdox.codehaus.org/">QDox</a> to parse these interfaces.
+        </p>
+<p>
+          The event model XML files are generated during build by the Ant task mentioned above when
+          running the "resourcegen" task. So just run <span class="codefrag">"ant resourcegen"</span> if you receive
+          a <span class="codefrag">MissingResourceException</span> at runtime indicating that
+          <span class="codefrag">"event-model.xml"</span> is missing.
+        </p>
+<p>
+          Primarily, the QDox-based collector task records the parameters' names and types.
+          Furthermore, it extracts additional attributes embedded as Javadoc comments from
+          the methods. At the moment, the only such attribute is "@event.severity" which indicates
+          the default event severity (which can be changed by event listeners). The example event
+          producer above shows the Javadocs for an event method.
+        </p>
+<p>
+          There's one more information that is extracted from the event producer information for
+          the event model: an optional primary exception. The first exception in the "throws"
+          declaration of an event method is noted. It is used to throw an exception from
+          the invocation handler if the event has an event severity of "FATAL" when all
+          listeners have been called (listeners can update the event severity). Please note
+          that an implementation of
+          <span class="codefrag">org.apache.fop.events.EventExceptionManager$ExceptionFactory</span> has to be
+          registered for the <span class="codefrag">EventExceptionManager</span> to be able to construct the
+          exception from an event.
+        </p>
+<p>
+          For a given application, there can be multiple event models active at the same time.
+          In FOP, each renderer is considered to be a plug-in and provides its own specific
+          event model. The individual event models are provided through an
+          <span class="codefrag">EventModelFactory</span>. This interface is implemented for each event model
+          and registered through the service provider mechanism
+          (see the <a href="#plug-ins">plug-ins section</a> for details).
+        </p>
+<a name="N10152"></a><a name="event-severity"></a>
+<h3 class="underlined_5">Event severity</h3>
+<p>
+          Four different levels of severity for events has been defined:
+        </p>
+<ol>
+          
+<li>INFO: informational only</li>
+          
+<li>WARN: a Warning</li>
+          
+<li>ERROR: an error condition from which FOP can recover. FOP will continue processing.</li>
+          
+<li>FATAL: a fatal error which causes an exception in the end and FOP will stop processing.</li>
+        
+</ol>
+<p>
+          Event listeners can choose to ignore certain events based on their event severity.
+          Please note that you may recieve an event "twice" in a specific case: if there is
+          a fatal error an event is generated and sent to the listeners. After that an exception
+          is thrown with the same information and processing stops. If the fatal event is
+          shown to the user and the following exception is equally presented to the user it
+          may appear that the event is duplicated. Of course, the same information is just
+          published through two different channels.
+        </p>
+<a name="N1016E"></a><a name="plug-ins"></a>
+<h3 class="underlined_5">Plug-ins to the event subsystem</h3>
+<p>
+          The event subsystem is extensible. There are a number of extension points:
+        </p>
+<ul>
+          
+<li>
+            
+<strong><span class="codefrag">org.apache.fop.events.model.EventModelFactory</span>:</strong> Provides
+            an event model to the event subsystem.
+          </li>
+          
+<li>
+            
+<strong><span class="codefrag">org.apache.fop.events.EventExceptionManager$ExceptionFactory</span>:</strong>
+            Creates exceptions for events, i.e. turns an event into a specific exception.
+          </li>
+        
+</ul>
+<p>
+          The names in bold above are used as filenames for the service provider files that
+          are placed in the <span class="codefrag">META-INF/services</span> directory. That way, they are
+          automatically detected. This is a mechanism defined by the
+          <a class="external" href="http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service%20Provider">JAR file specification</a>.
+        </p>
+<a name="N10195"></a><a name="l10n"></a>
+<h3 class="underlined_5">Localization (L10n)</h3>
+<p>
+          One goal of the event subsystem was to have localized (translated) event messages.
+          The <span class="codefrag">EventFormatter</span> class can be used to convert an event to a
+          human-readable message. Each <span class="codefrag">EventProducer</span> can provide its own XML-based
+          translation file. If there is none, a central translation file is used, called
+          "EventFormatter.xml" (found in the same directory as the <span class="codefrag">EventFormatter</span>
+          class).
+        </p>
+<p>
+          The XML format used by the <span class="codefrag">EventFormatter</span> is the same as
+          <a class="external" href="http://cocoon.apache.org/">Apache Cocoon's</a> catalog format. Here's an example:
+        </p>
+<pre class="code">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;catalogue xml:lang="en"&gt;
+  &lt;message key="locator"&gt;
+    [ (See position {loc})| (See {#gatherContextInfo})| (No context info available)]
+  &lt;/message&gt;
+  &lt;message key="org.apache.fop.render.rtf.RTFEventProducer.explicitTableColumnsRequired"&gt;
+    RTF output requires that all table-columns for a table are defined. Output will be incorrect.{{locator}}
+  &lt;/message&gt;
+  &lt;message key="org.apache.fop.render.rtf.RTFEventProducer.ignoredDeferredEvent"&gt;
+    Ignored deferred event for {node} ({start,if,start,end}).{{locator}}
+  &lt;/message&gt;
+&lt;/catalogue&gt;
+</pre>
+<p>
+          The example (extracted from the RTF handler's event producer) has message templates for
+          two event methods. The class used to do variable replacement in the templates is
+          <span class="codefrag">org.apache.fop.util.text.AdvancedMessageFormat</span> which is more powerful
+          than the <span class="codefrag">MessageFormat</span> classes provided by the Java class library
+          (<span class="codefrag">java.util.text</span> package).
+        </p>
+<p>
+          "locator" is a template that is reused by the other message templates
+          by referencing it through "{{locator}}". This is some kind of include command.
+        </p>
+<p>
+          Normal event parameters are accessed by name inside single curly braces, for example:
+          "{node}". For objects, this format just uses the <span class="codefrag">toString()</span> method to turn
+          the object into a string, unless there is an <span class="codefrag">ObjectFormatter</span> registered
+          for that type (there's an example for <span class="codefrag">org.xml.sax.Locator</span>).
+        </p>
+<p>
+          The single curly braces pattern supports additional features. For example, it is possible
+          to do this: "{start,if,start,end}". "if" here is a special field modifier that evaluates
+          "start" as a boolean and if that is true returns the text right after the second comma
+          ("start"). Otherwise it returns the text after the third comma ("end"). The "equals"
+          modifier is similar to "if" but it takes as an additional (comma-separated) parameter
+          right after the "equals" modifier, a string that is compared to the value of the variable.
+          An example: {severity,equals,EventSeverity:FATAL,,some text} (this adds "some text" if
+          the severity is not FATAL).
+        </p>
+<p>
+          Additional such modifiers can be added by implementing the
+          <span class="codefrag">AdvancedMessageFormat$Part</span> and <span class="codefrag">AdvancedMessageFormat$PartFactory</span>
+          interfaces.
+        </p>
+<p>
+          Square braces can be used to specify optional template sections. The whole section will
+          be omitted if any of the variables used within are unavailable. Pipe (|) characters can
+          be used to specify alternative sub-templates (see "locator" above for an example).
+        </p>
+<p>
+          Developers can also register a function (in the above example:
+          <span class="codefrag">{#gatherContextInfo})</span>
+          to do more complex information rendering. These functions are implementations of the
+          <span class="codefrag">AdvancedMessageFormat$Function</span> interface. Please take care that this is
+          done in a locale-independent way as there is no locale information available, yet.
+        </p>
+</div>
+  
+<span class="version">
+          version 634267</span>
+</div>
+<!--+
+    |end content
+    +-->
+<div class="clearboth">&nbsp;</div>
+</div>
+<div id="footer">
+<!--+
+    |start bottomstrip
+    +-->
+<div class="lastmodified">
+<script type="text/javascript"><!--
+document.write("Last Published: " + document.lastModified);
+//  --></script>
+</div>
+<div class="copyright">
+        Copyright &copy;
+         1999-2008 <a href="http://www.apache.org/licenses/">The Apache Software Foundation.</a>
+</div>
+<!--+
+    |end bottomstrip
+    +-->
+</div>
+</body>
+</html>

Propchange: xmlgraphics/site/deploy/fop/trunk/events.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: xmlgraphics/site/deploy/fop/trunk/events.pdf
URL: http://svn.apache.org/viewvc/xmlgraphics/site/deploy/fop/trunk/events.pdf?rev=653319&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/site/deploy/fop/trunk/events.pdf
------------------------------------------------------------------------------
    svn:mime-type = application/pdf

Added: xmlgraphics/site/deploy/fop/trunk/events.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/site/deploy/fop/trunk/events.xml?rev=653319&view=auto
==============================================================================
--- xmlgraphics/site/deploy/fop/trunk/events.xml (added)
+++ xmlgraphics/site/deploy/fop/trunk/events.xml Mon May  5 00:00:40 2008
@@ -0,0 +1,425 @@
+<?xml version="1.0" encoding="ISO-8859-1"?><!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+--><!-- $Id$ --><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd">
+<document>
+  <header>
+    <title>Events/Processing Feedback</title>
+    <version>$Revision: 634267 $</version>
+  </header>
+  <body>
+    <section id="introduction">
+      <title>Introduction</title>
+      <p>
+        In versions until 0.20.5, FOP used
+        <link href="http://excalibur.apache.org/framework/index.html">Avalon-style Logging</link> where
+        it was possible to supply a logger per processing run. During the redesign
+        the logging infrastructure was switched over to
+        <link href="http://commons.apache.org/logging/">Commons Logging</link> which is (like Log4J or
+        java.util.logging) a "static" logging framework (the logger is accessed through static
+        variables). This made it very difficult in a multi-threaded system to retrieve information
+        for a single processing run.
+      </p>
+      <p>
+        With FOP's event subsystem, we'd like to close this gap again and even go further. The
+        first point is to realize that we have two kinds of "logging". Firstly, we have the logging
+        infrastructure for the (FOP) developer who needs to be able to enable finer log messages
+        for certain parts of FOP to track down a certain problem. Secondly, we have the user who
+        would like to be informed about missing images, overflowing lines or substituted fonts.
+        These messages (or events) are targeted at less technical people and may ideally be
+        localized (translated). Furthermore, tool and solution builders would like to integrate
+        FOP into their own solutions. For example, an FO editor should be able to point the user
+        to the right place where a particular problem occurred while developing a document template.
+        Finally, some integrators would like to abort processing if a resource (an image or a font)
+        has not been found, while others would simply continue. The event system allows to
+        react on these events.
+      </p>
+      <p>
+        On this page, we won't discuss logging as such. We will show how the event subsystem can
+        be used for various tasks. We'll first look at the event subsystem from the consumer side.
+        Finally, the production of events inside FOP will be discussed (this is mostly interesting
+        for FOP developers only).
+      </p>
+    </section>
+    <section id="consumer">
+      <title>The consumer side</title>
+      <p>
+        The event subsystem is located in the <code>org.apache.fop.events</code> package and its
+        base is the <code>Event</code> class. An instance is created for each event and is sent
+        to a set of <code>EventListener</code> instances by the <code>EventBroadcaster</code>.
+        An <code>Event</code> contains:
+      </p>
+      <ul>
+        <li>an event ID,</li>
+        <li>a source object (which generated the event),</li>
+        <li>a severity level (Info, Warning, Error and Fatal Error) and</li>
+        <li>a map of named parameters.</li>
+      </ul>
+      <p>
+        The <code>EventFormatter</code> class can be used to translate the events into
+        human-readable, localized messages.
+      </p>
+      <p>
+        A full example of what is shown here can be found in the
+        <code>examples/embedding/java/embedding/events</code> directory in the FOP distribution.
+        The example can also be accessed
+        <link href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/events/">via the web</link>.
+      </p>
+      <section id="write-listener">
+        <title>Writing an EventListener</title>
+        <p>
+          The following code sample shows a very simple EventListener. It basically just sends
+          all events to System.out (stdout) or System.err (stderr) depending on the event severity.
+        </p>
+        <source xml:space="preserve"><![CDATA[import org.apache.fop.events.Event;
+import org.apache.fop.events.EventFormatter;
+import org.apache.fop.events.EventListener;
+import org.apache.fop.events.model.EventSeverity;
+
+/** A simple event listener that writes the events to stdout and stderr. */
+public class SysOutEventListener implements EventListener {
+
+    /** {@inheritDoc} */
+    public void processEvent(Event event) {
+        String msg = EventFormatter.format(event);
+        EventSeverity severity = event.getSeverity();
+        if (severity == EventSeverity.INFO) {
+            System.out.println("[INFO ] " + msg);
+        } else if (severity == EventSeverity.WARN) {
+            System.out.println("[WARN ] " + msg);
+        } else if (severity == EventSeverity.ERROR) {
+            System.err.println("[ERROR] " + msg);
+        } else if (severity == EventSeverity.FATAL) {
+            System.err.println("[FATAL] " + msg);
+        } else {
+            assert false;
+        }
+    }
+}]]></source>
+        <p>
+          You can see that for every event the method <code>processEvent</code> of the
+          <code>EventListener</code> will be called. Inside this method you can do whatever
+          processing you would like including throwing a <code>RuntimeException</code>, if you want
+          to abort the current processing run.
+        </p>
+        <p>
+          The code above also shows how you can turn an event into a human-readable, localized
+          message that can be presented to a user. The <code>EventFormatter</code> class does
+          this for you. It provides additional methods if you'd like to explicitly specify
+          the locale.
+        </p>
+        <p>
+          It is possible to gather all events for a whole processing run so they can be
+          evaluated afterwards. However, care should be taken about memory consumption since
+          the events provide references to objects inside FOP which may themselves have
+          references to other objects. So holding on to these objects may mean that whole
+          object trees cannot be released!
+        </p>
+      </section>
+      <section id="add-listener">
+        <title>Adding an EventListener</title>
+        <p>
+          To register the event listener with FOP, get the <code>EventBroadcaster</code> which
+          is associated with the user agent (<code>FOUserAgent</code>) and add it there:
+        </p>
+        <source xml:space="preserve"><![CDATA[FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
+foUserAgent.getEventBroadcaster().addEventListener(new SysOutEventListener());]]></source>
+        <p>
+          Please note that this is done separately for each processing run, i.e. for each
+          new user agent.
+        </p>
+      </section>
+      <section id="listener-example1">
+        <title>An additional listener example</title>
+        <p>
+          Here's an additional example of an event listener:
+        </p>
+        <p>
+          By default, FOP continues processing even if an image wasn't found. If you have
+          more strict requirements and want FOP to stop if an image is not available, you can
+          do something like the following:
+        </p>
+        <source xml:space="preserve"><![CDATA[public class MyEventListener implements EventListener {
+
+    public void processEvent(Event event) {
+        if ("org.apache.fop.events.ResourceEventProducer.imageNotFound"
+                .equals(event.getEventID())) {
+            
+            //Get the FileNotFoundException that's part of the event's parameters
+            FileNotFoundException fnfe = (FileNotFoundException)event.getParam("fnfe");
+
+            throw new RuntimeException(EventFormatter.format(event), fnfe);
+        } else {
+            //ignore all other events (or do something of your choice)
+        }
+    }
+    
+}]]></source>
+        <p>
+          This throws a <code>RuntimeException</code> with the <code>FileNotFoundException</code>
+          as the cause. Further processing effectively stops in FOP. You can catch the exception
+          in your code and react as you see necessary.
+        </p>
+      </section>
+    </section>
+    <section id="producer">
+      <title>The producer side (for FOP developers)</title>
+      <p>
+        This section is primarily for FOP and FOP plug-in developers. It describes how to use
+        the event subsystem for producing events.
+      </p>
+      <note>
+        The event package has been designed in order to be theoretically useful for use cases
+        outside FOP. If you think this is interesting independently from FOP, please talk to
+        <link href="mailto:fop-dev@xmlgraphics.apache.org">us</link>.
+      </note>
+      <section id="basic-event-production">
+        <title>Producing and sending an event</title>
+        <p>
+          The basics are very simple. Just instantiate an <code>Event</code> object and fill
+          it with the necessary parameters. Then pass it to the <code>EventBroadcaster</code>
+          which distributes the events to the interested listeneners. Here's a code example:
+        </p>
+        <source xml:space="preserve"><![CDATA[Event ev = new Event(this, "complain", EventSeverity.WARN,
+        Event.paramsBuilder()
+            .param("reason", "I'm tired")
+            .param("blah", new Integer(23))
+            .build());
+EventBroadcaster broadcaster = [get it from somewhere];
+broadcaster.broadcastEvent(ev);
+]]></source>
+        <p>
+          The <code>Event.paramsBuilder()</code> is a
+          <link href="http://en.wikipedia.org/wiki/Fluent_interface">fluent interface</link>
+          to help with the build-up of the parameters. You could just as well instantiate a
+          <code>Map</code> (<code>Map&lt;String, Object&gt;</code>) and fill it with values.
+        </p>
+      </section>
+      <section id="event-producer">
+        <title>The EventProducer interface</title>
+        <p>
+          To simplify event production, the event subsystem provides the <code>EventProducer</code>
+          interface. You can create interfaces which extend <code>EventProducer</code>. These
+          interfaces will contain one method per event to be generated. By contract, each event
+          method must have as its first parameter a parameter named "source" (Type Object) which
+          indicates the object that generated the event. After that come an arbitrary number of
+          parameters of any type as needed by the event.
+        </p>
+        <p>
+          The event producer interface does not need to have any implementation. The implementation
+          is produced at runtime by a dynamic proxy created by <code>DefaultEventBroadcaster</code>.
+          The dynamic proxy creates <code>Event</code> instances for each method call against
+          the event producer interface. Each parameter (except "source") is added to the event's
+          parameter map.
+        </p>
+        <p>
+          To simplify the code needed to get an instance of the event producer interface it is
+          suggested to create a public inner provider class inside the interface.
+        </p>
+        <p>
+          Here's an example of such an event producer interface:
+        </p>
+        <source xml:space="preserve"><![CDATA[public interface MyEventProducer extends EventProducer {
+
+    public class Provider {
+        
+        public static MyEventProducer get(EventBroadcaster broadcaster) {
+            return (MyEventProducer)broadcaster.getEventProducerFor(MyEventProducer.class);
+        }
+    }
+
+    /**
+     * Complain about something.
+     * @param source the event source
+     * @param reason the reason for the complaint
+     * @param blah the complaint
+     * @event.severity WARN
+     */
+    void complain(Object source, String reason, int blah);
+    
+}]]></source>
+        <p>
+          To produce the same event as in the first example above, you'd use the following code:
+        </p>
+        <source xml:space="preserve"><![CDATA[EventBroadcaster broadcaster = [get it from somewhere];
+TestEventProducer producer = TestEventProducer.Provider.get(broadcaster);
+producer.complain(this, "I'm tired", 23);]]></source>
+      </section>
+      <section id="event-model">
+        <title>The event model</title>
+        <p>
+          Inside an invocation handler for a dynamic proxy, there's no information about
+          the names of each parameter. The JVM doesn't provide it. The only thing you know is
+          the interface and method name. In order to properly fill the <code>Event</code>'s
+          parameter map we need to know the parameter names. These are retrieved from an
+          event object model. This is found in the <code>org.apache.fop.events.model</code>
+          package. The data for the object model is retrieved from an XML representation of the
+          event model that is loaded as a resource. The XML representation is generated using an
+          Ant task at build time (<code>ant resourcegen</code>). The Ant task (found in
+          <code>src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java</code>)
+          scans FOP's sources for descendants of the <code>EventProducer</code> interface and
+          uses <link href="http://qdox.codehaus.org/">QDox</link> to parse these interfaces.
+        </p>
+        <p>
+          The event model XML files are generated during build by the Ant task mentioned above when
+          running the "resourcegen" task. So just run <code>"ant resourcegen"</code> if you receive
+          a <code>MissingResourceException</code> at runtime indicating that
+          <code>"event-model.xml"</code> is missing.
+        </p>
+        <p>
+          Primarily, the QDox-based collector task records the parameters' names and types.
+          Furthermore, it extracts additional attributes embedded as Javadoc comments from
+          the methods. At the moment, the only such attribute is "@event.severity" which indicates
+          the default event severity (which can be changed by event listeners). The example event
+          producer above shows the Javadocs for an event method.
+        </p>
+        <p>
+          There's one more information that is extracted from the event producer information for
+          the event model: an optional primary exception. The first exception in the "throws"
+          declaration of an event method is noted. It is used to throw an exception from
+          the invocation handler if the event has an event severity of "FATAL" when all
+          listeners have been called (listeners can update the event severity). Please note
+          that an implementation of
+          <code>org.apache.fop.events.EventExceptionManager$ExceptionFactory</code> has to be
+          registered for the <code>EventExceptionManager</code> to be able to construct the
+          exception from an event.
+        </p>
+        <p>
+          For a given application, there can be multiple event models active at the same time.
+          In FOP, each renderer is considered to be a plug-in and provides its own specific
+          event model. The individual event models are provided through an
+          <code>EventModelFactory</code>. This interface is implemented for each event model
+          and registered through the service provider mechanism
+          (see the <link href="#plug-ins">plug-ins section</link> for details).
+        </p>
+      </section>
+      <section id="event-severity">
+        <title>Event severity</title>
+        <p>
+          Four different levels of severity for events has been defined:
+        </p>
+        <ol>
+          <li>INFO: informational only</li>
+          <li>WARN: a Warning</li>
+          <li>ERROR: an error condition from which FOP can recover. FOP will continue processing.</li>
+          <li>FATAL: a fatal error which causes an exception in the end and FOP will stop processing.</li>
+        </ol>
+        <p>
+          Event listeners can choose to ignore certain events based on their event severity.
+          Please note that you may recieve an event "twice" in a specific case: if there is
+          a fatal error an event is generated and sent to the listeners. After that an exception
+          is thrown with the same information and processing stops. If the fatal event is
+          shown to the user and the following exception is equally presented to the user it
+          may appear that the event is duplicated. Of course, the same information is just
+          published through two different channels.
+        </p>
+      </section>
+      <section id="plug-ins">
+        <title>Plug-ins to the event subsystem</title>
+        <p>
+          The event subsystem is extensible. There are a number of extension points:
+        </p>
+        <ul>
+          <li>
+            <strong><code>org.apache.fop.events.model.EventModelFactory</code>:</strong> Provides
+            an event model to the event subsystem.
+          </li>
+          <li>
+            <strong><code>org.apache.fop.events.EventExceptionManager$ExceptionFactory</code>:</strong>
+            Creates exceptions for events, i.e. turns an event into a specific exception.
+          </li>
+        </ul>
+        <p>
+          The names in bold above are used as filenames for the service provider files that
+          are placed in the <code>META-INF/services</code> directory. That way, they are
+          automatically detected. This is a mechanism defined by the
+          <link href="http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service%20Provider">JAR file specification</link>.
+        </p>
+      </section>
+      <section id="l10n">
+        <title>Localization (L10n)</title>
+        <p>
+          One goal of the event subsystem was to have localized (translated) event messages.
+          The <code>EventFormatter</code> class can be used to convert an event to a
+          human-readable message. Each <code>EventProducer</code> can provide its own XML-based
+          translation file. If there is none, a central translation file is used, called
+          "EventFormatter.xml" (found in the same directory as the <code>EventFormatter</code>
+          class).
+        </p>
+        <p>
+          The XML format used by the <code>EventFormatter</code> is the same as
+          <link href="ext:cocoon">Apache Cocoon's</link> catalog format. Here's an example:
+        </p>
+        <source xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<catalogue xml:lang="en">
+  <message key="locator">
+    [ (See position {loc})| (See {#gatherContextInfo})| (No context info available)]
+  </message>
+  <message key="org.apache.fop.render.rtf.RTFEventProducer.explicitTableColumnsRequired">
+    RTF output requires that all table-columns for a table are defined. Output will be incorrect.{{locator}}
+  </message>
+  <message key="org.apache.fop.render.rtf.RTFEventProducer.ignoredDeferredEvent">
+    Ignored deferred event for {node} ({start,if,start,end}).{{locator}}
+  </message>
+</catalogue>
+]]></source>
+        <p>
+          The example (extracted from the RTF handler's event producer) has message templates for
+          two event methods. The class used to do variable replacement in the templates is
+          <code>org.apache.fop.util.text.AdvancedMessageFormat</code> which is more powerful
+          than the <code>MessageFormat</code> classes provided by the Java class library
+          (<code>java.util.text</code> package).
+        </p>
+        <p>
+          "locator" is a template that is reused by the other message templates
+          by referencing it through "{{locator}}". This is some kind of include command.
+        </p>
+        <p>
+          Normal event parameters are accessed by name inside single curly braces, for example:
+          "{node}". For objects, this format just uses the <code>toString()</code> method to turn
+          the object into a string, unless there is an <code>ObjectFormatter</code> registered
+          for that type (there's an example for <code>org.xml.sax.Locator</code>).
+        </p>
+        <p>
+          The single curly braces pattern supports additional features. For example, it is possible
+          to do this: "{start,if,start,end}". "if" here is a special field modifier that evaluates
+          "start" as a boolean and if that is true returns the text right after the second comma
+          ("start"). Otherwise it returns the text after the third comma ("end"). The "equals"
+          modifier is similar to "if" but it takes as an additional (comma-separated) parameter
+          right after the "equals" modifier, a string that is compared to the value of the variable.
+          An example: {severity,equals,EventSeverity:FATAL,,some text} (this adds "some text" if
+          the severity is not FATAL).
+        </p>
+        <p>
+          Additional such modifiers can be added by implementing the
+          <code>AdvancedMessageFormat$Part</code> and <code>AdvancedMessageFormat$PartFactory</code>
+          interfaces.
+        </p>
+        <p>
+          Square braces can be used to specify optional template sections. The whole section will
+          be omitted if any of the variables used within are unavailable. Pipe (|) characters can
+          be used to specify alternative sub-templates (see "locator" above for an example).
+        </p>
+        <p>
+          Developers can also register a function (in the above example:
+          <code>{#gatherContextInfo})</code>
+          to do more complex information rendering. These functions are implementations of the
+          <code>AdvancedMessageFormat$Function</code> interface. Please take care that this is
+          done in a locale-independent way as there is no locale information available, yet.
+        </p>
+      </section>
+    </section>
+  </body>
+</document>

Propchange: xmlgraphics/site/deploy/fop/trunk/events.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/site/deploy/fop/trunk/events.xml
------------------------------------------------------------------------------
    svn:keywords = Id



---------------------------------------------------------------------
Apache XML Graphics Project URL: http://xmlgraphics.apache.org/
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org