Johnny's Software Saloon

Weblog where I discuss things that really interest me. Things like Java software development, Ruby, Ruby on Rails, Macintosh software, Cocoa, Eclipse IDE, OOP, content management, XML technologies, CSS and XSLT document styling, artificial intelligence, standard document formats, and cool non-computing technologies.

My Photo
Name:
Location: Germantown, Maryland, United States

I like writing software, listening to music (mostly country and rock but a little of everything), walking around outside, reading (when I have the time), relaxing in front of my TV watching my TiVo, playing with my cat, and riding around in my hybrid gas/electric car.

Saturday, August 14, 2004

Firefox 0.9.3 and climbing!

I decided it was time I confessed. My favorite browser is not Microsoft IE - pronounced, "aiyeeee..." for some obscure reason, by the way. Nor is it Netscape.

Right now, it is Mozilla's svelt and oh so intelligent Firefox web browser.

I like it because the extensions for it are so powerful it makes the web easier to search, create pages for, test, investigate, and analyze, than ever before.

My favorite extensions for Firefox at the moment? That is easy.

In no particular order, they are...


CSS Edit
real time CSS displayer/editor - if you are a web guy/gal and you don't have CSS Edit, you could be an expert on CSS - if you had just downloaded it 5 minutes ago. This little extension is the killer app for the Firefox sidebar.

Web Developer toolbar
If you are a web developer... you need to get this tool bar. Do not tell anyone, do not ask for permission... just - get - this tool bar - now! Whatever you have to do, just get it. It lets you resize your browser to standard screen sizes with one command, validate the current page's CSS or HTML with one click. View the HTML source for a page with one click. It will identify the CSS class and id attributes everywhere in the page. It lets you view forms and form fields, HTTP request and response headers - you name it. You make web pages or web applications for a living and you don't have this toolbar - then you are missing out my friend.

Sage
Lets me view RSS news feeds without even leaving my browser or even flipping back and forth between it and another program. Why leave my browser to look at a list of news stories in another application, just so it can throw me back to where I am right now. Do I look like I am made out of time??? Sage solves that problem.

MAB
An Amazon browser. Lets me search through Amazon site for products a lot faster than regular, generic web browser mode. Sometimes you want to flip pages. Sometimes you just want to look at a list of the things you might be interested in displayed in a nice, concise list. MAB does that.

Googlebar
Do you Google? And you don't have the Googlebar, or you think you can only get one for MS-IE? Think again, my friend! Search Google for a phase or word instantly: the news site, the regular search engine, the per-computer OS site, whatever. It lets you translate a page to English instantly. It does so much you could find yourself using it more than many frequently applications on your computer. This is useful for anybody using the web, not just developers.



Reasons I like Firefox so much are:

  • speed - it is fast.

  • smart - it knows more of the HTML standard and CSS standard for web pages than any other browser out there.

  • safe - fewer privacy violations than with that other browser. It does not do ActiveX. It does not run Visual Basic Script. It renders pages the safe/standard way: HTML 4.01; CSS 1, 2, 2.1; Java 2; Javascript. The stuff that the web invented, Firefox was built for. So you can use the web - without being afraid.

  • stable - if Firefox takes a powder, it will not take the whole operating system including the desktop to the powder room with it. You know who I am talking about? Yeah, you do.

  • portable - truly portable; it works with any popular operating system, not just ahem one.

  • convenient - it lets you block popups, monitor cookies that try to take extra liberties, has anti-phishing guards, can notify you when updates come out if you want, state of the art SSL/TLS secure protocol support (HTTPS), full control/viewing capability of your bookmarks, cookies, passwords, history, etc.

  • extendable - with one click on Extensions command in the Tools menu, you can go shopping for free extensions at their extensive, comprehensive, frequently updated extension repository web site. So thoughful, let's shop - it won't cost a dime!

  • customizable - in this modern age of ring tones and cell phone well paper, you have got to be able to change the look and feel of your browser to show your personal tastes - and love of style. This browser was designed for your attitude from day one, baby. Click on the Themes command in the Tools menu and feast your eyes on all the personalizing cool looks you can put on your browser like a new skin. C'mon, be honest. Would you rather someone complimented you on that new coat you just bought last week - or that slammin' browser skin you downloaded this morning? That coat is old, this skin is new.

  • free - MS IE only works on one OS and that happens to the be one it has the most problems on. Firefox does not require you to buy an OS to get a free browser. It would not be free if it did.



Want to get Firefox and try it out? You bet you do!




Sunday, August 08, 2004

Article Shows How To Write Plugin to Add Regex and XPath Searching Views to Eclipse 3

The article Extending Eclipse with Helpful Views is really great.

I have been wanting to write an Eclipse 3 plugin for some time. I have the user - sorry ISV - manual for Eclipse 3 Platform and JDT, the samples, the interactive tip sheets, and the PDE (Plugin Develpment Environment) itself.

But sometimes I like to see a nice article with a simple and useful example that lays it all out so you can take the whole thing in at one time and focus on the crucial details, without the extra paraphenalia you might need once you get really advanced mixed in. This is one of those good types of articles.

The Apache Beehive Project

BEA recently donated another project to the Apache group, this one now being called The Apache Beehive Project.

The goal of the project is to add a simple object model to Struts programs, employ some of the new J2SE 1.5 annotations (see JSR-175) to create some metadata on the programming elements, and voila - a faster way to create Java programs for the web and intranet, hopefully.

There is already work underway to create an Eclipse plugin for editing/maintaining Beehive projects, called - appropriately enough - Pollinate.

Another Java-XML Data Binding API: XMLBeans

This article that came out a week ago, ONJava.com: XML-Java Data Binding Using XMLBeans, discusses another XML data binding API for Java. That one being Apache's incubating project XMLBeans.

XMLBeans was created by BEA, makers of the popular BEA WebLogic J2EE application/web server, and donated to Apache. Apache is now in the process of bringing it into alignment with what their community envisions for it so that they can release it with their blessing to the public.

Comparative Analysis: XML Data Binding tools

In the article XML.com: Comparing Java Data Binding Tools last year, JAX-B and something called XGen scored very highly, consistently taking second and first place in the tests and evaluations.

Castor came in somewhat lower.

It is a good article. They have a really in-depth feature-checklist comparison table in the article that could be very helpful to people. There are some graphs too, which by themselves are not very enlightening but with the other material to back things up they can be of some use.

Most companies, unfortunately meaning most programmers, have not woken up to how easy it is to convert the data objects floating around in their programs to XML using less effort in many cases than writing a dump using a lot of print statements, push it through a series of one or more XSLT stylesheets in a similar fashion to what programmers have been doing piping Unix commands output into other commands' input for over a generation, and then doing a final conversion into the ultimate output document format with a pre-existing utility.

Sounds like you don't have to do much work to get reports, web pages, and documents generated practically directly from your existing application programs and services, right?

Duh!

What did you think people were talking about when they said XML technology was revolutionary?

Anyway, the first step in this magic data-to-document pipeline is a good object-to-XML conversion mechanism. You can write it yourself using a little introspection and/or reflection - or you can use one of these prewritten data binding libraries. The choice of which you use probably depends on how much effort you want to put in up front to get the data in a format or two that will feed into XSLT-to-document converters. It is nice if you can get the data arranged so it is not, well, just data. Passing it as high-level information without too many extraneous levels can be helpful. So is some regularity. Because if all the similar forms of information have a similar overall arrangement, instead of wildly differing ones, it makes the stylesheet easier to write.

Pulling data from an SQL database is such a done deal. Every major database (Oracle, Microsoft, etc.) and XML-environment (Cocoon, etc.) provides at least one or two ways to do this, as does J2SE 1.5 itself (javax.xml.WebRowSet class). So chiefly it is only the data already in objects that you have to worry about. With this article tucked under your arm, you won't have much trouble picking one out. And if one of these Java Data to XML bindings is not too your liking, you can always code your own without too much trouble.

Eclipse 3.0 OSGi runtime - introducing a service-oriented architecture to an IDE's plugin-based extendable architecture

As many people know, the Eclipse IDE version 3.0 introduced a new service-based architecture within the Eclipse runtime environment.

One of the main motivations that led to this was the desire for an ability to do dynamic late loading of Eclipse plugins - and also unloading of them when they were no longer in use. The advantages of this are faster start times, less resources wasted by plugins that are not being used or needed by the user at the moment anyway, and a smaller overall memory footprint. Under Eclipse 2.x, once a plugin loaded, there was no way to completely unload it.

If you are not already familiar with OSGi, the Open Service Gateway interface, here is OSGi in a Nutshell.

If you are not already familiar with the Eclipse 3 additions to the Eclipse IDE, read this interview with Erich Gamma, famed technical leader of the open source Eclipse IDE project, discussing Eclipse 3 prior to it coming out.

10 Goto 10: The Eclipse OSGi runtime explained - Servlets on your PocketPC is a nice article that gives some background on OSGi as it pertains to Eclipse.

The OSGi Technology page over at the OSGi web site also gives a lot of useful introductory background about OSGi as well.

Here is the OSGi portion of Eclipse and the Eclipse core's OSGi runtime at the Eclipse CVS repository web site.

A lot of time when a new technology is introduced, people ask, "Yes, but where is the expertise for this new technology?". Well, a few things to say to that. First, OSGi experts are out there. According to the aQute OSGi web page they are one. Two, there has been a book out on OSGi for several years. It is part of the Addison-Wesley Sun Java Language series and is quite well written. Third, there are plenty of Java programmers in the world. If we believe the marketing math, there are millions of them - and OSGi is implemented in Java, used by Java programs, and has a Java API. I do not think we will have any problems there. Fourth, and finally - OSGi does not have a complex architecture or API.

One creates "Bundles" for OSGi which contain deployable services that can be added into an OSGi environment by an OSGi server administrator. These bundles are similar to the JavaBean and executable .jar java archiive files, web application server .war web archive files, enterprise Java Bean (EJB) .ear files, service archive .sar files, and so on. They have a manifest with some meta data in them and they contain a lot of Java class files in a ZIP file arranged internally into a directory hierarchy that is organized as a tree of Java package names, with each class in its respective package.

Bundles can be loaded, unloaded, advertise services, looked up by service, etc. Gravity has created an OSGi-aware ServiceBinder to help exploit the resource offered by all these services. Here is an OSGi and Gravity Service Binder Tutorial.

OSGi comes to Eclipse at a pretty good time. Judging from the number of plugins that are already available for Eclipse 3, we seem to be poised on the verge of having a deluge of useful plugins available to us programmers using Eclipse. For instance, right now I am aware of the following plugins available out there that are pretty nice looking:


With OSGi in Eclipse, we can install quite a few plugins into Eclipse, and as long as we are not using them all at once we are not going to bog down our IDE and slow down our programming efforts. The purpose of plugins is to speed up the production of software. The purpose of OSGi in Eclipse, among other things, is to speed up even the most decked-out Eclipse power-user's IDE. That means the more you use Eclipse plugins in Eclipse 3, the more you benefit from OSGi.

Saturday, August 07, 2004

WebRowSet (Java 2 Platform SE v1.5.0) - reads SQL data, outputs data in XML format

The new version of Java is introducing a new feature that will be a boon to a lot of the programmers out there in IT departments or working as consultants who get marching orders to "create an online report" or "create a data entry/reporting system based on the appearance of this existing paper form".

The Java javax.sql.rowset.WebRowSet (Java 2 Platform SE v1.5.0) class provides a simple way of reading back XML data from an SQL database.

From there, you can do any of the standard things that you can do with data that is in XML format. Generate a Swing/AWT GUI or PDF (using FOP), generate a chart/graph (using Batik [by generating SVG representation of histograms, line, charts, pie charts, and legends/titles] or JFreeChart), create an MS-Word or MS-Excel WordprocessingML or SpreadsheetML document, or render an HTML or XML web page to display the data or even let someone render it.

Generally, you can get the data into the right format for those things by just writing an XSLT stylesheet. Probably not a very long XSLT stylesheet either. You can accomplish some pretty miraculous transformations by just writing one to five pages of XSLT. It's very adroit at changing XML elements and attributes and text into another format; sorting, filtering, rearranging, and inserting/removing content along the way.

After all, that's what presentation is. Presentation format, data representation format - same thing. Just a little bit of transformation from a computer file, through some programs, on the way to your eyes. Or from your keyboard, to some data entry fields/controls, to some objects or structures, into some computer file or database table someplace. So it is little wonder a little presentation customization language based on data transformation would be a big help here. Big surprise maybe. But little wonder.

It is easy to convert data in XML format into a document in HTML or XHTML format. You just need to know HTML and, if you want to do it cleanly, some CSS.

It's a little more work to create an XSL-FO document, which you need to do to create PDF from XML, than it is to create an HTML document. There are three reasons for this, in my experience.

First, XSL-FO is a wordier format than HTML - so you are going to do about twice to three times as much typing compared with creating an HTML document. Two, the diagnostic messages you get back during XSL-FO sometimes are a little hard to interpret and reading the XSL-FO output (typically you can call this a .fo file) is harder than reading an HTML format. Third, the XSL-FO document format is concerned with page layout and most HTML pages, to my chagrin at least when I am printing a page off a web site that has a sidebar on it I don't want to print, do not struggle to do precise page layout at all - just very free-form screen layout.

Stylesheets are one of the most important technologies to come out for the web in the 1990s. Right behind HTML and XML, I would say.

Someone was just asking me this morning what was a good way to get XML formatted data so they could run XSLT on it and transform it into HTML or something that could be converted into a PDF report. This is one way to do it, if you want to read the data from a database via a high level interface layered over JDBC.

It's not hard to convert an SQL result set that comes back from an SQL query into XML format using Java. Why write any code if you don't have to, though - right???

So, got an SQL database and want good displayable and/or printable output? Why not generate a report by just using a WebRowSet object to get the data and give it to you in XML format, convert it by passing it and an XSLT stylesheet you write yourself to an XSLT processor like the one built into Java 2 (Xalan, part of JAXP and also available from the Apache web site), and then taking that resulting XML file and feeding it into the program you intended to read and use it.

Is it that easy?

Yep.

Of course if you lack confidence but have a lot of money and time, I could help you shop for some packages that cost over $100,000...

There is also another way to use all of this technology, except for the WebRowSet. That way is to use Apache Cocoon. Cocoon can already read SQL data in an XML format similar to the XML format that WebRowSet returns. Cocoon already has a way to hook up that XML data to your custom made XSLT stylesheet. Cocoon will let you take that output and route it to FOP (if you want a PDF document to come out) or through JTidy (if you want an HTML or XHTML document to come out). No Java code to write then, just create a couple short configuration files and write yourself a an XSLT stylesheet or two and you are done.

The other nice thing about Cocoon is that it runs on J2SE JDK 1.4 so you do not have to wait for JDK 1.5 to come out and stabilize. JDK 1.4 has been out for a couple of years. It's stable now.

You can download Cocoon's source distribution, compile it, download Tomcat 5's binary distribution and install it, throw the cocoon.war file you just generated into the Tomcat webapps directory, start up Tomcat, and be running Cocoon's examples and reading them all in less than half an hour. In the short term that might be a better way to create a solution than waiting for the JDK 1.5 technology. In the long run, you can always reuse your stylesheets from Java programs when JDK 1.5 has at long last arrived and become stable.


Simplifying web form programming with more savvy URI forms

Before I went to bed last night, I brainstormed for a while and came up with a nice little standard form for web application URIs - for refering to forms, actions, and for static files - that I think will make creating sites easier.

URI format that simplifies creation of interactive web pages


Standard (STD) URI forms:


STD "object/action" URI
/ [webapp-context-name] / [object-type] / [object-id] / [object-action]
Examples of object-action: view [default], edit, delete
Note: destructive actions like delete should be performed via POST - not GET, so that they cannot be bookmarked.

STD "object/resource" URI
/ [webapp-context-name] / [object-type] / [object-id] / [object-type] / [object-resource-id]
Examples of object-resource-id: icon.jpg, portrait.png, thumbnail.gif, controlPanelApplet.jar, statusBarApplet.jar

STD "system/action" URI
/ [webapp-context-name] / [system-action]
Examples: login; where [system-action] = "login" OR logout; where [system-action] = "logout"

STD "system/resource" URI
/ [webapp-context-name] / [object-type] / [system-resource-id]
Examples: Logo for system; where [object-type] = "image", [system-resource-id] = "logo.gif"
OR Favicon for web site where [object-type] = "image", [system-resource-id] = "favicon.ico"

Rationales:

1. This lets web pages, which tend to be focussed on a subject after all, use relative URIs for things that are part of that subject, and absolute URIs for things that should be part of the system as a whole. A concrete example of this would be images, but it could be background music wave or MIDI files, downloadable content, etc.

2. It also makes it easier to navigate from one page to another within the context of the same subject. So, getting from a view page to an edit page would be quite simple. You would just specify edit in the action attribute for the form.

Friday, August 06, 2004

Red Robin - Jython: The Jython plugin for Eclipse

The Red Robin - Jython plugin for Eclipse 3.0 is just amazing.

It was pretty lean just a few months ago. Now it has the ability not only to edit .py files in Eclipse - but also to define Jython projects, run Eclipse modules, etc.

It is really nice to see more support for more languages than Java and C/C++ coming to the Eclipse fold. Especially when they are as powerful as this wonderful plugin!

If you use Jython and you like the Eclipse IDE, you owe it to yourself to check this one out!

Eclipse Plugin Central and Eclipse Plugins - two great plugin directories for one great IDE!

Eclipse Plugin Central is a very nice site reviewing the Eclipse plugins that are out there. I just discovered it a few weeks ago. Until now, I though the only site doing this on a large scale was Eclipse Plugins.

I kind of like the organization and presentation of the Eclipse Plugin Central site a little better than that of the Ecllipse Plugins site. Perhaps this will spur some innovation! Well, both sites are very innovative but a little friendly competition is always nice.

Eclipse and Mac OS X: A Natural Combination

I am really glad Eclipse 3.0 runs on my Macintosh. Eclipse is my favorite Java IDE, the Macintosh - running OS X - is my favorite computer. Someone wrote an article about this combination, Eclipse and Mac OS X: A Natural Combination, a couple of months ago. Eclipse went final a couple of weeks later. Other than that, not much has changed since then. Eclipse got a little faster and better looking on the Mac is all. I'm sure some bug fixing and lots of testing was frantically going on then, though.

There are lots of great plugins for Eclipse that seem to work on the Mac.

One thing that does not seem to have been released for the Mac yet is CDT 2.0, which went final just after Eclipse 3.0 did. I have yet to see the Mac listed on the CDT 2.0 download page.

The author mentions someone who likes the jMechanic Eclipse Profiler Plugin.

The quality of Eclipse 3.0 and the plugins for it, which have been steadily getting updated from Eclipse 2.1 versions over the last couple of months, is just amazing.

They are providing stiff competition for Sun's NetBeans for the position of number one free Java IDE!

SCPlugin - free Subversion client support for Mac Finder

All, right! Someone has come out with Subversion client integration with the Finder on the Apple Macintosh (OS X 10.3 only) desktop! The program is called SCPlugin and it is available over at Tigris.org.

Monday, August 02, 2004

The SAXON XSLT and XQuery Processor

There are some very cool things about The SAXON XSLT and XQuery Processor.

One is, like Xalan-2, it can execute XSLT (XSL Transformations).

However, Xalan-2 only works with XSLT 1. Saxon 8.0, the latest version, works according to very recent drafts of the more powerful XSLT 2.0 standard. XSLT 2 adds support for grouping information in clumps, sort of like the GROUP BY clause in SQL SELECT statements. You can accomplish the same thing in XSLT 1. However, it is tedious to do it in XSLT 1.

The other neat thing is support for XQuery. People who like to think imperitively and in procedural terms, which fits a lot of IT developers, will probably prefer working in it compared to XSLT.

However, developers who have worked on event-driven systems - for example GUIs - or in side-effect free languages like LISP, will appreciate how well XSLT fits to the problem of transforming one form of XML into another or into some other textual format.

XQuery has been embraced in a big way by DBMS vendors, most notably Oracle. XQuery has also been built into the Macintosh since Mac OS X 10.2 (Jaguar) shipped, back in mid-2002. Apple made it part of their Sherlock web services client application, along with Javascript. Many people don't know they are in there but they are.

The free version of Saxon 8.0 cannot support XML Schema. However, the commercial version of Saxon 8.0 does support it.

Plone - Open Source Content Management System That Is Not Written in Java

Plone is a content management system written on top of the Zope portal and web application server. Both are open source and both are written in Python.

It is not necessary to know Python in order to customize or use either Plone or Zope. However, to do utterly unique things in them, of course you will need to use some Python to do that.

However, standard forms, fields, security, workflow, file formats, and all that stuff - has already been programmed. So you do not need to use Python in order to do that.

Plone supports WebDAV so the documents placed into its CMS are available not just from the web user interface but also through the WebDAV mount point.

Plone's appearance can be customized by altering is customizable CSS stylesheet.

Plone seems like a pretty good system. It is mature too. It is already on version 2.0. Zope has been around even longer, of course. Zope is one of the best known applications written in Python. Plone may be on its way to joining it.

Plone has standard installer for it. So installation on both MS-Windows, Mac OS X, and I suspect other operating systems as well - is quite simple.

Plone is easy to figure out how to use. I did it late one Friday night after I got home from work and had dinner. I installed it, configured it with a couple of accounts, and started putting documents into it. Very easy.

These days, with the technology getting so powerful - yet so plentiful - it is not hard to find a way to do something. It is hard to keep track of all the ways you have found though! Plone makes this much, much easier to do. For that reason, I like it very much. In time, I will probably customize the appearance of it on my computer. Not because I need to, since it already looks great by default - but because I can and because it looks easy to do.

Interview with Stefano Mazzocchi, inventor of Apache Cocoon

There is a great article, called Interview with Stefano Mazzocchi, inventor of Apache Cocoon, that discusses the birth, development, and status of Cocoon up to the time when Cocoon 2.1 was being developed. Cocoon 2.1 is the current version.

It started off as a contracted project to use a Microsoft Access database, of all things!

In the article, Stefano mentions his role as Apache's representative to the JSR-170 Java Repository API committee. The Java Repository API defines how to access a Content Repository from Java.

He talks a little about performance and why he feels Cocoon 2.1 should allay people's concerns in that area.

All in all it is a very good article to read for anyone interested in Cocoon, XML-aware applications and/or services, and other similar subjects.

Why Cocoon Makes a Good Web Publishing System

As explained in the article XML Web Publishing -- Featured Product -- CMS Watch, Cocoon can document data in many different formats. This is what a content publishing system must do. A content management system must merely store, secure, and retrieve many different documents. But a content publishing system is what gives those documents in different file formats to the user when he retrieves it.

JSR-170 defines a Java Repository API for interfacing to a Content Repository. The specification says that such a repository will allow versioning by the author, content indexing and searching, access control, and so on.

JSR-170 just went public about 2 weeks ago. If and when Cocoon supports JSR-170, it will basically become an extremely powerful component in enterprise document content management/publishing systems using a very standard API. Cocoon's inventor, Stefano Mazzocchi, sits on the JSR-170 committee as Apache Software Foundation's representative.

Considering it already has some JSR-168 portlet support and amazing powers of document transformation, and it looks like JSR-170 is a safe bet for some time in the future, Cocoon is well on its way to becoming a very satisfactory front-end for corporations and other organizations' document and reporting systems.

Creating SOAP Services with Cocoon

As XML.com: Creating SOAP Services with Cocoon points out, Cocoon makes it simple to create web services and then open them up to SOAP.

Built inside of Cocoon there is the SoapServerImpl class, which implements the http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/axis/SoapServer.html interface.

So it is clear that Cocoon 2.1 has SOAP support built right into it's Java guts and exposes it with a nice XML interface.

SOAP is an XML interface. Cocoon is an XML application server. What conjoining could be more obvious?

Building Portals with Cocoon

Yes, since Cocoon serves just about every commonplace purpose in the contemporary IT environment, there is even a facility included for Building Portals with Cocoon.

The Cocoon portlets are called coplets. There are several types of coplets. One type of coplet is JSR-168 (portlet) compliant.

ContentXML Content Management Software from Hannon Hill

I came across web content management software - ContentXML Overview - Hannon Hill Content Management Software while reading a Cocoon how-to article, XML Publishing with Cocoon 2, Part 2, tonight.

These screenshots of ContentXML were kind of impressive.

I realized it was possible to build a pretty powerful Content Management System (CMS) with Cocoon - given the fact it already provides XML transformations (via default XSLT plugin Xalan 2 or the Saxon XSLT), XML-DB (via Xindice I believe), security via authentication framework, and support for indexing content via Lucene.

I wonder if Hannon Hill has done this sort of thing and then added on the necessary user interfaces and workflow stuff to ContentXML, or if the product is built with somethin entirely different than Cocoon.

By the way, on the bottom of the first page of the article their tech lead wrote that I mentioned above, there is a very slick example of a nice clean action implementation in Cocoon. They are storing the Principle returned by a custom login method in a session attribute and so forth so they know who the user is from that point on.

Sunday, August 01, 2004

Aggregating Info from Different XML and/or HTML Files that Are Local or on The Web

Cocoon has a very powerful feature in the amazing Sitemap definition file that lets you tell it to agggragate info from one or more XML files - including JTidy-concerted HTML-to-XML files - into one combined XML file. So learn about aggregating in Cocoon!

Portal Syndication with Web Services and Cocoon

So your boss wants you to create a portal for your web site that seamlessly integrates to an existing web site that already does data entry/display but does not have the look-and-feel of your portal?

Oh, no! Now you are going to have to duplicate that whole other site just so you can make it look like it matches the rest of your portal?

No, no, no. Do not do all that unnecessary work. This is the age of repurposable content - the XML era. You just need to use Cocoon as an adapter for that other site to fit into your site. So go read Portal Syndication with Web Services and Cocoon.

DistributingCocoonApplications - as explained on the Cocoon Wiki

Hey, suppose you have spent the day creating a really whiz-bang set of reports using Cocoon and now you want to distribute what you have set up in Cocoon to do that. How do you do it? Well, the DistributingCocoonApplications page over at the Cocoon Wiki tells just how to go about it.

They give not just one but several ways to do it. That way you can pick the easiest one that is the best suited toward your needs.

Believe me, this is a lot less complicated than the hoops you will have to go through to distribute not to mention update your target systems if you are using some of the very expensive reporting software packages on the market.

How to Publish XML Documents in HTML and PDF - and even XLS - using free software!

Lots of people are automating the generation of business reports these days. Reporting has become a buzzword that means just that.

Many departments are dumping a lot of money on very expensive and perhaps not too friendly reporting tools. Many reporting tools assume your want to write lots of code in Java and/or work with a whacky GUI they call a report designer.

I have a feeling you don't want to do either of those things. You just want to get your report assignment written, tested, and deployed so you can move on to other things - like maybe the next one!

These days it is trivial to get Java objects or C# objects into XML format. Once you have done that, it is almost as trivial to get that computer data into a human readable data format. They are both just data. One just needs to be altered a little to make it into the other. Think of it not as recreating the data from one format into another format but rather just helping it out a little so it becomes the other format.

Here is a great introduction to how you can get your feet wet at a simpler way to genrate reports using Cocoon 2.1 It is called How to Publish XML Documents in HTML and PDF.

Of course, being business people or scientists, you just know that a lot of corporate users are going to look at their lovely reports in a spreadsheet like Microsoft Excel or Gnumeric, or the spreadsheet program in Sun's free Open Office enterprise/SOHO software suite.

Using the HSSF Serializer, you can convert your data into GMR XML format that is used directly by Gnumeric, and it will convert it on the fly into the XLS binary format used directly by Microsoft Excel.

So just remember, if you know XML, possibly a little XSLT, and do not mind investing a little time to learn how to set up a Cocoon sitemap.xmap configuration file - then you have have reports coming out quickly, in most formats anyone could ever want.

Personally, I always use Pollo to edit my Cocoon sitemap.xmap files. Pollo is free, easy to use, and does a good job of it. There are plenty of examples included with Cocoon itself and Cocoon's documentation with 2.1 is far better quality and far more complete than it was in the Cocoon 2.0 days.

I am sure that a lot of IT developers and organizations will continue to use these big, powerful, incredibly expensive report generating software packages for years to come. However, I have a pretty good hunch that nearly half of them do not need such packages and would be better served by sitting still long enough to define some XML date formats for their reports, using a convenient API call and some XSLT to get the data in that form, and then massage if needed using a little XSLT or XQuery, and then letting Cocoon translate it into HTML, PDF, XSL, or whatever.

Maven Plugins

If you are wondering what makes Maven so impressive, check out the list of Maven Plugins that comes with it. In addition to these 80-100 standard ones, there are other ones you can also get for free from other open source projects.

Having a really capable automated build that does more than just compile your Java code, generate javadocs, and jar it up is a necessity on just about any real Java project.

The fact that such tools as Apache Maven, Apache Avalon Magic, Krysalis Centipede, and Apache Forrest, exist - seems to be missed by most developers. However, they are very visible out on the web. Many projects are using them.

I think that most enterprise IT projects just use plain, old, bare ANT and create everything by hand from the ground up.

Maybe that will change as these things get better known by corporate Java programmers.

Magic - a new way to build powerful ANT build scripts for Java projects quickly

I have discovered Magic!

I installed it this weekend on one of my Macs so I could give it a whirl.

It looks like a much better, faster way to create automated builds than just creating a simple ANT build file and then incrementally adding, and adding, and adding to it.

It is pretty easy to set up.

Maven looked intriguing. It is powerful. It knows how to harness lots of powerful open source development tools into your automated build process. Maven even has its own Eclipse plugin. However, people also complain about Maven. I have not done much with it so I do not know. It does give me some pause though. If something out there does just about as much and does not have major drawbacks that would be great.

Magic basically supplies an antlib file for your ANT installation and creates a couple of standard ANT XML template files that your projects can import. When you start a new system, created out of one or more projects, you create a little XML file that describes the overall system in terms of the projects that go into it. Also there are the ANT build.xml files to create for each project. However, they are simple: they basically just need to import standard.xml or reactor.xml.

Magic looks like it would not have been possible without the new import element that was added in ANT 1.6. So if you are wondering why someone did not create something like this sooner, that is why.

It will be interesting to see if a bunch of sites adopt Magic as their project site's build technology or not.



Related pages & news