Tutorial building custom tools


Published on

Slides to accompany this post: http://www.dekho.com.au/how-to-build-custom-tools-for-dekho/

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Tutorial building custom tools

  1. 1. Developing Custom Tools
  2. 2. Agenda...• Dekho Architecture• Custom Tools Overview• Communication & Working with the Esri Flex API• Working with the Dekho Web Services API• Consideration and Best Practices
  3. 3. Dekho Architecture Overview
  4. 4. Dekho Geo-App PortalDekho Application Manager Geo-App publishing Roles and access rights definition Dekho Application Manager Geo-App configuration Map Services Spatial Information Corporate data Web Services Tools Gallery Report Gallery Search Tasks
  5. 5. Custom Tools Overview
  6. 6. The Basics• A way of customising Dekho• Built as a .swf file which runs alongside Dekho Parent Application Dekho Custom Tool Flash Runtime
  7. 7. The process• Write (SWF)• Deploy (Application Server i.e. Tomcat)• Add a button (Dekho Studio)
  8. 8. Start-Up sequenceClient Browser Application Server Dekho Server URL Dekho Page Dekho swf Dekho UI Tool ‘A’ click (URL to swf on server) Tool A Tool ‘A’ swf Tool B Tool C
  9. 9. In memory… now what?Client Browser Application Server Dekho Page Option 1: Do you thing… clean up and Dekho UI destruct Dekho UI Option 2: Tool A Persist and clean up on Tool A - Dialogue close or… Tool B - Second click or… - App shut down Tool C
  10. 10. Second click – unload…Client Browser Application Server Dekho Page Dekho UI Dekho UI Tool A Tool A Tool B Tool C
  11. 11. What can you use a custom tool for?• Launching another browser application• Launching another client side desktop application• Creating a custom workflow• Change layers, extent, selection…• Loading WMS layers
  12. 12. Deploy….. • Deploying your tool means making it available within the application server i.e. tomcat • Common practice to add your custom too to the root of the same domain as DekhoDecember 10 // www.esriaustralia.com.au
  13. 13. Add….. • Add tool to Dekho via Dekho Studio • Complete Tool WizardDecember 10 // www.esriaustralia.com.au
  14. 14. Use…. • Custom tool available on main Dekho InterfaceDecember 10 // www.esriaustralia.com.au
  15. 15. Building your first “Hello world” custom tool
  16. 16. Communication & Working with the Esri Flex API
  17. 17. How does my custom tool interact with Dekho?• Broadcast out to the parent application i.e. browser• Receive messages from Dekho• Send messages to Dekho• Communicate with Dekho via the Services API• Communicate with any web services
  18. 18. Broadcast out to the parent application• Parent application can control Dekho• Parent application can receive messages from Dekho JavaScript or C# client stubs provided
  19. 19. Working with the Dekho application• Listening to messages• API methods made public by Dekho SWF
  20. 20. Intercepting messages from Dekho• messageFromDekho Function. Dekho broadcasts the event as E.g: <eventtype>,<sessionid> Session, 125482993879
  21. 21. parentApplication• The Dekho SWF element that loads your custom tool
  22. 22. Working with the Esri Flex API 1 2December 10 // www.esriaustralia.com.au
  23. 23. Working with Dekho selection and the Esri Flex API
  24. 24. Working with the Dekho Web Services API
  25. 25. Using Dekho Services APIParent Application Dekho Custom ToolFlash Runtime Dekho Services API
  26. 26. The Process• Create channel and remote object• Get Session Information from parentApplication• Use session information to call Dekho Web Services API
  27. 27. Example: Saving selection as a redline Client Browser Application Server Dekho Page Establish AMF Channel Dekho UI DrawRedlines Get SessionIn Refresh Map ClearSelection SaveBookmark Tool A
  28. 28. Using the Dekho Services APIYou are responsible for creating and opening a channel.Your responsible for creating a remote object to the correct service i.e.“SessionService”Finally make the call to the Dekho Services and specify the response handlers
  29. 29. Working with Dekho Web Service API
  30. 30. Custom Tool Summary• Dekho’s client extensibility model.• Ways to communicate with Dekho and the parent application: – Broadcast out to the parent application – Dekho Flex API + Receive & Send messages – Communicate with the Dekho Services API• Your custom tool can use the Esri Flex API• Your custom tool can use the Dekho Web Services API
  31. 31. Considerations and Best Practices
  32. 32. Code…• messageFromDekho Function. Mandatory method!!
  33. 33. Clean-up practice
  34. 34. The Dekho Simulator & Debugging• Simulator is a test harness for custom tools• Please refer to documentation• Don’t forget: – Server Address URL and Tool URL – Map Service Address• Simulator is limited – mock as necessary
  35. 35. Handling web services• Tell the user when you’re waiting• Chose the right channel (for performance and environment)• Assign fault handler functions for service calls
  36. 36. Security• Security – Cross Domain – understanding if your tool needs to pull data from another source
  37. 37. Maintenance & Deployment• Maintenance – Make your tool portable, configure external Web Services URL address – Flex SDK version – Esri Flex API version• Deploying into a scaled environment
  38. 38. Product Information:www.esriaustralia.com.au/dekhowww.esriaustralia.com.au/dekhohelpwww.esriaustralia.com.au/dekhoblog