Hi. Having downloaded fop 0.20.2-bin and -src, I had read the documentation about extensions. There is says to add my own extension, I better had a look at the source in org.apache.fop.extension. Unfortunately the only documented class is ExtensionObj, stating to be "base class for extension objects". This is why I had to ask the list.
What I have is code that can render data from a DOM tree and gives me a java.awt.Image, which I can then use in applications or convert to GIF images. Now I want to reuse that code within FOP. I assume in your words this means I want an area in the output, but I really do not know what an area actually is. For me it sounds more like graphics, but I do not want to use SVG since I'd have to recode what is already there. So if I choose 1 (see below), I need to do "a similar sort of thing to all other fo objects". Does this mean I have to extend Area or FObj? For my understanding, I have to extend ExtensionObj, which also is an FObj and override the layout(Area) method. But then I do not know how to insert the image into the Area (do I have to extend that also?) and how to retrieve the DOM source (maybe that is done via the PropertyLists?). Hiran > -----Ursprüngliche Nachricht----- > Von: Keiron Liddle [mailto:[EMAIL PROTECTED]] > Gesendet: Freitag, 11. Januar 2002 10:21 > An: [EMAIL PROTECTED] > Betreff: Re: FOP Extensions > > > Hi, > > I think you confusing a few things. > > Starting from this page: > http://xml.apache.org/fop/extensions.html > (it could be a bit better and there will be some examples one day) > > The default extensions are svg and the bookmarks so you can > just use these. > > To make your own extension you need to consider what you want > to do first. > > 1. do you want to put a formatting object area in the output, > eg. some > text, block etc. > 2. do you want a graphic in the output, ie. somthing that > could be done > with svg > 3. do you want to do some document specific settings such as what the > bookmarks does > also what version are you using, this is about the latest release. > > > If 1. then you need to do a similar sort of thing to all > other fo objects. > If 2. then you setup a class that can get a DOM and turn it into SVG. > If 3. then it is a bit more difficult. > > It doesn't say to extend ExtensionObj, this is just an example. > > More below... > > On 2002.01.10 18:15 Software AG wrote: > > Hi, there. > > > > Trying to create a FOP Extension I'm getting totally > confused with the > > docs. > > The HTML document says to just have a look at > org.apache.fop.extensions.* > > and implement the ExtensionObj interface. ExtensionObj is not an > > interface > > but a class, and hardly documented. So all I know is I need > to overload > > the > > > > public Status layout(Area area) > > > > method. I have rendering code that eats a dom tree and spits out a > > java.awt.Image or GIF or whatsoever. Looking at the SVG > extension code > > confused me more than it helped. From the list archives I could not > > derive a > > cookbook what to do. > > > > - What class do I have to extend: Area (like SVGArea) or > ExtensionObj? > > You will likely need to extend FObj. > > > - How is this new class going to get the DOM tree inside the > > fo:instream-foreign-object element? > > The same what that SVG gets the DOM > > > > - How is this new class going to pass the rendered image to FOP? > > ?? > If you want SVG for the output then just do what the SVG > does, ie. put the > SVG DOM into an SVGArea. > > > - How do I correctly register the new class so FOP will call it? > > As on the website > "include the following file > "/META-INF/services/org.apache.fop.fo.ElementMapping". In > this file you > need to put the fully qualified classname of your element > mappings class. > This class must implement the "org.apache.fop.fo.ElementMapping" > interface." > > > > - What happens if I cannot provide name spaces on the elements? > > You must have a separate namespace. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]