[2024]Digital Global Overview Report 2024 Meltwater.pdf
Drupal And Flash Platform hybrid applications
1. Drupal and Flash Platformhybrid applications Pacific North West Drupal Summit 10/24/2009 Josh Kopel
2. Hybrid application Drupal provides a powerful way to source and manage data for SWF applications Flash player provides a “rich” environment for advanced interactions Multi-touch Desktop migration (Air) iPhone (!)
5. Why call it SWF “Flash platform” Anything that compiles to the SWF format for playback within the Flash Player Flash Flex Flash has often meant animation. We are talking about true applications.
7. Overview of SWF Drupal Drupal Browser Services Module HTML Page Server Module Flash Player Un/serialization AS3 Application Code Auth. Module Un/Serialization Classes Service (Module)
8. Services means Reusable data (SWF or AJAX) Provide the same “site” to multiple client technologies Data is available at either end in the same format via serialization Objects Arrays Number types Strings
9. The Drupal side Services module Authentication module(s) Service module(s) Server module(s) External (un)serialize code (i.e. AMFPHP)
10. The Drupal side Drupal Services Module Server Module Un/serialization Auth. Module Service (Module)
11. Services Module An API for remote applications Provides end point for service calls Wraps server and service modules in a standard API Supports multiple authentication methods* *We can hazoauth?
13. Server modules Provide wrappers for specific languages or serialization methods AMF (Adobe Message Format) XMLRPC JSON REST SOAP etc.
14. Custom service modules Provide access to any Drupal function Provide SIMPLER access to nodes Parse the data on the server side Only send the data needed by the flash app
15. Authentication API Keys Make a unique key based upon an application name and domain SWF must pass the hashed key back in order to authenticate Key must be embedded in or passed to Flash player
16. Authentication Session based Use standard Drupal HTML login Pull session ID into SWF via javascript using flash.external.ExternalInterface Via PHP using custom PHP Use existing session for service calls
17. Authentication Session based Use system.connect() to return an anonymous session ID Pass that back on any service call (logged in as anonymous) Or call user.login with a username/password + session ID Embedded Requested Receive a authenticated session ID
18. The SWF side All calls brokered by the browser Restricted by player security sandbox (learn about crossdomain.xml) Receive startup parameters from flashVars Manipulate DOM through externalInterface
19. The SWF side Browser HTML Page (DOM) Flash Player AS3 Application Code Un/Serialization Classes Flash Vars JS
20. Development methodology AS3 is “stateful”, asynchonous, & event driven learn the language and use a good framework pureMVC robotlegs Existing open source classes are available for almost any protocol
21. Review authentication needs Do you need to save data or register users? Can you request a username/password? In html In SWF
22. Review protocol choices AMFPHP Binary protocol means it is fast and compact Not “human readable” Adobe specific (natively parsed) XML Text based protocol can get verbose Easier to debug JSON Text based protocol can get verbose Can be easily consumed by AJAX or other services
23. Debugging Get the debug player (www.adobe.com/support/flashplayer/downloads.html) Charles Proxy (charlesproxy.com) LiveHTTPHeaders (livehttpheaders.mozdev.org/) Flash Tracer for FF (www.sephiroth.it/firefox/flashtracer/)