alfresco 5.2 rest api
TRANSCRIPT
![Page 1: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/1.jpg)
Jan Vonka - London Meetup (March 2017)
Alfresco 5.2 REST APIs
![Page 2: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/2.jpg)
Introduction
ImageCredit:HVonka
![Page 3: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/3.jpg)
Introduction
Jan Vonka
• Senior Developer @ Alfresco
• Balloonist• flying balloons over cities takes a lot of planning J
• For background, see:
• http://www.slideshare.net/jvonka/alfresco-rest-api-of-the-future-is-closer-than-you-think
• https://www.youtube.com/watch?v=7jR2PV5w1O4ImageCredit:https://www.adventureballoons.co.uk
![Page 4: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/4.jpg)
REST API Agenda
• Overview & Architecture• Documentation• What’s New & Changed ?• Demo• What’s Next ?• References
![Page 5: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/5.jpg)
Overview & Architecture
ImageCredit:HVonka
![Page 6: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/6.jpg)
Alfresco Digital Business Platform
Applications – Engaging UX - Mobile, Web, App Dev Framework, Desktop
Alfresco ProcessServices
Alfresco ContentServices
Alfresco Governance Services
Integrations / Extensions
Open APIs and Open Standards
On-Premise, Cloud, Hybrid, Managed
Intelligence and Analytics
![Page 7: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/7.jpg)
Alfresco API Overview
ContentServices(Repository)
ProcessServices(Activiti)
RESTAPIRESTAPI
Alfre
scoPlatform
Micro-Services/Con
tainers
SearchServices
(Solr)
GovernanceServices(RM)
RM
ECMBPM
CMIS(BrowserBinding)
ADF
JavaScriptClientBinding
HTTPS/JSON/Binary
App App
JavaClientBinding(EA)
App App
OtherLibs/Fwks
RM
![Page 8: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/8.jpg)
REST API components
![Page 9: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/9.jpg)
REST API Introduction
• REST Framework – pragmatic, follows well-defined RESTful guidelines
• Open API– consistent, documented, functional, performant, secure, reliable …
• The API for all new clients– enabler for Alfresco Digital Business Platform
• Roles– End-User vs Administrators– permissions – Groups / Users
• CMIS is still a good option– eg. heterogeneous environments
![Page 10: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/10.jpg)
URL Structure
https://host:port/alfresco/api/-default-/public/alfresco/versions/1/…
Scope APIName Version
Entity Relationship(orOperation**)
Tenant
/nodes/nodes/{id}/nodes/{id}/children/nodes/{id}/copy
* Where applicable** Operations are new for 5.2 (used for specific scenarios where relationship does not make sense)
GET, POSTGET, PUT, DELETEGET, POSTPOST
DeployedEnvironment
Method(*)
![Page 11: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/11.jpg)
Documentation
ImageCredit:www.renishaw.com
![Page 12: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/12.jpg)
API Docs
ImageCredit:http://www.commitstrip.com/en/2017/02/20/no-ones-fault/?
![Page 13: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/13.jpg)
• Is your friend !• Single source of truth• Open API Spec (~ Swagger)• Generate client-side bindings• Developer resource
– http://api-explorer.alfresco.com– https://github.com/Alfresco/rest-
api-explorer– http://artificats.alfresco.com
• GAV: org.alfresco.api-explorer (5.2.e/5.2.0)
API Explorer
![Page 14: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/14.jpg)
Example: Content Services Core API
ActivitiesCommentsFavoritesNetworksNodesPeoplePreferences
QueriesRatingsRenditionsShared-linksSitesTagsTrashcanVersions
Provides access to the core features of Alfresco Content Servicesto retrieve, manage and find entities such as:
![Page 15: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/15.jpg)
https://community.alfresco.com/docs/DOC-6532-alfresco-52-rest-apis
Alfresco 5.2 REST APIs
• Cheat-sheet • Links to lots of resources
– Blogs– Videos– Presentations– Bindings– Sample clients– Docs
![Page 16: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/16.jpg)
• Gavin Cornwell• Series has 8 parts so far
– more coming soon– includes Postman collections
Community Blog Post Series
https://community.alfresco.com/community/ecm/blog/2016/10/11/v1-rest-api-part-1-introduction
![Page 17: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/17.jpg)
What’s New & Changed ?
ImageCredit:HVonka
![Page 18: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/18.jpg)
What’s New
• 56 new endpoints!– Core API– Authentication API– Discovery API– Search API
• REST Framework enhancements– return less => fields query parameter– return more => include query parameter (API specific)– operations (eg. /copy, /move, /lock, /unlock, /revert, /restore, …)– @WebApiNoAuth
![Page 19: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/19.jpg)
Upload contentcurl -utest:test –X POSThttp://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-my-/children -F [email protected]
Download contentcurl -utest:test -X GEThttp://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/99a40be1-268f-4b8e-ab49-866747bbd660/content
Simple Example
![Page 20: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/20.jpg)
Core API
…/alfresco/api/-default-/public/alfresco/versions/1/…
• /nodes/{nodeId}– Navigation– Content– Information– Operations include: Copy, Move, Lock, Unlock– Associations
• /nodes/{nodeId}/renditions• /nodes/{nodeId}/versions
– Operations include: Revert
![Page 21: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/21.jpg)
Core API
…/alfresco/api/-default-/public/alfresco/versions/1/…
• /deleted-nodes– Operations: Restore
• /queries– /nodes– /people– /sites
• /shared-links– public share, unshare, find, …– expiration (new)
![Page 22: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/22.jpg)
Authentication API
…/alfresco/api/-default-/public/authentication/versions/1/…
• /tickets– Login– Logout– Validate
![Page 23: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/23.jpg)
Discovery API
…/alfresco/api/…
• /discovery– Version information– License information (Enterprise only)– Status
• isReadOnly• isQuickSharedEnabled• …
– Installed modules
![Page 24: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/24.jpg)
Search API
…/alfresco/api/-default-/public/search/versions/1/...
• /search– Low level search API (effectively exposes Java API)– AFTS, CMIS, Lucene support– Faceting– Spellcheck– Term highlighting– Search nodes, versions or deleted-nodes
![Page 25: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/25.jpg)
Enhanced APIs
…/alfresco/api/-default-/public/alfresco/versions/1/…
• /sites– Create site (no custom preset support yet)– Update site details– Delete site
• /people– List people (no filtering)– Create person– Update person
• Enable/Disable (admin only)
![Page 26: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/26.jpg)
Demo
ImageCredit:PressAssociation
![Page 27: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/27.jpg)
Postman Collection
• File -> Import -> Import From Link
https://www.getpostman.com/collections/e28cf833734602fb4609
![Page 28: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/28.jpg)
Simple File Sharing prototype (using new APIs)
Files&FoldersUpload&DownloadPreviewLiveSearchSharedLinksMove&CopyDelete& Undo….
![Page 29: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/29.jpg)
Client Bindings & Example Apps
• Alfresco ADF (Application Development Framework)– JavaScript client-side– see: ADF 101 tutorial blogs– example: HealthCare Demo App
• Java Client SDKs (Early Access)– see: Java Client blogs– example: basis for new Android client(s)
• Developer Ecosystem … Partners & Community J
![Page 30: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/30.jpg)
What’s Next ?
ImageCredit:www.timeout.com
![Page 31: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/31.jpg)
Futures
• More Services exposed– Group Management– Download as Zip– …– Audit ?– Repository Actions ?
• Other Enhancements– more REST Framework improvements (eg. batch)– …– new features based on your (client-driven) feedback !
![Page 32: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/32.jpg)
References
ImageCredit:HVonka
![Page 33: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/33.jpg)
References
• Alfresco 5.2 REST APIs (with more links)https://community.alfresco.com/docs/DOC-6532-alfresco-52-rest-apis
• API Explorerhttps://api-explorer.alfresco.comhttps://github.com/Alfresco/rest-api-explorer
• Tech Talk Live #102 https://www.youtube.com/watch?v=cpSksoy-zkk
![Page 34: Alfresco 5.2 REST API](https://reader034.vdocuments.us/reader034/viewer/2022050613/58ed08681a28ab2c458b46e3/html5/thumbnails/34.jpg)
Thank You
JanVonkahttps://www.slideshare.net/jvonka