PLAT-18 Alfresco iOS Mobile Application Details and Design


Published on

In this session, we will explain how the Alfresco iOS Mobile Application was designed and developed. We’ll focus on the implementation details including the CMIS client, when the application talks directly to Alfresco API’s and some details, tips and tricks for Objective-C iOS development. You’ll learn the Open Source project hierarchy including how to modify, build and run the application. You’ll also learn about our future plans for the application and the project, and perhaps become a contributor yourself!

Published in: Technology, Education
  • 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

PLAT-18 Alfresco iOS Mobile Application Details and Design

  1. 1. Alfresco iOS Mobile 
Application Details and Design" Mike Hatfield - Senior Engineer, Mobile Team" Marc Dubresson - Director of Mobile Products"
  2. 2. Who are we?"Marc Dubresson •  Mobile Product Management"Gavin CornwellMike Hatfield •  Alfresco Mobile Development Core Team"Zia •  Outsourced Mobile Development Partner" •  Platinum Alfresco Professional Services & OEM Partner"
  3. 3. Agenda"•  Today s News•  Architecture Overview•  CMIS Refresher•  Demo•  Technical Walkthrough•  Open Source Project•  Roadmap•  Questions?
  4. 4. Alfresco Mobile 1.1"
  5. 5. Architecture Overview"Mostly a CMIS application talking to AlfrescoSeveral features specific to Alfresco CMIS   Alfresco   REST  
  6. 6. CMIS Refresher"CMIS Technical Committee Goals & Scope • Content Management Interoperability Services" • Enable applications to target different ECM repositories uniformly" • Provide a set of basic services enabling richer ECM applications and use cases" • All for loose coupling of an ECM application on the underlying repository" • Use popular protocol bindings" •  REST / AtomPub" •  Web Services / SOAP" •  v1.1 - JSON (Browser Binding)"
  7. 7. Demo"Alfresco Mobile in Action – A Few Features • CMIS: " •  Login to Alfresco over HTTP or HTTPS" •  Browse, Search, Display Content and Edit Metadata, Upload Files" •  Create Folders" • Alfresco" •  Activities" •  Like & Unlike" •  Comment on Documents" • iOS" •  Local Downloads" •  Open In... support to/from other apps"
  8. 8. Design" • Universal binary" • Hierarchy of Table Views" • Navigation based app for browsing CMIS repositories" • Layered on Alfresco specific functionality"
  9. 9. Designed for the iPad" •  Navigation based app but with iPad-specific view controllers " •  Split View Controller" •  Still a universal binary"
  10. 10. CMIS AtomPub Binding (XML)"
  11. 11. Alfresco REST API (JSON)"
  12. 12. App Launch / Sites / Browse" •  iOS: Read user settings" •  CMIS: Retrieve AtomPub Service Document" •  Alfresco: Request Sites List" •  CMIS: Request folder children for the Root Collection" •  CMIS: Navigate into a folder or site"
  13. 13. Activities"•  Alfresco: Retrieve user s activity feed"•  User taps a document table cell" •  CMIS: Retrieve Document via getObjectByID service"•  User taps the info icon " •  CMIS: Retrieve Document Metadata using getTypeDefinition service"
  14. 14. Search"Execute a CMIS Query •  Full-text search:" • SELECT * FROM cmis:document WHERE CONTAINS( keywords )! •  Search by cmis:name:" • SELECT * FROM cmis:document WHERE CONTAINS( ~cmis:name: *keywords* )!
  15. 15. Tools for iOS Development"Mac with OS X Snow Leopard or LionXCode 4.2 • Integrated Development Environment" • Integrated Build System" • Debugger" • Interface Builder" • iOS Simulator
Instruments• Performance and behaviour analysis"
  16. 16. Getting Started "Create an iOS developer account (free)Install the latest version of XCode 4.2 (free)Clone the repository • git clone"Open the Project
  17. 17. Multiple Targets in the Project" Two Targets: Alfresco & Fresh Docs
  18. 18. Build and Run"Select a target and the iOS Simulator to Use
  19. 19. How do I install it on my device?"Sign up for a (paid) iOS DeveloperProgram AccountConfigure profile: Development certificate, App Id Provision Device (UDID)Configure & build the App for the device See iOS Provisioning Portal Resources & How-To Guides
  20. 20. I Thought This Was A DevCon?"AlfrescoAppDelegate.h
  21. 21. Calling an AtomPub Service" CMIS  RESTful  Request   Alfresco   AtomPub  XML  
  22. 22. Creating an HTTP Request"•  Using ASIHTTPRequest build the request•  The delegate handles events from that request
  23. 23. Parsing AtomPub XML"Event-Driven XML Parsing (SAX) • Parser sends messages (parsing events) to it s delegates (callbacks)"Use NSXMLParser & NSXMLParserDelegate • Recommended by Apple" • Native API" • Objective-C based implementation"Why not use the Tree-based API (DOM)? • Apple does not provide the API for iOS"
  24. 24. NSXMLParser & NSXMLParserDelegate"Setting up NSXMLParserNSXMLParserDelegate methods • – parser:didStartElement:namespaceURI:qualifiedName:attributes:" • – parser:didEndElement:namespaceURI:qualifiedName:" • – parser:foundCharacters:"
  25. 25. Calling Alfresco REST APIs" RESTful  HTTP  Request   Alfresco   JSON  
  26. 26. JSON data transport"Simpler to consume than XMLUsing SBJson •  Other libraries available, e.g. TouchJSON, JSONKit" •  iOS 5.0 supports JSON natively"Parses into NSDictionary and NSArray objectsCMIS 1.1 will contain a Browser Binding
  27. 27. What do I need to know?" •  Objective-C •" •  iOS App Programming •" •  Alfresco RESTful API •" •  CMIS AtomPub Binding •" •  Git •"
  28. 28. Common Design Patterns"Model-View-Controller • A pattern to relate the user interface to an underlying data model."Delegation • A patten where an object, the delegator, delegates tasks to an associated helper object, the delegate." • The delegate is responsible for executing the task for the delegator."Target-Action • Target-action is a design pattern in which an object holds the information necessary to send a message to another object when an event occurs."
  29. 29. API s and Libraries Used"Cocoa Touch Frameworks • The API s Apple provides to build an iOS application"ASIHTTPRequest • Wrapper around Apple s CFNetwork API"SBJson • Fast, simple & clean JSON parser and generator"ISO8601 • XML date parsing"Flurry Analytics • Remote logging for app crashes (uncaught exceptions)"
  30. 30. Open Source Availability" Hosted on Bitbucket Search for “alfresco-mobile” at! Released under the Mozilla Public License Version 1.1
  31. 31. How Do I Contribute?"Step-by-step example for forking and sending a pull request: ( wiki)
  32. 32. Resources"Apple iOS Developer Portal •  Sample Code, API Documentation, Design Guides,
 Developer Videos, etc.!"Books •  Beginning iPhone 4 Development (Apress Publishing)" •  Programming in Objective-C (Sam s Publishing)"Many Developer Blogs •"Also: Twitter, StackOverflow
  33. 33. Roadmap"Next version•  Alfresco Cloud"•  Multiple Repositories"•  ...More"Integration•  Leading productivity apps such as PDF Expert and QuickOffice"Android"Additional Alfresco Mobile Apps"What else? >"
  34. 34. Q & A"