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.
Advantages of Hiring UIUX Design Service Providers for Your Business
Building Content-Rich Java Apps in the Cloud with the Alfresco API
1. Building Content-Rich Java Apps in the
Cloud with the Alfresco API
Jeff Potts
Chief Community Officer
Apache Chemistry cmislib lead
2. 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
3. What is Alfresco?
enterprise 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
5. Benefits
For users: Access
content 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
6. How do we deliver?
Open Source
free access to source code for developers
Open Standards
WebDAV, CIFS, SharePoint Protocol, CMIS
Choice
use any tool, any device, deploy in cloud, on-premise or both
Flexibility
customizable, extensible, easily integrated
7. 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
10. 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
11. And what about…
• Security framework • Versioning
• Search • Check-in/Check-out
• Business • Remote API
Process/Workflow • Replication
Engine • Social features
• Transforms/Extractions/ • Mobile access
Renditions
• Custom code to
• Scheduled jobs integrate all of these
• WebDAV, CIFS, FTP or subsystems
other authoring
integrations
13. Alfresco Content Platform
• Our Apps, Your Apps,
Third-Party Apps
• Any device
• One API Alfresco API
• On-Premise, in the
Cloud, or Both
• Open Source (LGPLv3) Sync
Repository +
Services
14. Repository
• Hierarchical collection of typed nodes
– Folders, Documents, Contracts, Resumes
• Nodes may have content associated with
them
• Metadata
• Secured
• Searchable
15. Services
• Embedded workflow (Activiti)
• Transformations
• Rules
• Versioning
• Many more
16. Alfresco API
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
17. 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!
25. How OAuth2 Authentication Works
Application Alfresco End-User
Sign up for an Assigns you a
API key consumer key
and secret
Invokes the
Authorize URL Asks the user for
permission
User grants
access
Redirects to your
Grabs the app’s callback
returned code URL
Exchanges the
code for an
access token Returns an
access token and
expiration
Adds the token to
Not shown: Refresh
Authorization
header
after access token
expiration
27. Alfresco REST API
• Sites
– Members
– Favorites
• Networks List will expand
• People over time
• Containers
• Activities
• Ratings
• Comments
• Tags
29. 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
30. The Beauty of CMIS
Presentation
Tier
REST SOAP
?
Content
Services Tier
Enterprise
Apps Tier ?
31. • 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)
32. 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
33. Example: Create, Find and
Comment on a Document with
Java
Screenshot, TBD
http://youtu.be/1ZtmoPdCKJI
34. 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
35. Where to Get Help
• Alfresco API forum
• #alfresco on freenode IRC
• Alfresco Technical Discussion Google Group
• http://code.google.com/p/alfresco-api-java-
examples
• http://code.google.com/p/alfresco-api-python-
examples
• Come by the booth!
37. 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
38. Your Next Steps
Cloud Account Register App Participate
Sign up for a Become a Registered Join our community of
free 10GB Alfresco Developer at developers at
network in the cloud. developer.alfresco.co forums.alfresco.com,
m in IRC, and on Twitter
Grab your app key
and secret
39. Berlin, Germany San Jose, California
November 6 & 7 November 14 & 15
http://www.alfresco.com/devcon
41. For More Information…
• Alfresco Developer Portal
– http://developer.alfresco.com
• Alfresco Forums
– http://forums.alfresco.com My Contact Info…
• Alfresco Wiki Jeff Potts
– http://wiki.alfresco.com Email:
• Alfresco Blogroll jeff.potts@alfresco.c
om
– http://blogs.alfresco.com
• ECM Architect Blog Twitter/Skype:
jeffpotts01
– http://ecmarchitect.com
Notas do Editor
Alfresco is an open source Enterprise Content Management platformCan manage any kind of file, any sizeStores the file and metadataAll content and metadata is searchableFiles can be secured to specific users and groupsCMIS-compliantProvides versioning and check-in/check-outHas a built-in workflow engineCan be accessed through a browser or from desktop applications via CIFS, WebDAV, FTP, IMAP, SMTP, SharePointThree editionsCommunityEnterprise (On-Premise)Cloud
I’ve got a ton of filesI’ve got people that produce them, sometimes collaboratively, and people that consume them.I want to somehow make it easier to deal with all of this.Inability to find important contentBlack hole processRe-creating the wheelProductivity lossHigher costsUsing outdated contentLegal/business riskLoss-of-life/injury
Commons response: Let’s built it ourselves!
You’ve built a system that’s pretty bad-ass, and it is customized to your specific needs, but at what cost? - Lots of custom code to maintain - More than likely not standards compliant - It meets today’s requirements, but what about tomorrow’s?
Alfresco wants to be your content platform: - Open source - Choice throughout the stack - Your dev tools & frameworksThis problem has already been solved. Don’t build it yourself.Content Platform = Repository + ServicesFind a platform that meets your needsExtend the platform with your own business logicWrite your own front-end using whatever language or framework makes senseOr, customize the UI that the platform provides
Alfresco have previously supported CMIS APIs, but these only provided access to a subset of the total functionality available within the Alfresco server. The new public API is much more comprehensive in the capabilities it offers to developers and has two components: CMIS (runs on AtomPub XML) is the standard defined by OASIS, and it is a good position to be in for Alfresco to be able to communicate our compliance with this recognised standard. The other part of the API offers additional integration capabilties via REST, which we will go into on the next slide, along with the Mobile SDK.
The Alfresco API enables the developer community to unlock the power of the Alfresco platform to mutually compliment their own developments. We’ve built upon the CMIS standard API format, to provide additional development functionality via the REST element of the Alfresco API. These two elements combine to offer the most comprehensive integration options possible. The two ingredients in the Alfresco API.The CMIS part:Store, retrieve, search and query folder content, access metadata and thumbnails for documents and read and write data.The REST part:The REST element of the API adds in additional functionality, such as access to data on users, sites and the ability to read and write activity streams, and provides developers with extra depth in the options open to them when developing against the Alfresco platform.The two components – CMIS and REST – both run on HTTP and can be used either in combination, or independently, according to the needs/desires of the developer and their project, and provide support for numerous different coding languages.There is also the upcoming release of the Alfresco Mobile SDK, which is toolkit that sits as an additional extraction layer for developers working on iOS and Android apps, to make the process of integration even simpler still. The SDK is completely optional, so it is up to developers to decide whether it will be a benefit in the interface between their app and Alfresco.The Alfresco Mobile SDK is deployed alongside the Alfresco APIThe benefits of the Alfresco APIIt exposes the Alfresco platformAllows leverage of Alfresco as a document/data repository, workflow initiation platform and many other usesUnleashes strength and depth of Alfresco to augment 3rd party appsBenefits of Developing with Alfresco MobileThe Alfresco Mobile SDK in available for both iOS and Android developments, and is an optional extra interface layer to make building on the Alfresco platform for mobile applications even easier.Alfresco Mobile SDK provides the capability to connect to both on-premise and cloud-based servers.Supports Alfresco Enterprise versions 3.4.x and aboveThe Client API provides a library allowing quick incorporation of access to Alfresco servers within mobile applicationsWe provide an SDK Samples Application, an example of how the Client API can be deployed in a typical app integration
Built on Spring Surf & YUIConfigurable, customizable
Open SourceGet it from bitbucket
When registering your app: - For “Scope”, enter “public_api” - For “Type”, enter “Confidential”
Development plan: 5 requests per second, 10,000 requests per dayProduction plan: 50 requests per second, 100,000 requests per dayThese may change over time