Tuesday, March 27, 2012

Maven Reporting Configuration

A small cheviot caused me a lot of problems with Maven Reporting.  As it turns out, configuration in the pom.xml file under project/build is completely ignored when running mvn site!  

Live and learn.

Wednesday, March 7, 2012

Character

In software engineering, as in much of life, there is no substitute for good old-fashioned character.

Reference.com has a definition of "moral or ethical quality: a man of fine, honorable character."  In particular (for creating great software), exemplifying the virtues of industriousness, truth and courage.  The practical application of industriousness is obvious (even when your code is compiling), but truth and courage are needed when a deadline isn't going to be made, or a critical bug is found.

Thanks to Motifake.com.
Character is especially important, as the client or boss frequently has less technical knowledge, and counts on our trustworthiness and expertise (see also, information asymmetry).

This may sound disingenuous from an author who shamelessly plugs this blogs in comments and posts demotivational posters for the links (I mean, for the readers), but even though this is a new profession, lessons from ancient Greece about virtue and character still hold true.

Thank you.

Monday, March 5, 2012

Drop-down Form Submissions in Trinidad

I've recently been doing this the very wrong way.  So I'll be going over the wrong way, and the right way.

The embarrassingly wrong way, is to have an Apache Trinidad drop down followed by a command link.  You set the onchange of the drop down to document.getElementById('commandLinkId').click() and have the command link do the submission.  I swear I found some webpage that recommended this, but I can't find it anymore.  As a side note, if you're doing things REALLY WRONG you can put the value of the dropdown as a variable instead of a property and try to read it in the actionListener of the command link.  This method may truly be Daily WTF worthy.

The less wrong way (using Trinidad), but the seemingly standard way to do it in normal JSF to do it would be use onclick="this.form.submit()".  This is a decent way for normal (non-Trinidad) JSF, but Trinidad makes it even easier!

The RIGHT way is to use Trinidad's autoSubmit feature.  This not only fixed a bug (doing it the VERY WRONG WAY resulted in a race condition with the version I was using), but saved lines of gristly code, avoids JavaScript (being used directly) and cuts out an invisible commandLink.

Please, please avoid my foolishness.