Drupal and OpenLaszlo

A good friend of mine, Kris Vanderwater, is speaking about integrating Drupal and OpenLaszlo at Drupalcon next week. Unfortunately, the conference is sold out, but if you’re lucky enough to have a pass already, stop by and check out his talk. Kris works for Meridian Data Systems, in Oklahoma City.

Drupal is a popular PHP-based content management system, that’s normally used to create HTML web sites. It’s relatively easy to configure Drupal to output content in XML instead, to provide services for RIAs. Laszlo’s corporate hompage is an example of this. laszlosystems.com is a Drupal-powered site, but the home page is mostly an OpenLaszlo application. Content that changes frequently, such as the Laszlo in Action, News, Events, Training, and Careers tabs, are driven by XML services that are administered, along with the rest of the website, through Drupal.

scriptlimits Attribute

OpenLaszlo 4.0.10 (released yesterday) includes the new scriptlimits attribute of canvas, which allows developers override Flash’s default script timeout and recursion settings.  I wrote about how to change these limits manually a while ago, and this has now been turned into a feature of OpenLaszlo.

The syntax is as follows:

<canvas scriptlimits=”timeout: 300; recursion: 65535″>

</canvas>

You should avoid setting the limits high to avoid the scrip-running-slowly error on poorly-performing applications. Instead reduce the limits when testing your application, to surface performance problems sooner on faster machines. Fix the root causes of poor performance, then increase the limits for deployment.

Latest OpenLaszlo Reference

If you’re not already using it, I’d highly recommend you start using the nightly builds of the OpenLaszlo Reference. You can either download a nightly build of OpenLaszlo that contains it, or use the hosted live copy. Unless you really need to read it offline, use the hosted version.

This trunk version of the reference looks similar to the old OpenLaszlo 3.x reference, but the doc generation tools have been rewritten from scratch, and the standards have been revised. It’s more accurate, more events are listed, the appearance is cleaner and the categories have been simplified. Here’s how the new attribute categories work:

  • initialize-only: You can only set this attribute once, when initializing the object. It doesn’t matter if you use a tag or script to initialize the object. e.g. name, id.
  • read-write: This is an attribute that you can change at run-time (via a setter method or the generic setAttribute() setter method, or a constraint). e.g. x, width.
  • readonly: You can not set this attribute at init time (either in a tag or in script), but you can read it using JavaScript (using dot-syntax), or inside a constraint. e.g. framesloadratio, totalframes.

Note that if you download OL 4.0.9.1 (the current stable version), you won’t get the latest reference; instead you’ll get the old 4.0 one, that’s worse than the 3.x version.