plat-18 alfresco ios mobile application details and design

34
Alfresco iOS Mobile Application Details and Design Mike Hatfield - Senior Engineer, Mobile Team Marc Dubresson - Director of Mobile Products

Upload: alfresco-software

Post on 07-Nov-2014

2.331 views

Category:

Technology


3 download

DESCRIPTION

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!

TRANSCRIPT

Page 1: PLAT-18 Alfresco iOS Mobile Application Details and Design

Alfresco iOS Mobile Application Details and Design"

Mike Hatfield - Senior Engineer, Mobile Team"Marc Dubresson - Director of Mobile Products"

Page 2: PLAT-18 Alfresco iOS Mobile Application Details and Design

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"

Page 3: PLAT-18 Alfresco iOS Mobile Application Details and Design

Agenda"

•  Today’s News •  Architecture Overview •  CMIS Refresher •  Demo •  Technical Walkthrough •  Open Source Project •  Roadmap •  Questions?

Page 4: PLAT-18 Alfresco iOS Mobile Application Details and Design

Alfresco Mobile 1.1"

Page 5: PLAT-18 Alfresco iOS Mobile Application Details and Design

Architecture Overview"

Mostly a CMIS application talking to Alfresco Several features specific to Alfresco

Alfresco  

CMIS  

REST  

Page 6: PLAT-18 Alfresco iOS Mobile Application Details and Design

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)"

Page 7: PLAT-18 Alfresco iOS Mobile Application Details and Design

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"

Page 8: PLAT-18 Alfresco iOS Mobile Application Details and Design

Design"

• Universal binary"• Hierarchy of Table Views"• Navigation based app for browsing CMIS repositories"• Layered on Alfresco specific functionality"

Page 9: PLAT-18 Alfresco iOS Mobile Application Details and Design

Designed for the iPad"

•  Navigation based app but with iPad-specific view controllers "•  Split View Controller"•  Still a universal binary"

Page 10: PLAT-18 Alfresco iOS Mobile Application Details and Design

CMIS AtomPub Binding (XML)"

Page 11: PLAT-18 Alfresco iOS Mobile Application Details and Design

Alfresco REST API (JSON)"

Page 12: PLAT-18 Alfresco iOS Mobile Application Details and Design

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"

Page 13: PLAT-18 Alfresco iOS Mobile Application Details and Design

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"

Page 14: PLAT-18 Alfresco iOS Mobile Application Details and Design

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*’)!

Page 15: PLAT-18 Alfresco iOS Mobile Application Details and Design

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"

Page 16: PLAT-18 Alfresco iOS Mobile Application Details and Design

Getting Started "

Create an iOS developer account (free)

Install the latest version of XCode 4.2 (free)

Clone the repository • git clone https://[email protected]/ziadev/alfresco-mobile.git"

Open the Project

Page 17: PLAT-18 Alfresco iOS Mobile Application Details and Design

Multiple Targets in the Project"

Two Targets: Alfresco & Fresh Docs

Page 18: PLAT-18 Alfresco iOS Mobile Application Details and Design

Build and Run"

Select a target and the iOS Simulator to Use

Page 19: PLAT-18 Alfresco iOS Mobile Application Details and Design

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

Page 20: PLAT-18 Alfresco iOS Mobile Application Details and Design

I Thought This Was A DevCon?"

AlfrescoAppDelegate.h

Page 21: PLAT-18 Alfresco iOS Mobile Application Details and Design

Calling an AtomPub Service"

CMIS  RESTful  Request  

AtomPub  XML  

Alfresco  

Page 22: PLAT-18 Alfresco iOS Mobile Application Details and Design

Creating an HTTP Request"

•  Using ASIHTTPRequest build the request

•  The delegate handles events from that request

Page 23: PLAT-18 Alfresco iOS Mobile Application Details and Design

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"

Page 24: PLAT-18 Alfresco iOS Mobile Application Details and Design

NSXMLParser & NSXMLParserDelegate"

Setting up NSXMLParser

NSXMLParserDelegate methods

• – parser:didStartElement:namespaceURI:qualifiedName:attributes:"• – parser:didEndElement:namespaceURI:qualifiedName:"• – parser:foundCharacters:"

Page 25: PLAT-18 Alfresco iOS Mobile Application Details and Design

Calling Alfresco REST APIs"

RESTful  HTTP  Request  

JSON  

Alfresco  

Page 26: PLAT-18 Alfresco iOS Mobile Application Details and Design

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

Page 27: PLAT-18 Alfresco iOS Mobile Application Details and Design

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"

Page 28: PLAT-18 Alfresco iOS Mobile Application Details and Design

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."

Page 29: PLAT-18 Alfresco iOS Mobile Application Details and Design

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)"

Page 30: PLAT-18 Alfresco iOS Mobile Application Details and Design

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

Page 31: PLAT-18 Alfresco iOS Mobile Application Details and Design

How Do I Contribute?"

Step-by-step example for forking and sending a pull request: http://bit.ly/pbIDRk (atlassian.com wiki)

Page 32: PLAT-18 Alfresco iOS Mobile Application Details and Design

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

Page 33: PLAT-18 Alfresco iOS Mobile Application Details and Design

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? > [email protected]"

Page 34: PLAT-18 Alfresco iOS Mobile Application Details and Design

Q & A"