Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Dev Con 2011
1. Alfresco iOS Mobile
Application Details and Design
Mike Hatfield - Senior Engineer, Mobile Team
Marc Dubresson - Director of Mobile Products
2. Who are we?
Marc Dubresson
• Mobile Product Management
Gavin Cornwell
Mike Hatfield
• Alfresco Mobile Development Core Team
Zia
• Outsourced Mobile Development Partner
• Platinum Alfresco Professional Services & OEM Partner
5. Architecture Overview
Mostly a CMIS application talking to Alfresco
Several features specific to Alfresco
Alfresco
CMIS
REST
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. 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. Design
• Universal binary
• Hierarchy of Table Views
• Navigation based app for browsing CMIS repositories
• Layered on Alfresco specific functionality
9. Designed for the iPad
• Navigation based app but with iPad-specific view controllers
• Split View Controller
• Still a universal binary
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. 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. 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. Tools for iOS Development
Mac with OS X Snow Leopard or Lion
XCode 4.2
• Integrated Development Environment
• Integrated Build System
• Debugger
• Interface Builder
• iOS Simulator
Instruments
• Performance and behaviour analysis
16. Getting Started
Create an iOS developer account (free)
Install the latest version of XCode 4.2 (free)
Clone the repository
• git clone https://ziadev@bitbucket.org/ziadev/alfresco-mobile.git
Open the Project
19. How do I install it on my device?
See iOS Provisioning Portal Resources & How-To Guides
Sign up for a (paid) iOS Developer
Program Account
Configure profile:
Development certificate, App Id
Provision Device (UDID)
Configure & build the App for the device
22. Creating an HTTP Request
• Using ASIHTTPRequest build the request
• The delegate handles events from that request
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
26. JSON data transport
Simpler to consume than XML
Using SBJson
• Other libraries available, e.g. TouchJSON, JSONKit
• iOS 5.0 supports JSON natively
Parses into NSDictionary and NSArray objects
CMIS 1.1 will contain a Browser Binding
27. What do I need to know?
• Objective-C
• cocoadevcentral.com/d/learn_objectivec
• iOS App Programming
• developer.apple.com
• Alfresco RESTful API
• wiki.alfresco.com
• CMIS AtomPub Binding
• wiki.alfresco.com/wiki/CMIS
• Git
• gitref.org
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. 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. Open Source Availability
Hosted on Bitbucket
bit.ly/alf-mobile
Search for “alfresco-mobile” at bitbucket.org
Released under the Mozilla Public License Version 1.1
31. How Do I Contribute?
Step-by-step example for forking and sending a pull request:
http://bit.ly/pbIDRk (atlassian.com wiki)
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
• http://icepla.net
Also: Twitter, StackOverflow
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? > marc.dubresson@alfresco.com