Friday, June 26, 2009

svn externals usage

I have a Foundation framework that uses com.webobjects.foundation classes, apache commons lang and a few other non-WebObjects libraries and utility classes (Separation of Concerns, etc.) I use WO 5.3.3, so without including project WOnder's ERExtensions, I don't get the benefit of generic foundations classes for NSArray, NSDictionary, etc. As I added some utility methods today in the framework, I decided to use svn externals to pick up the genericized foundation classes directly from Wonder HEAD.

This was simple to do.

I created a com.webobjects package in my Sources directory and added the following svn property to the webobjects directory:
name: svn:externals
value: foundation http://wonder.svn.sourceforge.net/svnroot/wonder/trunk/Wonder/Frameworks/Core/ERExtensions/Sources/com/webobjects/foundation

Note that is a space between foundation and the http url and that is all on one line of text. With svn:externals you can add multiple lines to pull in multiple external sources into your working copy.

I originally tried added a svn:externals property to the Sources directory itself with a left-hand-side of com/webobjects/foundation, which according to the svn book should work, but Subclipse was getting confused and freaking out when trying to commit saying that webobjects directory did not exist in repository.

Use ERXStyleSheet for CSS Stylesheets

Use Wonder's ERXStyleSheet reusable WOComponent for all your CSS stylesheet needs, even static ones served from your webserver root. This ensures that your changes during development are instantly reflected even for static ones saving you the need to do other fiddling to stop the browser caching your static stylesheets in development.

Example usage for a static stylesheet:

<wo:ERXStyleSheet href = "/lcwr/css/wkgeneric.css" />


For stylesheets in your application's WebServerResources, use it like this:

<wo:ERXStyleSheet filename = "wkgeneric.css" />


For stylesheets in a framework's WebServerResources, use it like this:

<wo:ERXStyleSheet filename = "wkgeneric.css" framework = "MyFramework" />


For dynamic stylesheet generation, you can put styles in the component content and a stylesheet will be dynamically generated, cached and delivered for you. Use this when you want dynamic styles for different users or branding for example. See the javadoc to understand usage of the cache key.

<wo:ERXStyleSheet key = "developmentgrid">

#bd {

background-color: none;

background: url(/lcwr/css/src/grid.png);

}

wo:ERXStyleSheet>



As always, Wonder provides the fast easy way to Get Things Done™


Tuesday, June 16, 2009

My New Blog

My blogging has been at a standstill for a long time due to the fact that I expediently set up my original blog on .mac using iBlog.app. Of course iBlog.app just became a pain to as time went by and as I moved through various versions of Mc OS X over the years. Then a new version of iBlog.app was released and supposedly was a free upgrade for existing iBlog users. I downloaded it, installed it, made one post, which had messed up HTML from this new improved broken version. After a month, the new version expired! ... and would not let me use it anymore.

I have been putting off blogging about software development bits and pieces forever. At the recent WOWODC 2009 in San Francisco, more than a few said "When are you going to start blogging again?" or "I found your blog very useful when I was starting WebObjects. Why have you stopped blogging?". This surprised me.

So, today I got itchy fingers and needed to talk about my recent D2W (Direct to Web) experiences since I am very very motivated to use this after the fantastic and motivating presentation by David LeBer on that topic at WOWODC 2009.

My old blog will stay as it is, untouched, more or less, until Apple says it will not host it anymore, or my .mac account is not renewed, whichever comes first. You can find the old one here: