flash actionscript3 amf DrupalService package, opensource

Events happening in the community are now at Drupal community events on www.drupal.org.
rolf vreijdenberger's picture

Hi all,

we've just created a DrupalService implementation in as3 for flash. It's a part of our internal company package that we have released under the MIT license. The package itself features (in our humble opinion) the best flash remoting as3 implementation out there (also featuring resultsets) and some other cool stuff. The core is fully unittested, and heavily documented, and we're making use of that in our DrupalService.

Our drupal service implementation uses the unittested flash remoting core functionality to provide access to drupal. Our setup is based on the DrupalService class and the DrupalEvent class. The classes are easily extended if you would need more functionality of your own.
At the moment, the DrupalService itself has just been refactored from an earlier version which worked great, but hasn't been tested yet.

You will need to check out the whole nl.dpdk package via svn as it has dependencies on other stuff in there. you can find it at www.dpdk.nl/opensource and check it out via svn via: "svn co http://playground.dpdk.nl/repos/dpdk_os_flash"

for our api, we've implemented most of the core services and used the convention serviceNameMethodName for our public api eg: service.nodeGet, service.userSave, service.taxonomyGetTree etc.

We've made full use of the as3 flash event driven paradigm, see the example below, and have encapsulated the low level stuff. It should be easy to use.

basic usage:
import nl.dpdk.services.gephyr.*;
var service: DrupalService = new DrupalService("http://www.drupal.org/path/to/gateway");
service.addEventListener(DrupalEvent.SYSTEM_CONNECT, onConnect);
service.addEventListener(DrupalEvent.ERROR, onError);
service.systemConnect();
//...
service.nodeGet(2);

function onConnect(event: DrupalEvent):void{
trace("sessionId: " + event.getData().sessid);
}

function onError(event: DrupalEvent):void{
trace("whoops: " + event.getMessage());
}

We'll implement some changes over the next week(s), depending on the time we can create for this specific thinggie and would be happy to get some feedback from you guys.
Don't shoot me if it won't compile at the moment, my three kids need attention and I just hacked away at it, refactoring stuff.
Based on my experience and the fact that my editor (eclipse + fdt) says it's all oke, you should be fine getting it up and running ;)

Comments

update, tested and authentication provided

rolf vreijdenberger's picture

Hi all,

the DrupalService has been updated. It now works with authentication via the authentication key method.

It contains support for different modules:
- user
- node
- taxonomy
- system
- views

it's easily subclassed if you need your own custom functionality.

Furthermore, authentication is now provided, so you can use the api key for further security for doing your calls. You can also use the DrupalSecurity class to provide all data for authentication for your own drupal implementations if you don't want to use this one.

It provides an easy setup and powerful features for working with drupal.

We tested the service and data calls, for the different use cases with and without key, with and without sessionId's. It al works great, so check it out!

The only thing we will update will be some comments so it's easier to use the classes with a good editor that has code hints. In that way, it's easier to see for developers what they have to send/receive.

if you guys have any feedback, please let us know!

Kind regards,

Rolf Vreijdenberger

drupal and flash: http://www.dpdk.nl/opensource/drupalproxy-as-a-bridge-between-flash-as3-...

and a blogpost to go with it...

rolf vreijdenberger's picture

With the risk of spamming my own post :), this is yet another comment.
There's also a blogpost on our company's opensource blog, where much is explained and with working example code.

you can find it at http://www.dpdk.nl/opensource/drupalservice-as-a-bridge-between-flash-an...

Kind regards,

Rolf Vreijdenberger

drupal and flash: http://www.dpdk.nl/opensource/drupalproxy-as-a-bridge-between-flash-as3-...

hi Rolf. does your package

psi-borg's picture

hi Rolf. does your package support file handling?

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: