Friday, July 18, 2008

Drupal Services & Flex

A current project at work is integrating Drupal & Flex together. There are a number of benefits to using these systems together. For me the main one is that you can offer the usability richness that Flex allows and the accessibility that standards based CMS's like Drupal offer without a lot of extra work.

The Drupal modules that make this possible are Services and AMFPHP. With these two modules enabled you get login and node access/saving functionality as a RemoteObject service in Flex. The other nice thing is that any Views (essentially UI developed queries for Drupal newbies) you define are also available as a Service. You can also develop additional Services utilising all the functionality Drupal has to offer. Finally, all these Services can be tested in the Drupal interface.

From that you can probably guess that I'm pretty enthusiastic about Drupal/Flex integration. But I have a caveat. We actually had a problem getting the Node and View Services to work. We kept getting a RangeError fault when trying to access these services. We finally found a workaround but we haven't had time to find the source of the problem. The workaround involves defining the fields you want returned as an array and passing it to these Services. Within the Drupal interface the fields parameter is optional and you get all the results you'd expect with or without it. But as soon as you add Flex to the equation you get an error. I assume it has something to do with the AMFPHP module as the Drupal Services page doesn't require AMFPHP but Flex does. I've posted this in the AMFPHP module issues and if you find a better solution that's probably a good place to post your discoveries.

I first heard about Services from a Friends of Ed book "Advanced Flex Application Development". My response to the book was mixed but it definitively got me thinking about Drupal Flex integration. Below are some links that proved useful getting this up and running:

1 comment:

Drupal Services said...

This is great to read and I appreciate it that you shared handy post . I will keep this post in mind.