Introduction
The example is based on test application for cakeAMF plugin:
https://trac.cakefoundation.org/amf/wiki/tutorial/amf
Thanks to developer(s) of cakeAMF plugin. Any comments and suggestions are welcome.
The application uses the MATE framework, for event handling and remoting:
http://mate.asfusion.com/
UPDATE: A non MATE version of this example is also available, so if you prefer the "pure" flex 3 technology, check out the article.
The MATE framework is a very userful tool to build complex application with flex. For this example it wasn't necessary to use the MATE, but I wanted to show how to use the cpamf plugin with that powerful framework. The plugin can be used without MATE; using RemoteObject, or with simple NetConection.
The example is a very simple "user management" application. You can list all users, get a user by id, and insert new user to the database.
Download
Download the example here.
bomb
Thank you, It good job wow
alan
Daniel,
Sorry to trouble you. I'm new at Cake.. I can't get the
but on the http://localhost/cpamf_test/
I can see the "Release note" default page. I've setup the database and data but still no luck with
localhost/cpamf_test/cpamf/gateway.
It gives 404 error. Any clue? Thanks in advance.
alan
Argghhh.. the last comment shall be in the CAMF test page..
Daniel Verner
@alan
If you see the default page, then the cakephp is set up correctly.
Mod rewrite should be enabled, and set AllowOverride All in httpd.conf
alan
hi... I got cake and cpamf working... but the flex program cannot get data from it... it just gives me error message.. I tested the gateway on browser, it works fine... any idea? Do I need to change the salt?
Daniel Verner
What kind of error messages you get? If it is a security sandbox violation, try to change the gateway url in services-config.xml (from 127.0.0.1 to localhost), and than recompile the flex application.
alan
It's not sandbox violation... The error is from:
Alert.show( faultString, "Error!" );
what shall I do to reslove it?
Ramiro Araujo
Hi Daniel
Great work!! Im having a little problem making the browser work. I can enter the browser, and the gateway is correct, but then the browser ask for getServices method, which is doesn't exist, and I can go past that. I can see the remoting call from ServiceCapture,
I see the method is implemented in the discovery_service_controller, but how is that controller tied up with the browser? The getServices points to the service 'amfphp'...
thanks!
Daniel Verner
The discovery service controloler is a special controller, the service call is checked in the CakeActions.php, and if it is a Amfphp.DiscoveryService, then the discovery service controller is called. Could you be more specific about your problem, so we can resolve it.
What you get when you enter the gateway url to the browser? (localhost/cpamf/gateway)
François Greze
hi ,
Thanks you for your very useful "cakephp" adaptation of the amfphp library...
I have all ready put a cool and nice backend on tracks using your plugin ... :) thx a lot then !!
One quesstion : what do you think of the zend_amf library ?
happy coding ...
Daniel Verner
Before starting my plugin's development, I've checked out zend_amf too. It looks promising, and it is also supported by Adobe and the Zend community.
I had 2 reasons to choose AMFPHP over zend_amf:
1. AMFPHP can take the advantage of the AMF extension (serializing and deserializing AMF data using native C implementation), as far as I know zend_amf can't use the AMF extension yet.
2. Our team used AMFPHP before, and we had good experiences with it.
Would you like to show us your project which is based on this plugin? We'd like to check it out. If you don't want to show your link public to the public, you may e-mail us. Thanks!
François Greze
Hi Daniel,
Sure as soon as it's online, I'll send you a link ...
There is nothing special by about this project, but I'll give you a buzz when my code is cleaner :) and all the functionalities I Have in mind are working .
Keep in touch then !
FG
Gustavo
¡ALELUYA!
I was having the problem related to the service browser. The cpamf_test sb works fine but the sb inside my application didn't (I tried out v0.10 and v0.12). I copied the contents of the plugins directory of the cpamf_test to my application and now the sb is ¡working!.
I will do some tests and call for help if neccesary.
Kind regards
Gustavo
Ricardo
Hello, where I put my flex project files (withou MATE) on cakephp folders?
Daniel Verner
@Ricardo
You can put the flex project anywhere you want. You should put the bin-debug folder somewhere in your webroot, to prevent security sandbox violation.
Ricardo
Hello again Daniel, thank you to answer my question!
Sorry about that but, could you make an more simple and step-by-step tutorial to use your plugin? I'm really want to use that but I don't understand where to put my files and how CakePHP map an view to Flex project.
Samuel Mburu
Daniel, thank you for the great tutorial. I just had a question for you as well as anyone else(hopefully I'm not the only one with this issue).
So it runs fine locally, but when I push it to my webserver and try to hit the 'Get All Users' button, I get a 500 error when the flex tries to look for crossdomain.xml. What's really wierd is using firebug I was able to see that it looks for http://localhost/crossdomain.xml, which is not right at all.
Did I forget to configure something?
Here is the site url so you can see this for yourself:
http://cake.blue-eel.com/cake1.2.x.x/fl ... _mate.html
Thanks
Samuel M.
Daniel Verner
Check your services-config.xml. Maybe your gateway is not set up correctly. If you make changes in the services-config.xml, you may need to clean and rebuild the project.
Samuel Mburu
Wow, thank you Daniel V. I've been wrestling this for a while. I rebuilt the project and everything works, now I can move on to the next step.
See my thought was that the services-config.xml was used during runtime, but now I know that build time is where the magic happes.
Thanks again,
Samuel M.