Building Content-Rich Java Apps in the Cloud with the Alfresco API

Post on 13-May-2015

6,289 views 2 download

Tags:

description

This presentation, originally delivered at JavaOne on October 2, 2012, talks about why you should use Alfresco instead of rolling your own content repository and discusses the new public Alfresco API for writing content apps that persist content to Alfresco in the Cloud.

transcript

Building Content-Rich Java Apps in the Cloud with the Alfresco APIJeff PottsChief Community OfficerApache Chemistry cmislib lead

Agenda

• What is Alfresco?• Why You Shouldn’t Roll Your Own Repo• Getting Started with the API (Demos)– Signing up for an API key– Hitting the API with a REST client– Doing something simple but useful with Java

• Brief Intro to CMIS• Guidelines/Tips• Re-cap and What You Should Do Next

1enterprise content management platform across cloud, on-premise or both

API for content apps that can run in the cloud, on-premise or both

content hub for your enterprise tablets

cloud on-premise hybrid cloud sync

What is Alfresco?

2,200 enterprise customers

66 countries

6.6 million users

3.3 billion documents managed

For users: Accesscontent on any device,with any content tool, anywhere

For organizations: Manage and control company content, with whatever level of security, customization, integration or workflow is required

For developers: Target 1 standards-based API

Benefits

Open Sourcefree access to source code for developers

Open StandardsWebDAV, CIFS, SharePoint Protocol, CMIS

Choiceuse any tool, any device, deploy in cloud, on-premise or both

Flexibilitycustomizable, extensible, easily integrated

How do we deliver?

A Few Random Examples

• Contract negotiation, creation, & review

• Press request/fulfillment• Board room/B2B collaboration• Field sales collateral creation &

communication• Customer file sharing• University course guide

authoring/publishing

Source: eqqman

Document-Related Pain

Not so fast, Ryan

Gosling!

DIY: Relational May Not Cut It

• Relational is good at text and numbers. Binary data? YMMV

• Size limits• Random seek (streaming)• Search: Some relational databases

can index into blobs, but not all

And what about…

• Security framework• Search• Business

Process/Workflow Engine

• Transforms/Extractions/Renditions

• Scheduled jobs• WebDAV, CIFS, FTP or

other authoring integrations

• Versioning• Check-in/Check-out• Remote API• Replication• Social features• Mobile access• Custom code to

integrate all of these subsystems

Sourc

e:

gobuck

s2

What Have We Done?

Alfresco API

Alfresco Content Platform

• Our Apps, Your Apps, Third-Party Apps

• Any device• One API• On-Premise, in the

Cloud, or Both• Open Source

(LGPLv3)Sync

Repository + Services

Repository

• Hierarchical collection of typed nodes– Folders, Documents, Contracts, Resumes

• Nodes may have content associated with them

• Metadata• Secured• Searchable

Services

• Embedded workflow (Activiti)• Transformations• Rules• Versioning• Many more

API Options

• Alfresco’s “foundation” API is Java• Server-side JavaScript is also an

option• Remote APIs– CMIS - Atom REST or SOAP– HTTP REST Webscripts - Java or

JavaScript

• Alfresco Cloud API– Launched October 2!

Source: 96dpi

Alfresco API

Alfresco API & SDK

• What are we announcing?– New public API for Alfresco in the Cloud• Based on CMIS (AtomPub) and Alfresco REST

(JSON)

– Alfresco Mobile SDK• iOS and Android client SDKs• Wrap the new Cloud API and the existing on-

premise API• Coming soon!

Alfresco API Launch Partners

LET’S SEE HOW THIS WORKS!

Alfresco Cloud UI

Alfresco Mobile

Developer Portalhttp://developer.alfresco.com

http://youtu.be/TdAFYy0QttU

User grants access

Sign up for an API key

How OAuth2 Authentication Works

Assigns you a consumer key

and secret

Application Alfresco End-User

Invokes the Authorize URL Asks the user

for permission

Redirects to your app’s

callback URLGrabs the

returned code

Exchanges the code for an

access token Returns an access token

and expirationAdds the token to Authorization

header

Not shown: Refresh after access token expiration

Example: Hitting the REST API

http://youtu.be/5QS0CNsPJEY

Alfresco REST API

• Sites– Members– Favorites

• Networks• People• Containers• Activities• Ratings• Comments• Tags

List will expand over time

So what is CMIS, anyway?

What is CMIS?

• Content Management Interoperability Services

• Language-independent, vendor-neutral API for content management– CRUD functions for nodes– Check-in/check-out– Associations– Permissions (Access Control Lists)– Policies– Queries– Repository traversal

The Beauty of CMIS

?

Presentation Tier

Content Services Tier

?Enterprise Apps Tier

REST SOAP

• Open Source implementations of CMIS

• Apache Chemistry is the umbrella project for all CMIS related projects within the ASF– OpenCMIS (Java, client and server)– cmislib (Python, client)– phpclient (PHP, client)– DotCMIS (.NET, client)

CMIS & Apache Chemistry in Action

• Everything you need to know about CMIS 1.0 & 1.1

• Lots of Groovy and Java examples

• Also covers Python, Android, & iOS

• Now on MEAP!• 37%-off: 12cmisal

Example: Create, Find and Comment on a Document with Java

Screenshot, TBD

http://youtu.be/1ZtmoPdCKJI

Things to Consider

• Rate limits– 5 requests/second, 10,000 requests/day

(Dev)– 50 requests/second, 100,000 requests/day

(Prod)

• No limit on # of applications• Alfresco Cloud users own their

content• OpenCMIS 0.8.0-SNAPSHOT• cmislib 0.5.1dev

Where to Get Help

• Alfresco API forum• #alfresco on freenode IRC• Alfresco Technical Discussion Google

Group• http://code.google.com/p/alfresco-api-j

ava-examples

• http://code.google.com/p/alfresco-api-python-examples

• Come by the booth!

RECAP

Alfresco as a Content Platform• Alfresco is an open source ECM

platform– Repository + Services + API

• Choice throughout the stack• Flexibility in deployment options• Standards-based API– CMIS AtomPub + Alfresco REST

• Register your application at developer.alfresco.com

Register AppCloud Account

Sign up for afree 10GB Alfresconetwork in the cloud.

Your Next Steps

Participate

Join our community of developers at forums.alfresco.com, in IRC, and on Twitter

Become a Registered Developer at developer.alfresco.com

Grab your app key and secret

Berlin, GermanyNovember 6 &

7

San Jose, CaliforniaNovember 14 & 15

http://www.alfresco.com/devcon

Join Our Communityhttp://wiki.alfresco.com/wiki/Local_Communities

For More Information…

• Alfresco Developer Portal– http://developer.alfresco.com

• Alfresco Forums– http://forums.alfresco.com

• Alfresco Wiki– http://wiki.alfresco.com

• Alfresco Blogroll– http://blogs.alfresco.com

• ECM Architect Blog– http://ecmarchitect.com

My Contact Info…Jeff Potts

Email:jeff.potts@alfresco.com

Twitter/Skype:jeffpotts01