> I have been toying a bit with the WordFilter class in the > speeltuin CVS. > I adapted the class locally so it now works as a processor > that can be hooked into certain field types using the > fieldtypes.xml (in MMBase 1.7) and the hooks in the bridge. > It works quite nice. If you add the following to the fieldtypes xml: > > <specialization id="html"> > <setprocessor> > <class>nl.omroep.mmbase.processors.WordHtmlCleaner</class> > </setprocessor> > </specialization> > > You activate the processor. (I used a different package so I > can easily include the class in our catch-all 'omroep' jar, > in case you are wondering). > By specifying the guitype 'html' for a field I can now have > it filtered by the Word Cleaner code - it works with the > taglibs, the editwizards, and everything else that uses the bridge.
Nice > There may be some improvements that can be made - a lot of > the original code is static and I am unsure if that can cause > problems if multiple threads use the code (probably not, just > not sure). No problem at all. All variables are local and the only one not local is created when the class is loaded. The advantage is that there is no instance of an object required which saves object creation time. > I have downloaded a version of xmlbs from may 2003 (not sure > if that is the last one). It uses several jars that I would > rather leave out (maybe I do not need all of them in a > production environment?). The code in the speeltuin is the xmlbs-0.0.5 release plus the character encoding fix of mine. This is the development snapshot from the XMLBS site without the testing classes. Only the jakarta regex jar is required for XMLBS. XMLBS could use the java1.4 regex with some small changes. > Anyway I was thinking if and how this can be bundled in an > application for download (assuming Nico and Remko think this > is a plan). And where it would be best to store sources. > The speeltuin is an idea, though ofcourse one can also decide > to reverse the logic and put the MMBase-plugin on the xmlbs site? > I can hardly decide this myself, as I only added a few lines > to already existing code, but I think this plugin would be > very useful to a lot of people, and using the new field hooks > it becomes a lot more versatile. There is no binary available on the XMLBS site so I decided to put the required java files next to the wordcleaner in the speeltuin. The question is I think who should maintain the code. Remco is the maintainer of XMLBS and I am the one of the wordcleaner util which uses the XMLBS. The util in the speeltuin has no real dependency with mmbase yet. It could become an xmlbs class just like the XHTMLizer (uses GNU GetOpt). I don't have a preference where the mmbase/xmlbs integrator class wiil be. Nico --------------------------------------------------------- The best way to accelerate a computer is at 9.80665 m/s-2
