RE: FOP extension functions
When I run FOP I get the following messages when it gets to the WritePageNumber extension function. Any suggestions? I have the idea that the extension function properties are not being mapped correctly -- am I right in this? thanks in advance. [INFO] FOP 0.20.4 [INFO] building formatting object tree [ERROR] property 'id' ignored [ERROR] property 'file' ignored [ERROR] property 'filename' ignored [ERROR] property 'id' ignored [ERROR] property 'file' ignored [ERROR] property 'filename' ignored [INFO] [1] [ERROR] no Maker for filename [ERROR] property filename ignored [ERROR] no Maker for filename [ERROR] property filename ignored [ERROR] null the ExtensionElementMapping file is as follows package com.gleim.fop.extensions.writepagenumber; import org.apache.fop.extensions.*; import org.apache.fop.fo.*; import org.apache.fop.fo.properties.ExtensionPropertyMapping; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; public class ExtensionElementMapping implements ElementMapping { public static final String URI = http://gleim.com/fop/extensions;; private static HashMap foObjs = null; private static synchronized void setupExt() { if(foObjs == null) { foObjs = new HashMap(); foObjs.put(WritePageNumber, WritePageNumber.maker()); } } public void addToBuilder(TreeBuilder builder) { setupExt(); builder.addMapping(URI, foObjs); builder.addPropertyListBuilder(URI, new DirectPropertyListBuilder()); } } -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 14, 2003 11:20 AM To: [EMAIL PROTECTED] Subject: Re: FOP extension functions This passage means that when you package your extension in a separate JAR file you have to add a certain file to the JAR. It's name is org.apache.fop.fo.ElementMapping and must contain the fully qualified classname of your class that extends the ElementMapping interface. That file must be in the directory META-INF/services. So if you have generated your extension jar, it must have approximately the following contents: /META-INF/services/org.apache.fop.fo.ElementMapping com/gleim/myfopext/MyFopExtElementMapping.class com/gleim/myfopext/MyFopExtElement.class [..] In Driver.java (at the end) you will see code that inspects this special file you have to add. It's to make sure that the extension is registered. You can also skip this step with tat special file if you call Driver.addElementMapping() either with the fully qualified classname or an instance of the ElementMapping implementation. This may also help on your way: http://marc.theaimsgroup.com/?l=fop-userm=10384400488w=2 I hope this helps. May I ask what extension you're planning? Just curious. On 14.01.2003 16:40:53 Matthew L. Avizinis wrote: Sorry, forgot to include what I wanted commentary on... :-) Hello all, Could someone elaborate a little on the following from the FOP extensions documentation please? Mabye paste some example code as well? Create a jar file with your classes, it must also 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. Thanks in advance for help, Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FOP extension functions
On Tuesday 14 January 2003 23:20, Matthew L. Avizinis wrote: I have written an extension that I had discussed a while ago about writing page numbers to an alternate xml file while FOP is running. I submitted it a while ago. It has a number of properties that allow you to name the file, whether it is the first or last entry going into the file so you can create a well-formed xml file, name the root element if it is the first entry to the file, the element name itself, and an id. This has allowed me to compile large books with many images by chapter (thus reducing memory usage) and still be able to make page cross-references from chapter to chapter. The idea is good, but I wonder why you implemented it as an extension. This way one will have to write non-standard FO when making heavy use of cross references. IMHO the better way would be to integrate this into FOP and make it configurable in order to not increase processing time when this feature is not needed. I suppose you have to make two runs, one to create to page index file and a second one to actually use that information (just like TeX)? Regards, Bernd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FOP extension functions
This passage means that when you package your extension in a separate JAR file you have to add a certain file to the JAR. It's name is org.apache.fop.fo.ElementMapping and must contain the fully qualified classname of your class that extends the ElementMapping interface. That file must be in the directory META-INF/services. So if you have generated your extension jar, it must have approximately the following contents: /META-INF/services/org.apache.fop.fo.ElementMapping com/gleim/myfopext/MyFopExtElementMapping.class com/gleim/myfopext/MyFopExtElement.class [..] In Driver.java (at the end) you will see code that inspects this special file you have to add. It's to make sure that the extension is registered. You can also skip this step with tat special file if you call Driver.addElementMapping() either with the fully qualified classname or an instance of the ElementMapping implementation. This may also help on your way: http://marc.theaimsgroup.com/?l=fop-userm=10384400488w=2 I hope this helps. May I ask what extension you're planning? Just curious. On 14.01.2003 16:40:53 Matthew L. Avizinis wrote: Sorry, forgot to include what I wanted commentary on... :-) Hello all, Could someone elaborate a little on the following from the FOP extensions documentation please? Mabye paste some example code as well? Create a jar file with your classes, it must also 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. Thanks in advance for help, Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FOP extension functions
I have written an extension that I had discussed a while ago about writing page numbers to an alternate xml file while FOP is running. I submitted it a while ago. It has a number of properties that allow you to name the file, whether it is the first or last entry going into the file so you can create a well-formed xml file, name the root element if it is the first entry to the file, the element name itself, and an id. This has allowed me to compile large books with many images by chapter (thus reducing memory usage) and still be able to make page cross-references from chapter to chapter. The code has been corrected recently by someone here that is more of a Java programmer than I. I will be posting the corrected extension code as soon as I implement your very information instructions and test it. Previously, I had only been able to insert the function by rebuilding FOP with my code files in the source area (I had a misinterpretation of the instructions that another person here at my company interpreted correctly and pointed it out to me). I also have an extension that emits two page numbers (there was a short discussion a number of months ago) per page, e.g. left page - 1, 2; right page -- 3, 4, since I recently had a need for such a thing myself. thanks for the help. -Original Message- From: Jeremias Maerki [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 14, 2003 11:20 AM To: [EMAIL PROTECTED] Subject: Re: FOP extension functions This passage means that when you package your extension in a separate JAR file you have to add a certain file to the JAR. It's name is org.apache.fop.fo.ElementMapping and must contain the fully qualified classname of your class that extends the ElementMapping interface. That file must be in the directory META-INF/services. So if you have generated your extension jar, it must have approximately the following contents: /META-INF/services/org.apache.fop.fo.ElementMapping com/gleim/myfopext/MyFopExtElementMapping.class com/gleim/myfopext/MyFopExtElement.class [..] In Driver.java (at the end) you will see code that inspects this special file you have to add. It's to make sure that the extension is registered. You can also skip this step with tat special file if you call Driver.addElementMapping() either with the fully qualified classname or an instance of the ElementMapping implementation. This may also help on your way: http://marc.theaimsgroup.com/?l=fop-userm=10384400488w=2 I hope this helps. May I ask what extension you're planning? Just curious. On 14.01.2003 16:40:53 Matthew L. Avizinis wrote: Sorry, forgot to include what I wanted commentary on... :-) Hello all, Could someone elaborate a little on the following from the FOP extensions documentation please? Mabye paste some example code as well? Create a jar file with your classes, it must also 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. Thanks in advance for help, Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]