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.

This entry was posted in Akelos, OpenLaszlo, Programming. Bookmark the permalink.

3 Responses to Akelos and OpenLaszlo–a first attempt

  1. April says:
    Glad to see the new site!

    Glad to see the new site! You shouldn’t have to apologize for posting about whatever you want — that is why one should blog in the first place!

  2. Anonymous (a.k.a. ABBIE!!) says:

    Hehe! Yeah…no need to apologize! I write stupid stuff on my blog, so you can write boring stuff on yours! :o)

  3. genkal says:

    hi, yes, to share some code – that would be much appreciated!!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

I accept the Privacy Policy

This site uses Akismet to reduce spam. Learn how your comment data is processed.