small medium large xlarge

Back to: All Forums  Mastering Dojo
21 May 2008, 15:37
Joshua Kahn (1 post)

Does anyone know where I can find the browser application framework code described in chapter 18: Building a Rich Internet Application? I had been starting to explore something similar, but if a fairly well baked framework already exists, that would be a preferable. The links in the footnote do not seem to have the framework available.


27 May 2008, 02:18
Steven Shi (1 post)

Ya, the chapter 18 is really appealing. Please put the source code on line as soon as possible. The code in the book is not complete !

01 Jul 2008, 23:45
Antony Gravett (6 posts)

Also, the framework is licensed from “Vista Information Technologies, Inc.” for which the URL is given as

on page 480. This site doesn’t seem to bear any resemblance to a site that might have built a BAF.

03 Jul 2008, 11:00
Rawld Gill (16 posts)

The RIA code in the download should be correct and complete. I rechecked it last week in IE7, FF2, and Safari3 and it worked fine. There was a mixup in the code download for a while (it wasn’t being updated from the book repository), but that should be fixed now. Let me know if anybody’s having problems with the current download. should be However, Vista’s been operating in stealth mode a bit longer than expected (mostly because of the time required to write this book!) The web site should be up in about a week with more of the RIA framework to follow. It will be open source with access to the SVN repository. Also, there will be some cool server-side stuff to go with it.

Thanks for your interest. Rest assured, I’ll keep on this!

08 Jul 2008, 15:26
Joakim Marner (2 posts)

Let me first say that this is the most inspiring software book I have bought in while!

That out of the way, I have little trouble getting some of the demos to run. Call me old-fashioned, but perhaps a readme could be included?

I was able to run the following files after some tinkering: **masteringDojo\baf\step1\obe\ main.htm to run: 1) Downloaded the sample code from 2) Got version 1.1.1 of Dojo and saved on my server. (I first tried with my version 1.02, but got errors). 3) Made an ISS mapping dojoroot to the directory where I saved version 1.1.1 of Dojo. 4) Updated main.htm: @import “/obe/obe.css”; -> @import “obe.css”; 5) Added line to main.htm:

This made the page load with the different colored areas.

I have not been able to get the next step pages to run. For example, for **masteringDojo\baf\step2\obe\ main.htm

I get the following error:

Line 21 commandItems is null or not an object (IE7)

Firebug on FF2.0 stops on line 22 “data: args.commandItems” in main.js This object appcontainer undefined args undefined

08 Jul 2008, 15:30
Joakim Marner (2 posts)

5) should read: 5) Added line to main.htm: [script type=”text/javascript” src=”main.js”][/script] (replace “[” with “<” and “]” with “>”).

09 Jul 2008, 06:57
Rawld Gill (16 posts)

Hi Joakim,

The code download for the baf demo includes a little toy WEBrick server to get all the urls resolving correctly. Each step includes a different server. So, for example, the server for Step 1 is at code/baf/step1/server/baf.rb. Here is the interesting stuff in the file…

server=>8002, :DocumentRoot=>’C:/dev/dojo-book/code/baf/step1’) server.mount(“/dojoroot”, HTTPServlet::FileHandler, “C:/dev/dojo/dojo-release-1.1.0-src”) server.mount(“/dojoroot/baf”, HTTPServlet::FileHandler, “C:/dev/dojo-book/code/baf/step1/baf”) server.mount(“/dojoroot/obe”, HTTPServlet::FileHandler, “C:/dev/dojo-book/code/baf/step1/obe”)

This server necessarily assumes that required directories exist at prescribed locations. These are as follows:

1.The “code” directory in the download should be a child of “C:/dev/dojo-book/”

  1. Dojo should be installed at “C:/dev/dojo/dojo-release-1.1.0-src” (so, this directory will contain the dojo, dijit, dojox, and util directories and dojo.js will exist at “C:\dev\dojo\dojo-release-1.1.1-src\dojo\dojo.js”).

Of course you can change these around by editing the baf.rb servers.

With this in place you can start the server for Step 1 by typing “ruby C:\dev\dojo-book\code\baf\step1\server\baf.rb”. This assumes ruby has been installed (I noticed you were using IE7, so assuming you’re on windows, you can get ruby quite easily at

Here are the urls for each step: 1. http://localhost:8002/obe/main.htm 2. http://localhost:8002/obe/main.htm?test=run001 3. http://localhost:8002/obe/main.htm?test=run001 4. http://localhost:8002/obe/main.htm?test=run001 5. http://localhost:8002/obe/main.htm?test=run002

Notice that the first step has no testing ability; Steps 2-4 use test “run001”; Step 5 uses test “run002”.

Don’t forget the servers are different for each step (and you must stop one server before starting another):

  1. C:\dev\dojo-book\code\baf\step1\server\baf.rb
  2. C:\dev\dojo-book\code\baf\step2\server\baf.rb
  3. C:\dev\dojo-book\code\baf\step3\server\baf.rb
  4. C:\dev\dojo-book\code\baf\step4\server\baf.rb
  5. C:\dev\dojo-book\code\baf\step5\server\baf.rb

I hope this helps. I’ll get this into a readme as you suggested.

It is important to me that you’re successful with this. Feel free to ping me at “”.

Finally, thanks so much for the nice compliment. It’s appreciated.

24 Jul 2008, 15:04
Roman Heinrich (3 posts)

Hi Gill, very nice book, it feels so thought through and advanced, really pragmatic and useful stuff ;) May I suggest a small improvement for bar & server-mapping-webrick-script:

require 'webrick'
require 'uri'

include WEBrick

dojo_root = "/Applications/MAMP/htdocs/dojoroot"
book_code = "/Applications/MAMP/htdocs/dojobook"
step = 5 # step of application

server=>8002, :DocumentRoot=>"#{book_code}/baf/step#{step}")
server.mount("/dojoroot", HTTPServlet::FileHandler, dojo_root, {:FancyIndexing=>true})
server.mount("/dojoroot/baf", HTTPServlet::FileHandler, "#{book_code}/baf/step#{step}/baf", {:FancyIndexing=>true})
server.mount("/dojoroot/obe", HTTPServlet::FileHandler, "#{book_code}/baf/step#{step}/obe", {:FancyIndexing=>true})
puts "mounting 'dojoroot' to #{dojo_root}"

['TERM', 'INT'].each do |signal|


Seems a bit DRYer to me ;)

04 Aug 2008, 14:48
Rawld Gill (16 posts)

Hi Roman,

Cool suggestion. I agree your code is better!

One of the bigger problems we had writing the book was keeping the server completely out of the discussion. This was hard because often the client doesn’t really make any sense without the context of a server (particularly when you’re talking about RIAs). Still, we wanted to be server agnostic, not assume any prior knowledge of some server/backside framework, and, above all, not digress into teaching about servers.

These are the main reasons the server code is absolutely minimal, not optimized, even…naive.

Look for a more complete RIA stack to be published (open source) from Vista Information Technologies (–later this summer. We’re prototyping Ruby and Lisp frameworks for the back end…and think we just might have something pretty cool.

Best, Rawld

24 Jul 2008, 23:42
Roman Heinrich (3 posts)

Hello Rawld,

maybe you could take a look at “Appcelerator”: , they have tight backend coupling to most popular languages: java, php, ruby, python. The concepts seem to be very similar: - declarative GUI (they have an html-parser) , - lightweight messaging without complications (aka dojo pub/subscribe)

Just for inspiration, if you don’t like, never mind! Cheers, Roman

14 Nov 2008, 21:16
Schmell Mafeet (1 post)

Hello Rawld,

it seems that the Container (BorderContainer or layoutContainer) will not render properly when trying to port this application to dojo-1.2.0 I can’t really see why this is happening and/or find any information in the migration issues that are suspect. Do you have any advice as to how one might remedy this.

08 Mar 2011, 22:58
Rawld Gill (16 posts)

Hi Everybody,

See and for more info about BAF.

Thanks, Rawld

You must be logged in to comment