Category Archives: Akelos

Akelos and OpenLaszlo–a first attempt

Along with my updated site I am updating my self-limiting policies on what I post. In the past I have refrained from posting on things like programming that would bore most of my audience (of 5 people), but no longer! I am going to post about whatever I feel like. My readers will just have to suffer.

This job I’m in is the most educational I’ve ever had. I never thought I would learn about networking or do any web programming, but now both are in my job description. When I decided my employer needed a web application, I didn’t know a thing about writing one, so I decided to use the web application framework Ruby on Rails because it allegedly made web development easy, or at least easier than it had been.

Well, once I got into it, it did seem like a pretty easy way to develop, but there was one problem. It’s hard to deploy, at least if you’re using a Windows server. So I looked for a PHP alternative, because I knew I could deploy that with virtually no effort. And I found CakePHP, CodeIgniter, and Akelos. I’m trying out Akelos because it’s pretty much a straight port of Rails to PHP (so all that Rails learning won’t be wasted), and even though it’s very new, people are already impressed with it.

But then there’s the problem of the user interface. It’s very easy to create boring and cumbersome UIs in regular HTML. It’s hard to create nice-looking and easy-to-use ones that work right in every browser. Hence there are rich Internet application platforms like Adobe Flex. I somewhat randomly settled on OpenLaszlo for this.

Laszlo interacts with the server by passing XML back and forth within a single application, I presume using a single URL. Akelos executes actions based on the URL the browser requests and then generates a view, usually in HTML, that gets sent to the browser as the content for that URL. Invoking a different action means pointing to a different URL. How can I get the two to work together?

The answers are probably obvious to anyone who’s familiar with the tools or with web programming in general, but I am just learning this stuff, so I was pleasantly surprised when I made fairly easy progress tonight with only a couple of general hints I picked up online. I’m used to guessing wrong about how things work and spending hours slogging through documentation and experimentation.

Tonight I successfully embedded a Laszlo Flash application in an Akelos view and had the application grab some XML data from a static view in Akelos. The next step is to get Akelos to generate the XML dynamically from the database, and after that I’ll have the Laszlo application give Akelos data to put into the database. Then I’ll have to learn more about OpenLaszlo to define the next tasks.

I think the basic idea behind getting the two to interact is to treat the Laszlo application as a web browser so that it is the one making the requests for the various Akelos URLs, while the browser simply points to the Laszlo application. So to deliver the data to the application, I created a view that contained the data (and a corresponding action in the controller), and then in the application I used the relevant URL in the src attribute of the dataset tag.

I would post the code for all this, but this entry is already long enough. When I get far enough along, I’ll post a demo or tutorial or something, either here or on the Akelos wiki.

Continue reading

Posted in Akelos, OpenLaszlo, Programming | 3 Comments