Quick Search
Twitter

Lotus Community


Friday
26Feb2010

Upgrading to Mootools 1.2

With the release of IdeaJam 1.7 (in beta at the moment, but going "Gold" soon enough), we decided to upgrade the Javascript framework that we use, MooTools to the latest and greatest version. Normally this isn't even worth commenting on, but this change was a big'un as a lot of the underlying API changed from version 1.1 to 1.2. Similar changes have happened with Dojo in the past in the shift from 0.4 to 0.9 and a very positive move it was too. The problem is that it's a painful process of rekeying quite a lot of code.

So I thought I'd go through the resources I used and the main changes which we faced with the upgrade to help anyone else going through the same process, although to be fair we are quite late to the party with MooTools 1.2 as it was released in the middle of 2008.

There are a couple of really useful websites which document in quite a lot of detail how old style 1.1 syntax should be modified for 1.2. My favourite was this page on the Github Wiki: Conversion from 1.11 to 1.2.

Another page you might find useful is this.

The areas which we spent most time on were retooling all of our Ajax requests behind the scenes (which was the reason the Chrome bug I mentioned recently was introduced). So the main thing to be aware of is that the syntax for an Ajax request changed from something like this:

new Ajax(url, {
method: 'get',
onComplete: processResponse
}).request();

towards something like this:

new Request({
url: url,
method: 'get',
onComplete: processResponse
}).send();

The other thing which caused us a little trouble was with the tooltips we use on the Dashboard page in IdeaJam. When I say trouble, it took about an hour to fix, we're not talking serious effort here! Anyway, the default CSS settings changed a little, so we just had to add a few extra lines to our CSS file, no biggie.

Finally for areas which you'll want to be careful with, it's third party add on functions and code. For example we use Phatfusion's sortableTable class in the Top Innovator's screen. This was written for MooTools 1.11, so I had to make some changes for it to work properly with the new version.

From an IdeaJam point of view, the reason for the upgrade was so that we can start to use some of the newer Clientcide plugins in areas that may not get much airtime on the public IdeaJam site. One of the main customer feature requests for this new version is what we call the "Implementation Plan", it's the first feature to use some new MooTools functionality, but you can expect more in the next few weeks as we add a new way of linking ideas together.

So why should you use MooTools? Well to be honest, these days most big web shops seem to be going with jQuery and there are a lot more resources out there for that framework. But I still have a soft spot for MooTools, it seems to fit the way I think which is an important consideration when you'll be spending days, weeks or months using the API.

Really the main benefit of MooTools these days is the wonderful Clientcide add ons which handle the UI side of things and the superb documentation and also the core and more builders which allow you to configure the javascript files which make up MooTools to such a degree that it will do exactly what you want, a great boon for managing your deployments.

Thursday
25Feb2010

Be very careful with your content type for Chrome Ajax requests

We released the first beta for IdeaJam 1.7 today. There are *tons* of changes under the covers including the new MooTools 1.2 framework, on which you can expect more later this week.

But for the moment, I thought I'd pass along one little tip which we ran into. Inevitably during our own testing we had missed this bug. When you're in an idea you can "Click to show votes" and what happens behind the scenes is that an Ajax request is fired off to our votes database, an agent runs and send back a list of the votes related to that idea, when they were cast, who by and so on. That agent had been set up with the following code at the start:

Print |Content-Type:text/javascript; charset=utf-8|
Print |Cache-Control: no-cache|
But what we are actually doing is pre-building some HTML and then just inserting it into a div, it saves a little bit of browser processing time this way. But in Chrome we were getting an error:
Uncaught SyntaxError: Unexpected token <
It took a while to track down the problem, but now I found it, it's obvious. The content-type of the agent needs to actually be set to text/html, not text/javascript. All of the other browsers worked fine with this oversight, even Safari which is a fellow Webkit browser, but Chrome seems to be a lot more picky. So this is just a reminder to make sure you're very precise with what is being sent to Chrome from your server.

 

Friday
12Feb2010

XPages101 Online is here

One of my big takeaways from Lotusphere this year was that there is a huge appetite for XPages training material. I had already got my classroom based XPages101 course lined up, but now that that's done, it's time to turn attention to the rest of the world and the online format.

So what I've come up with is a new website (same URL as before though) at xpages101.net. From here you can see the details of the classroom based course but there's a whole other section of the site devoted to online material. Now to make this work for me (I run a small business on my own and this stuff takes a *lot* of time to put together) there is a charge for the content. But I've tried to make it as appealing as possible.

You have two choices, either a single user account or a five user account. In both cases you'll get full access to the site, all of the videos and support content for a full 12 months. The aim from my side is to keep on adding new videos every week or two for as long as there are interesting things to talk about. I just worked out what I have to create lessons on and it will take me well into May just from my initial list!

Also, to thank you for your early interest in the site, you can use the coupon code "earlybird" at check out and get a 33% discount until February 26th.

So please, go and check out the site, let me know what you think and if you have any areas that you'd like covered the please either comment here or use the contact us form on the site.

Wednesday
10Feb2010

XPages101 done. (for now)

Yesterday, Ben Poole and myself presented the XPages101 course which I have designed over the last couple of months to be an introduction to developing with XPages.

Overall it seemed to go pretty well, the timings need some work, I went a little fast at some points which may have left a few people overwhelmed at the fire hose of information we got through in a short period of time! That will not happen again now that I understand how it all hangs together a bit more.

The feedback from the attendees was really gratifying...

Question Score
Overall, how would you rate the course? 95% (between Excellent and Good)
How was the course material? 86.67% (between Excellent and Good)
How was the presentation style? 86.67% (between Excellent and Good)
Would you recommend the course to your colleagues / nerdy friends? Yes: 100%

 

Obviously there's always room for improvement and there were some great feedback comments as well...

"A real eye opener for me as I've not looked XPages prior to the course."

"Excellent value for money. Pitched just right for the first steps into XPages."

"It gave me a very good understanding of XPages under the bonnet."

"It was great being here, great course, the XPages start I was looking for."

One of the things which I had consciously not done was provide lots of handout materials. The aim was to reduce the costs of the course as much as possible. From the feedback it seems people would have been happy to pay extra to get more paper based materials. So I think in future iterations of the course we'll change that around.

The other area where a couple of people expressed an interest was for an "intermediate" course. This leaves me in a bit of a quandary, as I'm not sure I know what intermediate is. So if you have any thoughts I'd love to hear them.

Overall though, as I said earlier, it was a great day. Good fun for me, and hopefully useful to everyone else.

Monday
01Feb2010

Just eight days to go...

Next week I am running (with the able assistance of my LDC colleagues) the first iteration of my new XPages101 course. Interest has been gratifyingly high, but we do still have a very few places left. If you wanted to come along and either the news got lost in amongst all of the #LS10 craziness, or you're worried about training costs generally, then I'd encourage you to check out the course page

I designed the course to cover as much as possible in a day and the price to be low enough that independent consultants and contractors (my background) can afford to send themselves on it.

So I hope to see you in London next week. If you can't make it during the day for some reason then we are also having a LotusBeer gathering in the evening of the 9th February at the Founders Arms from around 6pm. You're more than welcome to come along if you're in the area.