Tapestry Inspector gets Groovy

The Tapestry framework comes with some very rich components. One of the best for debugging, or comprehending a tapestry application is the Inspector . Now that I can script component methods with Groovy, I wanted to see them in the Inspector so I cloned the Tapestry Inspector and added a Script tab so you can browse Groovestry script source over the web.

The source is in CVS at: http://www.sourceforge.net/projects/groovestry

The example is online at: http://examples.mjhenderson.com/groovestrysample/app if you have not downloaded Groovestry yet you can at least try it out and see the source code. This is a simple application and component methods are implemented completely in Groovy , the application contains no Java code, other than dependent Java libraries.

I'll put up a Sourceforge release today or tomorrow.

To use the inspector you'll need the groovestry-0.7.jar and add the following to your application specification:

<library id="groovestry" specification-path="/org/apache/tapestry/contrib/groovestry/Groovestry.library"/>

And put the InspectorButton on your page:

<span jwcid="@groovestry:InspectorButton">Inspector Button</span>

The Home and Page2 pages in the sample application have scripts and the Inspector has a script for the Script View. You can browse to the script by choosing the groovestry:Inspector page from the page list in the Inspector:

click on the Template tab
select the ShowScript component in the template
click on the Script tab when the component template displays.

Note the package name, Groovestry components can be packaged into component libraries.

Kudos to Howard et al, it was not too hard to add script inspecting to the inspector. However, I'm no graphic artist so I changed the tabs and view headings from images to plain links styled with CSS.

I've tested this from Mac OS X and Linux with Safari and Firefox. Safari places the InspectorButton top left, just below the page heading, Firefox moves it down to bottom-right, so you may have to scroll down on Mozilla based browsers to find the button and open the Inspector.