exciting new alfresco apis

39
Exciting New Alfresco REST APIs Jan Vonka BeeCon 2017 (Zaragoza)

Upload: j-v

Post on 22-Jan-2018

404 views

Category:

Software


4 download

TRANSCRIPT

Page 1: Exciting New Alfresco APIs

Exciting New Alfresco REST APIs

Jan VonkaBeeCon 2017

(Zaragoza)

Page 2: Exciting New Alfresco APIs

REST API Agenda

• Introduction• Overview & Architecture• Documentation• What’s New & Changed ?• Demo• What’s Next ?• Summary

Page 3: Exciting New Alfresco APIs

Introduction

Page 4: Exciting New Alfresco APIs

Introduction

Jan Vonka

• Senior Developer @ Alfresco• Balloonist• http://www.slideshare.net/jvonka

Page 5: Exciting New Alfresco APIs

Disclaimer

The information and features presented are subject to change.

We look forward to collaborating with you to improve and extend the Alfresco APIs J

Page 6: Exciting New Alfresco APIs

Overview & Architecture

Page 7: Exciting New Alfresco APIs

Alfresco Digital Business Platform

Page 8: Exciting New Alfresco APIs

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

JavaClientBinding(EA) Other– Python,Go,… ?

RM

Apps&Integrations Apps&Integrations Apps&Integrations

Page 9: Exciting New Alfresco APIs

REST API components

Page 10: Exciting New Alfresco APIs

REST API Introduction

• The remote public API for all new clients– enabler for Alfresco Digital Business Platform– client-driven features– contract-first design

• Open API– consistent, documented, functional, …– performant, secure, reliable …

Page 11: Exciting New Alfresco APIs

REST API Introduction• RESTful Framework

– pragmatic, consistent, well-defined guidelines– option for custom / private APIs

• eg. https://github.com/covolution/quick-api

• CMIS is still a good option– eg. heterogeneous environments (I = interoperability)

• WebScripts– custom (”roll-your-own”)

Page 12: Exciting New Alfresco APIs

Context & Use-cases

• Digital Business Platform– Applications & integrations– pick & mix services (*)– configure &/or discover …

• what’s enabled• incremental new features

– Enterprise vs Core

• User Roles / Groups– End-User vs Administrators– Managers – Sites, Records– Other Permissions

Process(1.6+)

Governance(2.6+)

Content(5.2+)

Search(1.0+)

Page 13: Exciting New Alfresco APIs

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 14: Exciting New Alfresco APIs

Documentation

Page 15: Exciting New Alfresco APIs

• 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://artifacts.alfresco.com

• GAV: org.alfresco.api-explorer (5.2.e/5.2.0)

API Explorer

Page 16: Exciting New Alfresco APIs

Content Services API (v5.2 +)ActivitiesCommentsFavoritesNetworksNodes (& Associations)PeoplePreferencesQueries (Simple)RatingsRenditionsShared-linksSearch (Advanced)SitesTagsTrashcanVersions

Page 17: Exciting New Alfresco APIs

Process Services API (v1.6 +)

DeploymentsProcess DefinitionsProcess InstancesModelsExecutionsTask InstancesHistoryFormsSignalsManagement (Tables, Prop’s, Jobs)Identity (Users, Groups)…

PS Engine API PS Enterprise API

Page 18: Exciting New Alfresco APIs

Governance Services API (v2.6 +)GS Core API GS Classification Guide API

File plans, record categories, record folders, records, etc.

Page 19: Exciting New Alfresco APIs

Community: Blog Post Series• Alfresco v1 REST API by Gavin Cornwell (includes Postman collections)

– Part 1 - Introduction– Part 2 - Navigation– Part 3 - Creating Nodes & Uploading Content– Part 4 - Managing Nodes & Download Content– Part 5 - Versioning & Locking– Part 6 - Associations– Part 7 - Collaboration (Comments, Ratings, Tags, ...)– Part 8 - Sites– Part 9 - Queries & Search– Part 10 - People

https://community.alfresco.com/community/ecm/blog/2016/10/11/v1-rest-api-part-1-introduction

Page 20: Exciting New Alfresco APIs

https://community.alfresco.com/docs/DOC-6532-alfresco-52-rest-apis

Community links - REST APIs

• Links to lots of resources– Blogs– Videos– Presentations– Bindings– Sample clients– Docs

Page 21: Exciting New Alfresco APIs

What’s New & Changed ?

Page 22: Exciting New Alfresco APIs

What’s New – Content Services 5.2• 56 new endpoints

– Core API– Authentication API– Discovery API– Search API

• REST Framework enhancements– return less => fields query param– return more => include query param (API specific)– operations (eg. /copy, /move, /lock, /unlock, /revert, /restore, …)– @WebApiNoAuth

Page 23: Exciting New Alfresco APIs

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 Content Example

Page 24: Exciting New Alfresco APIs

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 25: Exciting New Alfresco APIs

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 26: Exciting New Alfresco APIs

Authentication API…/alfresco/api/-default-/public/authentication/versions/1/…

• /tickets– Login– Logout– Validate

Page 27: Exciting New Alfresco APIs

Discovery API…/alfresco/api/…

• /discovery– Version information– License information (Enterprise only)– Status

• isReadOnly• isQuickSharedEnabled• …

– Installed modules

Page 28: Exciting New Alfresco APIs

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 29: Exciting New Alfresco APIs

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 30: Exciting New Alfresco APIs

Demo

Page 31: Exciting New Alfresco APIs

Postman Collection

• File -> Import -> Import From Link

https://www.getpostman.com/collections/3b55c5964cdf44c4836c

Page 32: Exciting New Alfresco APIs

Simple File Sharing prototype (new APIs)

Files&FoldersUpload&DownloadPreviewLiveSearchSharedLinksMove&CopyDelete& Undo….

Page 33: Exciting New Alfresco APIs

Client Bindings & Example Apps• JavaScript Client + ADF– ADF 101 tutorial blogs– HealthCare Demo App

• Java Client (Early Access)– Java Client blogs– basis for new Android client(s)

• Developer Ecosystem - Partners & Community J

Page 34: Exciting New Alfresco APIs

What’s Next ?

Page 35: Exciting New Alfresco APIs

Futures

• More Services exposed– Content 5.2.x - Groups, … Audit, Repo Actions, Avatar ?

– Governance 2.6.x – Core & Classification Guide

– REST Framework improvements (eg. Batch)

• Other Enhancements– Event Streams / Change Log– Callbacks - eg. Queues, Web Hooks, Server-Sent Events ?

Page 36: Exciting New Alfresco APIs

Futures

• Your feedback– which services to expose next– new features driven by your key use-cases

• Contribute ? – pull/merge requests (via git)– API spec – consistent with existing style & guidelines– Implementation code– Test code to validate behaviour (+ve & -ve)

Page 37: Exciting New Alfresco APIs

Summary

Page 38: Exciting New Alfresco APIs

References

• Alfresco 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

• Intro Video https://www.youtube.com/watch?v=XiU9MMw8LG0

Page 39: Exciting New Alfresco APIs

Thank You

Jan Vonkahttps://www.slideshare.net/jvonka