Share
Embed
Solving Business Problems with Content-as-a-Service
Introduction to Alfresco Public APIs.
Presented at the Kansas City Developers Conference, 2013.
Richard Esplin
May 04, 2013
Transcript
49 slides
-
Agenda • Introducing Alfresco • Making the case for content
management • Best practices: standards and platforms • Leveraging the Alfresco Public API • Live example -
Alfresco by the numbers 4 billion files 7 million users
3,000 companies 180 countries -
How do we deliver? Tablet First Focused on enabling the
content device of the future. Open Source Free access to the source code for developers. Open Standards WebDAV, CIFS, SharePoint Protocol, CMIS. Choice Any tool, any device, in the cloud, on-premise, or both. Flexibility Customizable, extensible, and easy to integrate. -
Business Problems Often Involve Content Data • Don't mistake Code
for Content Unstructured Data • Structured data works well in a relational data store, XML store, or key-value store Unstructured Binary Data • Unstructured non-binary data works well in source control Examples: • Audio, Video, Images, Office Documents, Engineering Files, Reports -
The business is saying . . . I've got a
ton of files, I've got people that produce and consume them, I've got systems that use them, I want to make it easier! -
A Few Examples Contract negotiation, creation, and review Case management
Sales / Marketing collateral creation and distribution Media management and distribution Architectural plan creation, review, and archiving Loan processing Invoicing -
DIY approach seems simple . . . “This is simple
stuff.” Grab a web-application toolkit Favorite front-end / presentation framework Store a bunch of files Relational Database • Data Model / Metadata • Comments / Ratings • Tagging / Categorization -
Relational may not cut it Good at text and numbers.
Not so good at binary. Good at static table definitions. Not so good at dynamic aspects. Size limits. Random seek (streaming). Search: Some relational databases can index into blobs, but not all. -
Once files are figured out . . . Ensure security
Execute a workflow Transform the content between types Schedule a job Provide shared drive access Versioning Replication API Access Integrate with authoring tools Lots of custom code! -
Platform approach The common problems have been solved Content Platform
= Repository + Services • Find a platform that meets your needs • Extend the platform with your own business logic • Customize the UI that the platform provides • Or write your own front-end using whatever language or framework makes sense Meets your current needs while providing a roadmap for the future -
Introducing the content repository Content = a file + metadata
File system • Content binaries • Search indexes Database • Relations (associations) • Metadata Repository • Abstraction layer -
Components of content-centric systems User Interface Persistence / Data Model
/ Metadata Business Process / Workflow Library Services (Upload / Download, Versioning, Check-in / Check-out) Security Search Scheduler Transformation / Rendition / Thumbnails Tagging / Categorization Authoring tool integration Remote API Transfer / Publication Comments Ratings Activity Streams / Notification Quotas -
Evaluating content platforms Agility • Applicable to a broad set
of solutions vs a vertical specific solution • Scale up, scale down Developer ergonomics • Fast and friendly developer model Open Source • Troubleshooting • Bug tracking • Community Standards compliance • Easier integration • Lower migration costs • Developer familiarity -
General architecture Web Applications Knowledge Portals Web Services Virtual File
System High Availability Business Process Engine CRM Portal Server App Server -
Desktop Mobile Social Media Channels Web Services Public Alfresco Cloud
Corporate Systems Open Web APIs CMIS JSR-168 Connectors WebDAV CMIS CIFS SharePoint Protocol Open Web APIs CMIS CMIS-based Alfresco Sync CMIS WebDAV -
Alfresco APIs Repository customizations are Java + XML Server-side Javascript
works for many tasks Remote API • Public API = CMIS + REST • Custom API: Webscripts – Javascript or Java Source: 96dpi -
What is CMIS? Content Management Interoperability Services Language-independent, vendor-neutral API
for content management Least-common-denominator (some vendors have extensions) • CRUD functions for nodes • Check-in / check-out • Associations • Permissions (Access Control Lists) • Policies • Queries • Repository Traversal -
What is CMIS? OASIS standard • 30+ ECM vendors agreed
to implement Two parts • Interoperability through standard SOAP and AtomPub bindings – JSON bindings coming soon • SQL-based query language for rich content repositories Vendor specific extensions may be useful -
Use cases Collaborative content creation Portals Client application Integration Mashups
Embedded content store Client Content Repository Content Repository Content Repository Client Content Repository Content Repository Content Repository Workflow & BPM Archival Documents generation Digital Asset Management (DAM) Web Content Mangaement (WCM) -
The beauty of CMIS ? Presentation Tier Content Services Tier
? Enterprise Apps Tier REST SOAP -
Meet CMIS Client Content Repository Services Domain Model read write
Consumer Provider Vendor Mapping Content Management Interoperability Services CMIS lets you read, search, write, update, delete, version, control, … content and metadata! -
Types Document • Content • Renditions • Version History Folder
• Container • Hierarchy • Filing Relationship • Source Object • Target Object ACL • Target Object Described by Type Definitions Policy • Target Object -
Type Definitions * Custom Type Object • Type Id •
Parent • Display Name • Queryable • Controllable Document • Versionable • Allow Content Folder Relationship • Source Types • Target Types Policy Property • Property Id • Display Name • Type • Required • Default Value • … -
Apache Chemistry Open Source implementations of CMIS Umbrella project for
all CMIS related projects within the ASF • OpenCMIS (Java, client and server) • cmislib (Python, client) • phpclient (PHP, client) • DotCMIS (.NET, client) De-facto reference for CMIS and used by CMIS technical committee to test 1.1 features -
Folder, file, content and metadata manipulation and search Networks, sites,
people, comments, tags, activities, … -
Getting Started 1. Understand OAuth2 2. Register for developer keys
3. Grab a client-side CMIS library or mobile SDK 4. Start coding! -
Step 1: Groking OAuth2 Defined in RFC-6749 Secure authentication •
3rd party apps don't ever see the user's password Unambiguously identifies: • API provider (e.g. Alfresco) • Client application (e.g. your application) • End-user (e.g. an Alfresco Cloud user) "3 Legged Authentication" -
tl;dr: Use a library Google OAuth2 Client (lots of languages)
https://developers.google.com/accounts/docs/ OAuth2#libraries Spring Social (Java) http://www.springsource.org/spring-social -
Step 2: Register Your App http://www.alfresco.com/develop • Alfresco Cloud Account
• Registered Developer Account Add as many applications as you want Key, secret, callback URL -
Step 3: CMIS Library OpenCMIS (Java, client and server) cmislib
(Python, client) phpclient (PHP, client) DotCMIS (.NET, client) ObjectiveCMIS (Objective-C) Other client libraries exist -
Considerations Rate limits • Dev: 5 requests / second, 10,000
requests / day • Prod: 50 requests / second, 100,000 requests / day No limit on number of applications Alfresco Cloud users own their content -
Python # Download Jeff Pott's Python example git clone https://code.google.com/p/alfresco-api-python-examples/
cloud-demo # Setup Environment cd cloud-demo virtualenv . ./bin/pip install oauth2client ./bin/pip install keyring ./bin/pip install cmislib cp client_secrets.json.sample client_secrets.json [Sign-up at http://developer.alfresco.com] [Create an App] [Callback URL: http://localhost:8080/] [Copy into client_secrets.json your API Key and API Secret] ./bin/python ./get_sites_example.py [Login through the web browser] ./bin/python ./cmis_repository_info.py [No login needed] [Edit cmis_create_document.py: NETWORK, SITE, FOLDER_NAME, FILE] ./bin/python ./cmis_create_document.py -
Where to learn more Developer Portal: APIs, SDKs, developer keys
• http://developer.alfresco.com Alfresco API forum • http://forums.alfresco.com/forum/developer-discussions /alfresco-api #alfresco on freenode IRC Alfresco Technical Discussion Google Group • http://groups.google.com/group/alfresco-technical-discussion DevCon Session • https://devcon.alfresco.com/sanjose/sessions /alfresco-cloud-api-part-one -
Alfresco Summit Barcelona, Nov 4 - Nov 7 Boston, Nov
12 - Nov 15 http://summit.alfresco.com Pre-conference training day. Technical presentations for the developers Business oriented discussions. Demos, use cases, best practices, and more. -
Attribution and Licensing Copyright 2013, Alfresco Software Some images used
in this presentation are licensed under the Creative Commons by- attribution non-commercial share-alike license. Original work in this presentation is licensed under the Creative Commons by-attribution license. Thanks to Jeff Potts for allowing me to base my presentation on his.