jPenguin Project: An Overview of the TOTSP Commons

Tagged:
Ok There is a bunch of stuff in here that really shouldn't be, but I am not going to stress over it right now. Right now, this project is in the FeedPod stuff at java.net. web cvs and :pserver:@cvs.dev.java.net:/cvs /feedpod/totsp/commons. Unless there is any big objection, I am thinking it can just stay there and we can pull it as a lib into the JWPortal project at sourceforge. Several things that will be of use to many people: 1. com.totsp.html.safetags.SafeTagFilter. This is a class that will (a) XHTML correct fragments, deprecating the jTidyInterface. It is pretty smart and knows how to replace "font" tags with styled "span"s and do some other things (b) filter unsafe content from XHTML fragments and (c) limit the number of non-tag characters in the output while still closing all open tags properly. It is an implementation of the com.totsp.xml.engine.DOMEngine class. The DOMEngine is used a few places to, and is kind of neat on its own. It is a minimalist version of the XML Interpreter system I built at AnyDevice, without the actual interpreter stuff. It is also used to "speech-friendly" things for the FeedPod reader. 2. com.totsp.util.QueueManager. This is a process queue system. Basically it creates a queue with an executor threat that will wake up every now and then and run a QueueProcessor implementation on whatever is in the queue. This is used all over the place (to fetch feeds for the cache, to queue up TTS executions in feedpod, etc). 3. com.totsp.util.BeanVector. This is perhaps the most useful class I have ever written. It is basically an extension of the Vector class that has sorting, filtering on range, filtering on string patters, page chunking, basic statistical stuff (mean median mode), and a bunch of other utilities based on getter/setter reflection. 4. com.totsp.util.CachingHashtable. I have written this a few times, but this is the end all be all of the class. It is basically a Hashtable that will only store things for a limited amount of time. 5. com.totsp.application.GenericUser this is a basic interface that all "user" objects should extend in whatever application. It basically is just one method (isUserInRole(String)). It is used by teh com.totsp.application.web.IsUserInRole servlet filter. See the JavaDocs on the filter for how to use it in your web.xml. 6. com.totsp.util.web.GZIPFilter this is a gzip compression filter for browsers that support it. Stolen from O'Reilly, it is really cool, and will work through ajp13 when the Tomcat compressions won't. There are some other things in the util package (StringUtility, StreamUtility, BeanUtility, XMLUtility) that are very useful too. Feel free to poke around. Really the com.totsp.excel and com.totsp.irc packages shouldn't be there. One day I will move them out. There are also some cool XML-RPC service utility classes that will become part of my Java-JavaScript "AJAX" toolkit soon. They may be moving out of the commons into a new subproject for that, though. Not sure yet. The com.totsp.html.table contains my AJAX Data-Bound tabular data control that is pretty cool. It needs good documentation though.

Comments

RE: jPenguin Project: An Overview of the TOTSP Commons

I have no issues with totsp-commons at java.net, in fact I like java.net after browsing around, certainly that can be its permanent home if adequate and JWPortal can use a jar (and a rename for that matter ;)). Funny also that I have written some of the same "util" things over the years, CacheMap, etc. I dont have a "BeanVector" but generally I use Collections objects with all the jakarata-commons bean tools and can do just about anything (sorting, filtering, etc, not page chunking or stats though). Anyway, all sounds good.

RE: jPenguin Project: An Overview of the TOTSP Commons

Yeah, I have never really looked at the commons-bean stuff. I suppose I should. The BeanVector has just become a catch all for me because I now have several patterns for using it that can be easily repeated, and everything is in that one easy class, which I like.

RE: jPenguin Project: An Overview of the TOTSP Commons

Also, the Text Analysis stuff is in the commons project to, under text/analysis.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.