SlideShare una empresa de Scribd logo
1 de 29
Intro to the Alfresco Public
API
Jeff Potts
Chief Community Officer
Doesn’t Alfresco already have
an API?
Yes, but…
• Not really public (things change)
• Not versioned
• Not well documented
• Doesn’t work for cloud
The Alfresco Public API addresses these
limitations
Vision is to have a single API that works
across cloud and on-premise
API Launch Partners
Folder, file, content
and metadata
manipulation and
search
Networks, sites,
people, comments,
tags, activities, …
Getting Started
1. Understand OAuth2
2. Register your app
3. Grab a client-side CMIS library
• Or an SDK if coding a mobile app
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)
OAuth2 & Alfresco
Used to secure the Alfresco API
Only authentication mechanism provided for
APIs in Alfresco Cloud
Registering an App
Application
Developer
Alfresco
Developer Portal
Creates developer
profile
Assigns an API key
and secret for that
app
Signs up on
developer portal
Registers an
application
Authorization
Application Alfresco End-User
Links to Alfresco
authorization page,
passing API key &
secret
Asks the user to
authorize the app
User authorizes the
app to access their
account
Redirects to your
app’s callback
URL, passing
authorization code
Exchanges the
authorization code
for an access token
Returns access and
refresh tokens
Securely persists
the access and
refresh token for
that user
Making API Calls
Calls APIs, passing
the access token in
the Authorization
HTTP header
Identifies user from
access token,
executes API call
Application Alfresco
Refresh Flow
Calls APIs, passing
the access token in
the Authorization
HTTP header
Returns 401 error,
indicating access
token has expired
Refreshes access
token, passing
refresh token
Returns new access
token
Application Alfresco
OAuth2 library can hide
details
Spring Social
http://www.springsource.org/spring-social
Google OAuth2 Client
https://developers.google.com/accounts/doc
s/OAuth2#libraries
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
Apache Chemistry is the umbrella project for
all CMIS related projects at the ASF
• OpenCMIS (Java, client and server)
• cmislib (Python, client)
• phpclient (PHP, client)
• DotCMIS (.NET, client)
• ObjectiveCMIS (Objective-C)
Other client libraries exist
REST client
http://youtu.be/5QS0CNsPJEY
Create, Find, & Comment
http://youtu.be/1ZtmoPdCKJI
Alfresco API URLs
Structure:
• Tenant
• API scope
• API name
• API version
• Entity type
https://api.alfresco.com/
* The notion of entity types doesn’t apply to CMIS.
*
public/acme.com/ sitesalfresco/versions/1/
Entity type collections
The entity type URL represents a collection
of all instances of that entity
• The collection may or may not be
retrievable via a GET
Each instance of an entity can be accessed
via the collection URL with an Id appended
.../acme.com/public/alfresco/versions/1/sites/mullet-gallery
Top level entity types
sites
people
tags
nodes
favorites
Nesting entity types
Entity types may also be nested
The same rule about retrieving instances by
Id applies
.../acme.com/public/alfresco/versions/1/sites/mullet-gallery/members
.../acme.com/public/alfresco/versions/1/sites/mullet-
gallery/members/pmonks@alfresco.com
Create, update, & delete
Creating a new entity instance:
• POST to the collection URL
Updating an entity instance:
• PUT to the instance URL
Deleting an entity instance:
• DELETE against the instance URL
These rules apply regardless of whether it’s
a top-level or nested collection
Considerations
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
Roadmap
Merge APIs into Alfresco Enterprise v4.2
New API types:
• User Provisioning (SCIM)
• Workflow (Activiti)
New API versions:
• CMIS v1.1
• Alfresco v2 (?)
New Alfresco API entity types:
• renditions
• bulk-imports (?)
Roadmap
Binary property support
Projection & transclusion improvements
(“SELECT”)
Restriction improvements (“WHERE”)
Discoverability improvements
• In support of “executable documentation”
Getting Help
Docs: http://www.alfresco.com/develop
Resources:
• Alfresco API forum
• #alfresco on freenode IRC
• Alfresco Technical Discussion Google Group
Source Code:
• Code from DevCon Session
• Spring Social Alfresco Library
• Peter’s Grails Example
• Jeff’s Java Examples & Python Examples
Read the book!
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
The keys to one badass ECM platform are yours for
the taking
http://www.alfresco.com/develop
http://www.flickr.com/photos/ph-stop/3101407532/

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Alfresco tuning part1
Alfresco tuning part1Alfresco tuning part1
Alfresco tuning part1
 
Sizing your alfresco platform
Sizing your alfresco platformSizing your alfresco platform
Sizing your alfresco platform
 
Bulk Export Tool for Alfresco
Bulk Export Tool for AlfrescoBulk Export Tool for Alfresco
Bulk Export Tool for Alfresco
 
Alfresco Transform Service DevCon 2019
Alfresco Transform Service DevCon 2019Alfresco Transform Service DevCon 2019
Alfresco Transform Service DevCon 2019
 
Jose portillo dev con presentation 1138
Jose portillo   dev con presentation 1138Jose portillo   dev con presentation 1138
Jose portillo dev con presentation 1138
 
Discovering the 2 in Alfresco Search Services 2.0
Discovering the 2 in Alfresco Search Services 2.0Discovering the 2 in Alfresco Search Services 2.0
Discovering the 2 in Alfresco Search Services 2.0
 
Alfresco Security Best Practices Guide
Alfresco Security Best Practices GuideAlfresco Security Best Practices Guide
Alfresco Security Best Practices Guide
 
Alfresco tuning part1
Alfresco tuning part1Alfresco tuning part1
Alfresco tuning part1
 
Storage and Alfresco
Storage and AlfrescoStorage and Alfresco
Storage and Alfresco
 
From zero to hero Backing up alfresco
From zero to hero Backing up alfrescoFrom zero to hero Backing up alfresco
From zero to hero Backing up alfresco
 
Alfresco Records Management
Alfresco Records ManagementAlfresco Records Management
Alfresco Records Management
 
Scale your Alfresco Solutions
Scale your Alfresco Solutions Scale your Alfresco Solutions
Scale your Alfresco Solutions
 
Alfresco Security Best Practices 2014
Alfresco Security Best Practices 2014Alfresco Security Best Practices 2014
Alfresco Security Best Practices 2014
 
Collaborative Editing Tools for Alfresco
Collaborative Editing Tools for AlfrescoCollaborative Editing Tools for Alfresco
Collaborative Editing Tools for Alfresco
 
Architectural changes in the repo in 6.1 and beyond
Architectural changes in the repo in 6.1 and beyondArchitectural changes in the repo in 6.1 and beyond
Architectural changes in the repo in 6.1 and beyond
 
Alfresco Backup and Disaster Recovery White Paper
Alfresco Backup and Disaster Recovery White PaperAlfresco Backup and Disaster Recovery White Paper
Alfresco Backup and Disaster Recovery White Paper
 
Upgrading to Alfresco 6
Upgrading to Alfresco 6Upgrading to Alfresco 6
Upgrading to Alfresco 6
 
(Re)Indexing Large Repositories in Alfresco
(Re)Indexing Large Repositories in Alfresco(Re)Indexing Large Repositories in Alfresco
(Re)Indexing Large Repositories in Alfresco
 
Alfresco DevCon 2019 - Alfresco Identity Services in Action
Alfresco DevCon 2019 - Alfresco Identity Services in ActionAlfresco DevCon 2019 - Alfresco Identity Services in Action
Alfresco DevCon 2019 - Alfresco Identity Services in Action
 
Getting Started with CMIS
Getting Started with CMISGetting Started with CMIS
Getting Started with CMIS
 

Destacado (8)

2140 api developer-student-guide
2140 api developer-student-guide2140 api developer-student-guide
2140 api developer-student-guide
 
Tech talk live on new alfresco api
Tech talk live on new alfresco apiTech talk live on new alfresco api
Tech talk live on new alfresco api
 
Alfresco Share Customization Made Easy With Side Labs
Alfresco Share Customization Made Easy With Side LabsAlfresco Share Customization Made Easy With Side Labs
Alfresco Share Customization Made Easy With Side Labs
 
Alfresco tech talk live public api episode 64
Alfresco tech talk live public api episode 64Alfresco tech talk live public api episode 64
Alfresco tech talk live public api episode 64
 
Alfresco Day Vienna 2016: Alfrescos neue Rest API
Alfresco Day Vienna 2016: Alfrescos neue Rest APIAlfresco Day Vienna 2016: Alfrescos neue Rest API
Alfresco Day Vienna 2016: Alfrescos neue Rest API
 
Installing and Getting Started with Alfresco
Installing and Getting Started with AlfrescoInstalling and Getting Started with Alfresco
Installing and Getting Started with Alfresco
 
Intro to Alfresco for Developers
Intro to Alfresco for DevelopersIntro to Alfresco for Developers
Intro to Alfresco for Developers
 
Alfresco In An Hour - Document Management, Web Content Management, and Collab...
Alfresco In An Hour - Document Management, Web Content Management, and Collab...Alfresco In An Hour - Document Management, Web Content Management, and Collab...
Alfresco In An Hour - Document Management, Web Content Management, and Collab...
 

Similar a Intro to the Alfresco Public API

Similar a Intro to the Alfresco Public API (20)

Building Content-Rich Java Apps in the Cloud with the Alfresco API
Building Content-Rich Java Apps in the Cloud with the Alfresco APIBuilding Content-Rich Java Apps in the Cloud with the Alfresco API
Building Content-Rich Java Apps in the Cloud with the Alfresco API
 
Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...
Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...
Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
API Services: Building State-of-the-Art APIs
API Services: Building State-of-the-Art APIsAPI Services: Building State-of-the-Art APIs
API Services: Building State-of-the-Art APIs
 
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM BluemixDeploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
 
Day 1 axway apim-training
Day 1   axway apim-trainingDay 1   axway apim-training
Day 1 axway apim-training
 
API SECURITY
API SECURITYAPI SECURITY
API SECURITY
 
Alfresco for Salesforce
Alfresco for SalesforceAlfresco for Salesforce
Alfresco for Salesforce
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhuapidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
 
Developing Apps with Azure AD
Developing Apps with Azure ADDeveloping Apps with Azure AD
Developing Apps with Azure AD
 
Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platform
 
Design & Deploy a data-driven Web API in 2 hours
Design & Deploy a data-driven Web API in 2 hoursDesign & Deploy a data-driven Web API in 2 hours
Design & Deploy a data-driven Web API in 2 hours
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gateway
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Apache Cordova 4.x
Apache Cordova 4.xApache Cordova 4.x
Apache Cordova 4.x
 
DreamFactory Essentials Webinar
DreamFactory Essentials WebinarDreamFactory Essentials Webinar
DreamFactory Essentials Webinar
 
Build your APIs with apigility
Build your APIs with apigilityBuild your APIs with apigility
Build your APIs with apigility
 
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 minsAWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
 

Más de Jeff Potts

Alfresco Community Survey 2012 Results
Alfresco Community Survey 2012 ResultsAlfresco Community Survey 2012 Results
Alfresco Community Survey 2012 Results
Jeff Potts
 
Alfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & IntegrationsAlfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & Integrations
Jeff Potts
 

Más de Jeff Potts (20)

No Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleNo Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with Ansible
 
Moving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to MicroservicesMoving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to Microservices
 
Flexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL TemplatesFlexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL Templates
 
Moving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryMoving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco Repository
 
Could Alfresco Survive a Zombie Attack?
Could Alfresco Survive a Zombie Attack?Could Alfresco Survive a Zombie Attack?
Could Alfresco Survive a Zombie Attack?
 
Connecting Content Management Apps with CMIS
Connecting Content Management Apps with CMISConnecting Content Management Apps with CMIS
Connecting Content Management Apps with CMIS
 
The Challenges of Keeping Bees
The Challenges of Keeping BeesThe Challenges of Keeping Bees
The Challenges of Keeping Bees
 
Getting Started With CMIS
Getting Started With CMISGetting Started With CMIS
Getting Started With CMIS
 
Alfresco: What every developer should know
Alfresco: What every developer should knowAlfresco: What every developer should know
Alfresco: What every developer should know
 
CMIS: An Open API for Managing Content
CMIS: An Open API for Managing ContentCMIS: An Open API for Managing Content
CMIS: An Open API for Managing Content
 
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
 
Alfresco: The Story of How Open Source Disrupted the ECM Market
Alfresco: The Story of How Open Source Disrupted the ECM MarketAlfresco: The Story of How Open Source Disrupted the ECM Market
Alfresco: The Story of How Open Source Disrupted the ECM Market
 
Join the Alfresco community
Join the Alfresco communityJoin the Alfresco community
Join the Alfresco community
 
Apache Chemistry in Action
Apache Chemistry in ActionApache Chemistry in Action
Apache Chemistry in Action
 
Alfresco Community Survey 2012 Results
Alfresco Community Survey 2012 ResultsAlfresco Community Survey 2012 Results
Alfresco Community Survey 2012 Results
 
Relational Won't Cut It: Architecting Content Centric Apps
Relational Won't Cut It: Architecting Content Centric AppsRelational Won't Cut It: Architecting Content Centric Apps
Relational Won't Cut It: Architecting Content Centric Apps
 
Alfresco SAUG: State of ECM
Alfresco SAUG: State of ECMAlfresco SAUG: State of ECM
Alfresco SAUG: State of ECM
 
Alfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & IntegrationsAlfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & Integrations
 
Should You Attend Alfresco Devcon 2011
Should You Attend Alfresco Devcon 2011Should You Attend Alfresco Devcon 2011
Should You Attend Alfresco Devcon 2011
 
2011 Alfresco Community Survey Results
2011 Alfresco Community Survey Results2011 Alfresco Community Survey Results
2011 Alfresco Community Survey Results
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Intro to the Alfresco Public API

  • 1. Intro to the Alfresco Public API Jeff Potts Chief Community Officer
  • 2. Doesn’t Alfresco already have an API? Yes, but… • Not really public (things change) • Not versioned • Not well documented • Doesn’t work for cloud The Alfresco Public API addresses these limitations Vision is to have a single API that works across cloud and on-premise
  • 4.
  • 5.
  • 6. Folder, file, content and metadata manipulation and search Networks, sites, people, comments, tags, activities, …
  • 7. Getting Started 1. Understand OAuth2 2. Register your app 3. Grab a client-side CMIS library • Or an SDK if coding a mobile app 4. Start coding!
  • 8. 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)
  • 9. OAuth2 & Alfresco Used to secure the Alfresco API Only authentication mechanism provided for APIs in Alfresco Cloud
  • 10. Registering an App Application Developer Alfresco Developer Portal Creates developer profile Assigns an API key and secret for that app Signs up on developer portal Registers an application
  • 11. Authorization Application Alfresco End-User Links to Alfresco authorization page, passing API key & secret Asks the user to authorize the app User authorizes the app to access their account Redirects to your app’s callback URL, passing authorization code Exchanges the authorization code for an access token Returns access and refresh tokens Securely persists the access and refresh token for that user
  • 12. Making API Calls Calls APIs, passing the access token in the Authorization HTTP header Identifies user from access token, executes API call Application Alfresco
  • 13. Refresh Flow Calls APIs, passing the access token in the Authorization HTTP header Returns 401 error, indicating access token has expired Refreshes access token, passing refresh token Returns new access token Application Alfresco
  • 14. OAuth2 library can hide details Spring Social http://www.springsource.org/spring-social Google OAuth2 Client https://developers.google.com/accounts/doc s/OAuth2#libraries
  • 15. 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
  • 16. Step 3: CMIS Library Apache Chemistry is the umbrella project for all CMIS related projects at the ASF • OpenCMIS (Java, client and server) • cmislib (Python, client) • phpclient (PHP, client) • DotCMIS (.NET, client) • ObjectiveCMIS (Objective-C) Other client libraries exist
  • 18. Create, Find, & Comment http://youtu.be/1ZtmoPdCKJI
  • 19. Alfresco API URLs Structure: • Tenant • API scope • API name • API version • Entity type https://api.alfresco.com/ * The notion of entity types doesn’t apply to CMIS. * public/acme.com/ sitesalfresco/versions/1/
  • 20. Entity type collections The entity type URL represents a collection of all instances of that entity • The collection may or may not be retrievable via a GET Each instance of an entity can be accessed via the collection URL with an Id appended .../acme.com/public/alfresco/versions/1/sites/mullet-gallery
  • 21. Top level entity types sites people tags nodes favorites
  • 22. Nesting entity types Entity types may also be nested The same rule about retrieving instances by Id applies .../acme.com/public/alfresco/versions/1/sites/mullet-gallery/members .../acme.com/public/alfresco/versions/1/sites/mullet- gallery/members/pmonks@alfresco.com
  • 23. Create, update, & delete Creating a new entity instance: • POST to the collection URL Updating an entity instance: • PUT to the instance URL Deleting an entity instance: • DELETE against the instance URL These rules apply regardless of whether it’s a top-level or nested collection
  • 24. Considerations 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
  • 25. Roadmap Merge APIs into Alfresco Enterprise v4.2 New API types: • User Provisioning (SCIM) • Workflow (Activiti) New API versions: • CMIS v1.1 • Alfresco v2 (?) New Alfresco API entity types: • renditions • bulk-imports (?)
  • 26. Roadmap Binary property support Projection & transclusion improvements (“SELECT”) Restriction improvements (“WHERE”) Discoverability improvements • In support of “executable documentation”
  • 27. Getting Help Docs: http://www.alfresco.com/develop Resources: • Alfresco API forum • #alfresco on freenode IRC • Alfresco Technical Discussion Google Group Source Code: • Code from DevCon Session • Spring Social Alfresco Library • Peter’s Grails Example • Jeff’s Java Examples & Python Examples
  • 28. Read the book! 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
  • 29. The keys to one badass ECM platform are yours for the taking http://www.alfresco.com/develop http://www.flickr.com/photos/ph-stop/3101407532/

Notas del editor

  1. REST API includes:SitesMembersFavoritesNetworksPeopleContainersActivitiesRatingsCommentsTags
  2. PETER
  3. PETER
  4. PETER
  5. PETER
  6. PETER
  7. PETER
  8. PETER