link to project page: http://drupal.org/sandbox/rolfvreijdenberger/1122068

The amfserver module is a D7 amf server module for the services module version 7.3.
It allows for communication between an actionscript 3 client (like flash, flex and air) with the drupal services via the amf protocol.

It makes use of the Zend framework and specifically of the Zend Amf server, which is not included but can be downloaded and installed in sites/all/libraries

It is possible to create one or more endpoints for this server. The endpoint can be seen in the browser and has a message saying everything's fine.
When a connection to the endpoint is made from an as3 client, all flash remoting / amf handling is as usual.

Resources are made available on the endpoint and permissions are needed to get access to the resources.

I am author of an actionscript based package for communicating with D6, which now works (without changing it btw) with D7 also. http://www.dpdk.nl/opensource

As of yet there is no implementation of amf for D7.
This fixes that.

the code also features a flash package in which the demo can be run (traces in flash only, use an http sniffer to find out what's happening) but I've tested it and pretty much covered it all (without authentication and sessions though)

Next up: I'm going to go into the nitty gritty of authentication and sessions next, these must be implemented but are not necessary since you can login as a user and use the services that way, will do parallel development (if necessary) on the actionscript code and want to be able to do better configuration of the server.

I'll have to create a nice and decent description for the module page too, but will fix that tomorrow probably.

i'm stocked :)

cheers

rolf

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rolf vreijdenberger’s picture

module page description is now up

rolf vreijdenberger’s picture

some screenshots attached.
some are of a http sniffer called charlesproxy, that can analyze amf data.
it shows both a succesful call (user.login) and an unsuccesful call (user.retrieve) due to lack of permissions for an unauthenticated user (by design)

rolf vreijdenberger’s picture

anyone care for a review? I have implemented everything that can be done, confirmed to all coding standards. did some good old testing with different scenarios, some good module help and info included.
let's get it out there.

thanks :)

sreynen’s picture

Status: Needs review » Needs work

The sandbox description says "This module is to D7 as the amfphp module was to D6". Why can't the amfphp module be to D7 what it is to D6? There's already an issue for porting amfphp to D7 and plenty of people have expressed interest. Is there some reason your code couldn't become the D7 version of the amfphp module? Have you considered applying to become a co-maintainer?

rolf vreijdenberger’s picture

Hi sreynen,

Yes, there is a reason, amfphp is hopelessly outdated. There is a lot more interest in the zendamf implementation than an amfphp implementation from the flash community and zendamf is the standard these days for php based amf traffic. We are delivering a lot of flash sites and have worked with amfphp for a long time, but zend is preferred.

Also noteworthy is that the lead developer of the last amfphp version of about 3 years old is now the lead developer of the zendamf framework, I think that says it all.

The differences between the implementation is also a lot different. It's not a question of porting, the whole basic layout is different.

So it made a lot of sense to abandon amfphp. The amfphp implementation had the sessionid and the key authentication parameters as part of the data that was sent to the service in the argument list. the amfserver does not have that and has a cleaner solution working with amfheaders, seperating the arguments data to the function from the authentication data.

that's the way it should have been for amfphp too in my opinion and was one of my main gripes with it, and also the reason I developed an actionscript wrapper to abstract that away from the programmer in D6.

Also thanks for the insight, I'll modify the description to highlight the point that amfphp is outdated and it is replaced with a better product by zend.

I did not now there was some work being done on an update to amfphp, but hey, it was taking some time :) and the time was right for a new version.

Furthermore, we have the actionscript framework upgraded in sync with the amfserver, which means that there is an actionscript framework that plugs right in, the same way as it did with D6. As a matter of fact, the framework works with both D6 and D7.

I hope that answers your questions.

cheers

rolf vreijdenberger’s picture

also, what do I need to work on, since I see you changed the status?

rolf vreijdenberger’s picture

back to review status please, added some screenshots

sreynen’s picture

Hi rolf,

That makes sense. It sounds like the approaches are different enough to warrant separate projects. "needs work" was maybe not the right status. Your explanation was the work I meant. I'll review the actual code when I get a chance.

sreynen’s picture

Status: Needs review » Needs work

I opened individual issues in the project issue queue. I didn't open an issue on using _drupal_session_read() because I don't know what the alternative is, but calling a function where the documentation specifically says not to call it seems like a bad idea.

rolf vreijdenberger’s picture

Hey Sreynen,

thanks for that, I'll fix the issues. Thanks for pointing it out :)

rolf vreijdenberger’s picture

Status: Needs work » Needs review

Sreynen,

all issues fixed. http://drupalcode.org/sandbox/rolfvreijdenberger/1122068.git/commit/599009b
please review :)

cheers

sreynen’s picture

Status: Needs review » Reviewed & tested by the community

I don't see any further issues.

rolf vreijdenberger’s picture

Hi Sreynen,

thanks for reviewing. what is the next step?

cheers.

sreynen’s picture

rolf, there are a few people with access to give you the new permissions. One of them will either do that, or notice something I missed. I would expect that to happen in the next few days, but it can take a little longer sometimes, since it's all being done by volunteers who get busy sometimes.

rolf vreijdenberger’s picture

I also implemented classmapping, as well as numerous updates in comments. Coding style doublechecked with coder. see the screenshot on classmapping

Rockmeister’s picture

Rolf,

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_7_great.amfserver_classmapping' doesn't exist: SELECT * FROM {amfserver_classmapping}; Array ( ) in amfserver_get_endpoint_message() (line 113 of /home/www/great/sites/all/modules/amfserver/amfserver.module)...

when i try to upgrade from an older commit to the latest i get the above error. Do you have to completely uninstall the previous commit first? It seems it is not creatiing the new classmapping table. Do you upgrade via the normal method using update.php?

rolf vreijdenberger’s picture

Hey Rockmeister,
since it's a sandbox project, I haven't implemented any upgrade paths. uninstall and install again and the table will be created. Also, there is a newer version (I can tell because the sql retrieval of fields is more specific now)

rolf vreijdenberger’s picture

so, I wrote some tests with the simpletest framework also.
see attached screenshots.

anyone out there willing to give me full project status?

rfay’s picture

Status: Reviewed & tested by the community » Fixed

Git vetted user role granted.

Thanks all for your reviews.

Thanks @Rolf for your contribution and future contributions. Don't forget to hang around and review other people's applications.

rolf vreijdenberger’s picture

thanks Sreynen, rockmeister and rfay.
I'm looking forward to contributing!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.