GUI Mockups with Pencil

I came across a nice little free tool for building quick GUI Mockups: Pencil. It certainly has anything you might need for getting a flat prototype done—which is what I am using it for—but you can also go crazy and link multiple pages, export to multiple HTML pages, etc.
The only feature I am missing so far is selecting all elements in an area with the mouse, but overall things work out better for me with Pencil than with Viso or alike.

IIS Timeout on JBoss Transaction

Working more with our setup we started encountering “502 – Bad Gateways” errors when allowing users to run expensive queries on our database and give them the option to export the results. A temporary solution was to increase the ARR timeout as described in this blog post; the server farm settings are relevant for this case.

However, this still leaves us with the problem of some browser timing out on lengthy requests, so that we are now looking into an AJAX solution for decoupling the JBoss transaction from the front-end.

MS SQL Reserved Keywords and Hibernate

Surprise of the day, it turns out that User is a reserved keyword in T-SQL. You are still allowed to use keywords as identifiers, but you will need to escape them with square brackets:

[code lang=”latex”]
CREATE TABLE [User] (Id int);
[/code]

So far, so inconvenient. But things start getting really pretty when you clicked your schema together with SQL Server Management Studio, which will hide the keyword restrictions from you. Unfortunately Hibernate is not equally generous, so if you go from there and use your generated Hibernate mapping, you will be presented with a beautiful exception:

[code lang=”java”]
org.hibernate.exception.SQLGrammarException: Incorrect syntax near the keyword ‘user’.
[/code]

The solution for my case was to escape the table name in the related User.hbm.xml to table=”[user]”. Mildly annoying caveat: now the file has to be edited manually each time you generate your mappings, since there is no option to wire this type of adjustment into the reveng.xml.

JBoss and IIS 7

I have spent some quality time today with moving a web application from a temporary development environment (Windows 2003 x86, IIS 6) to a production server (Windows 2008 R2 x64, IIS 7). The IIS-JBoss integration on the development servers has been set up based on mod_jk and worked without causing and troubles. However, reproducing the setup in the new environment was failing miserably. The first impression I am getting from IIS is that even logging is a science for itself, so it was even hard to determine why.

Luckily a forum post finally pointed me in the direction of Application Request Routing (ARR) module for IIS 7 as an alternative solution. Performance might be still a subject to be determined, but the installation and configuration is worlds cleaner compared to the mod_jk version.

Ignoring Input to a Text Field with jQuery

The other day I was trying to use an input field for display only: the user would select couple of elements from an overlay box and, once their selection was completed, be presented with a generated output in the input field. This should be for overview purposes only and the user should not be able to type manually into the field; a scenario much like the one covered by the jQuery Datepicker. My first reflex of setting the fields disabled attribute unfortunately did not work well since inputs with disabled=”disabled” will not only drop the onClick event but, even worse, be ignored for the submission of the surrounding form. However, it turns out that there is a jQuery one-liner for the problem:

[code lang=”javascript”]
$(‘#month_range’).keypress(function(event){event.preventDefault();});
[/code]

This will essentially ignore any key events on the month_range input field. Be aware though that it will as always just protect the user a bit from themselves and not in any way relieve you from validating the input (just try to c&p something into the field…).

Google Health Retires

Google just announced the forthcoming end of their personally controlled health care record Google Health due to lack of widespread adoption. We have been working with the service since its launch in 2008 and used it as a back-end for various projects (most recently for a medication reconciliation tool tied to the SMART platform). Google Health was offering a very decent user interface, a fair amount of API support and some really good interfacing ideas; I hate to see this one go.

[UPDATE] You might deduct how important the project was in the end from the fact that it was not even worth a shutdown announcement for itself.