Project WONDER nightly build server

Whoo hoo! Mike Schrag has setup a build server for Project WONDER here. This is from his email to the Project WONDER list:

It functions very much like the WOLips nightly build server. Each morning at 5am EST, it does a checkout from the cvs server. If there were any changes, it increments the build number and does a Framework, Application, and Examples build. One difference is that it does not tag cvs with that build number, though it could if people particularly want this.

Great news! Thanks a tonne Mike.

The Joy of Project WONDER Series

Issue No. 1

Funky-Cool NSArray Operators

Project Wonder is chock full of yummy WebObjects goodness. As a general learning tool it’s great too. I’d highly recommend you grab the source and give it a gander. Mmm Good!

ERXExtensions is one framework that’s especially full of good stuff, and it contains one of my favorite classes: ERXArrayUtilties with its Funky-Cool NSArray Operators.

If your project isn’t based on ERXApplication, you will have to call:
ERXArrayUtilities.initialize(); Somewhere in your Application constructor to get the magic to work. But once you’ve done that all sorts of fun begins.

I’m going to make you read the source for the class for a list of all of the available Operators, but I will share my favorite. It is called: sort.

How often have you gotten an NSArray of objects back from a fetch (perhaps by navigating across a relationship) and you want to sort them (perhaps by serialNumber)? Well if you were in control of the fetch you could sort them there, or you could sort them in memory by creating a sortOrdering and applying them to your NSArray.

ERXArrayUtilitites makes is so much easier; simply call: sortedArray = unsortedArray.valueForKeyPath("@sortAsc.serialNumber");

No, wait, it gets cooler!

Since this is all being handled by KVC, we may not even have to write any code!

Lets say we have a Person object (person) that has a to-many relationship to its PhoneNumbers (named phoneNumbers). We want do be able to display the phoneNumbers on the Person detail page in an arbitrary order using its sequenceNumber attribute.

Using ERXArrayUtilities, we can simply bind the list binding of our WORepetition in WOBuilder to: rebmuNecneuqes.csAtrosnull@.srebmuNenohp.nosrep. Want to sort descending? No problem: rebmuNecneuqes.cseDtrosnull@.srebmuNenohp.nosrep. And if we have code that is allowing us to juggle the sequenceNumbers on our list, just reloading the page is enough to make sure the phoneNumbers are sorted correctly again.

Hey, didn’t I say it was Funky-Cool?