5 Replies Latest reply on Mar 30, 2010 9:36 AM by sysguy

    Drupal and Flex!

    rfikki99999

      How do I get Drupal and flex working?

       

      I have drupal installed. I have Services and AMFPHP working correctly.

       

      How exactly do you get Flashbuilder 4 to access and retrieve data from drupal. I have seen and tried several methods used on the web.

      None of them seem to work. Am i missing something. I know that my setup is okay. I used a prebuilt module on drupal to test and it seems to work.

      Unfortunately the modlule uses some class and swf files that do not show how the actual connection is made. The module is DruTalk.a chat program.

       

      In Flashbuilder whenever I place my remote directory and URL in the dataconnection it rejects it. Can you only place localhost and directories on the local machine in the data/services connection? How do I get this working?

        • 1. Re: Drupal and Flex!
          sysguy

          Hi newbie here,

          I am having the same problem using Flash Builder 4 to create a simple application for Drupal.  Some hints would be great.  I tried the various methods on the web as well with no success.

           

          My application works fine in a normal html page, the problem comes when I try to display it through Drupal. My application uses a PHP data service to connect to an external database and display the results in a datagrid.  Here is what happens:

          1. I upload my .swf file using the drupal "Flash Node" module. This places the .swf in the 'http://.../sites/default/files/flash/' path of my site

          2. When I view the node, the application (a datagrid) displays but contains no data.

          3. I receive the error "Send failed Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://.../sites/default/files/flash/gateway.php'

           

          My assumption is that I need to get Flash Builder 4 to reference the Drupal AMFPHP gateway file instead of the one created by the Flash Builder 4 'Export Release Build' functionality.  I cannot figure out how to do this. Seems like a simple problem but it is driving me crazy.

           

          The steps I followed so far are:

          1. Installed and enabled the Drupal Services and AMFPHP modules including the AMFPHP code from amfphp.org on my Drupal site.

          2. Built a project in Flash Builder 4 that uses PHP data service to access an external MYSQL database

          3. Created a services-config.xml file and placed it into the my project's services directory.  This was done according the directions at http://groups.drupal.org/node/2768

          4. Change the compile arguments to reference the services-config.xml file: -locale en_US -services      "c:\Documents and Settings\administrator\Adobe Flash Builder      4\testproject2\services\services-config.xml"

          5.Exported the project using Flash Builder 4 'Export Release Build'

          6. Copied the php data service file and services-config.xml file to the 'modules/amfphp/amfphp/services' of my Drupal installation

          7. Created a flash node and uploaded my project's .swf file.

          8. Received the error as stated above: "Send failed Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url: 'http://.../sites/default/files/flash/gateway.php'

          9. I also tried copying the gateway.php file from 'modules/amfphp/amfphp' to 'sites/default/files/flash' and that just resulted in the error: 'Channel.Connect.Failed error NetConnection.Call.BadVersion: : url:'

           

          Any help would be GREATLY appreciated.  Also, do I need to place the Zend library somewhere in my Drupal site as well.  Flash Builder 4 exports it as well as a bunch of other files and I am not sure what I need and how to reference it.

           

          Thanks,

          Mike

          • 2. Re: Drupal and Flex!
            rfikki99999 Level 1

            Did you try the following http://www.yoursite.com/services/amfphp as the endpoint URL

             

            Let me know if this works cause then maybe you can asssist me in trying to get mine working.

             

            I am actually trying to use CRUD with data that is part of Drupal...

            • 3. Re: Drupal and Flex!
              sysguy Level 1

              Did you try the following http://www.yoursite.com/services/amfphp as the endpoint URL

               

               

              I did try this only in the 'services-config.xml' file that I placed in the 'html/modules/amfphp/amfphp/services' of my Drupal installation.   Should I have done this somewhere else?   Also, it is the only thing I actually changed in that file from the example.

               

              I configured the file according to the directions at http://groups.drupal.org/node/2768 but still no luck.  Here is the contents of my 'services-config.xml' file (with my site filled in of course) but perhaps I did something wrong:

               

              <?xml version="1.0" encoding="UTF-8"?>
              <services-config>
                <services>
                  <service id="amfphp-flashremoting-service"
                               class="flex.messaging.services.RemotingService"
                               messageTypes="flex.messaging.messages.RemotingMessage">
                          <destination id="amfphp">
                              <channels>
                                  <channel ref="my-amfphp"/>
                              </channels>
                              <properties>
                                  <source>*</source>
                              </properties>
                          </destination>
                      </service>
                  </services>
              
                  <channels>
                      <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
                          <endpoint uri="http://www.mysite.com/services/amfphp" class="flex.messaging.endpoints.AMFEndpoint"/>
                      </channel-definition>
                  </channels>
              </services-config>
              

              • 4. Re: Drupal and Flex!
                rfikki99999 Level 1
                function(){return A.apply(null,[this].concat($A(arguments)))}

                http://www.youtube.com/watch?v=x-Da1SD1Ykk
                Have you seen this series. Not really for drupal though.

                • 5. Re: Drupal and Flex!
                  sysguy Level 1

                  Thanks for the video link.  I had no problems accessing the database (CRUD) after building it in Flash Builder and deploying in a 'normal' embedded HTML environment.  Let me know if you need some specifics on this, it worked fairly easily for me through Flash Builder.

                   

                  My problem is getting data services to work through Drupal.  The swf file will display the Flex UI on a node but it will not populate the data.  It does not seem to be referencing the proper location for the gateway.php file and I can't get any further.  This may be a simple path setting problem but I cannot figure it out.

                   

                  Let me know if you have any thoughts.  We also might want to move this discussion to the Flex forum. 

                   

                   

                  Best,

                  Mike