icm 10.0.0.0 – api server gary ratcliffe. 2 agenda webinar programme api server overview json-rpc...

46
iCM 10.0.0.0 – API Server Gary Ratcliffe

Upload: martha-norton

Post on 19-Jan-2016

235 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

iCM 10.0.0.0 – API Server

Gary Ratcliffe

Page 2: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

2

Agenda

• Webinar Programme• API Server Overview• JSON-RPC• iCM API Service• API Server and Forms• New services under development

Page 3: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

3

Webinar Programme

• User– 1st October – What’s New in iCM V10– 2nd October – Article Editing, Media Upload, etc– 3rd October – Preferences, Help Text, Shortcuts

• Technical – 9th October – iCM V10 Overview– 16th October – Forms– 13th November – API Server– 11th December – API Server and Forms (tbc)

Page 4: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

4

Overview

• Platform for:– Delivery of services to support iCM & sites

• Forms rendering for all platforms• This is the most obvious difference in initial release

– Delivery of secure APIs for 3rd party integration• Secure access to iCM API

– Delivery of additional services for iCM and sites: 10.0.1.0• Workflow engine - started• Low level database access - started• Master media image manipulation - started

Page 5: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

iCM

.NET Site

Java Site

CF Site

Duplicated Functionality

API/Renderer/Templates

Duplicated Functionality

API/Renderer/Templates

Duplicated Functionality

API/Renderer/Templates

Duplicated Functionality

Overview – Forms Rendering

Page 6: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

iCM

.NET Site

Java Site

CF Site

API/Renderer/Templates

API/Renderer/Templates

API/Renderer/Templates

API/Renderer/Templates

API ServerAPI Server

API Server

Overview – Forms Rendering

Page 7: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

7

Overview - Architecture

Tomcat

RailoSolr

‘iCM’

Java Runtime

Java Libraries

‘iCM’

Java Libraries

DatabaseSearch

Collections

‘API’

WindowsLinux

SQL ServerPostgreSQL (not .NET)Oracle

Cold FusionJava.NET

‘API Server’

1.7

4.0.3

4.4.0

NodeJS 0.10.12Java 1.7.0_25

7.0.14

Page 8: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

API Server Management SecurityConfiguration

API Interface

HTTP/HTTPSRequests

Browser AJAXRequest

PHP ServerCode

.NET ServerCode

Java ServerCode

GoogleZapier, ?

‘Worker’Service

‘Worker’Service

‘Worker’Service

‘Worker’Service

‘Worker’Service

‘Worker’Service

‘Worker’Service

‘Worker’Service

=

Forms iCMContent

Patcher ???

Overview - Architecture

Page 9: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

Overview – Why?

Page 10: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

10

Architectural Changes – API Server

• Each iCM and delivery server must have a local API Server

• Each server must be defined in iCM

• iCM sends the configuration information to the API Server– This includes details of database connections, media folder etc

• iCM can also send updates to the API Server– Supplied as part of iCM patches or hot fixes.

Page 11: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

11

API Server Definition in iCM

Page 12: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

12

API Server Definition in iCM

Page 13: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

13

Configuration Files

• Held in icm/custom/apiserverconfigs

• These contain minimal information to indicate what services and how many instances are available– Some workers use multiple processes

• Skeleton Processor– Some are multi-threaded

• iCM API

• Two configurations supplied at present– default

• Used for all current v10 deployments– default-DEBUG

• Used when additional tracing is required

Page 14: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

14

Configuration Files - Example

{"workers" : [

{ "name": "gatekeeper","instances": 1,"threadsPerInstance": 10

},{

"name": "updater","instances": 1

},{

"name": "skeletonprocessor","instances": 4

},{

"name": "icmapi","instances": 1,"threadsPerInstance": 10

},{

"name": "formutils","instances": 1,"threadsPerInstance": 10

}],

"httpServices": []

}

Page 15: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

15

Configuration Files - workers

• gatekeeper– Security functions. Must be present.

• updater– Worker installation and updating. Must be present.

• skeletonprocessor– Forms rendering. At least 2 instances must be present

• icmapi– Access to iCM content. Most be present

• Used by skeletonprocessor for loading form definitions

• formutils– Database functions for skeleton processor. Must be present

Page 16: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

16

Other workers

• tracer– Tracing functions. Internal to API Server

• configure– Configuration interface. Internal to API Server– Used by iCM

• manager– Console and Management interface. Internal to API Server– Used by iCM

Page 17: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

17

Single Server Architecture

Alpha:5706

Configuration and Management Requests

Server ‘Alpha’

iCM/Tomcat5506Site Web Server80

API Server5706

127.0.0.1:5706

Access to API Server Services always ‘localhost’

Page 18: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

18

Dual Server Architecture

Alpha:5706

Server ‘Alpha’

Site Web Server80

API Server5706

127.0.0.1:5706

Server ‘Whisky’

iCM/Tomcat5506

API Server5706

127.0.0.1:5706

Configuration and Management Requests

Whisky:5706

Access to API Server Services always ‘localhost’

Page 19: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

19

Multiple Delivery Server Architecture

Alpha:5706

Configuration and Management Requests

Server ‘Whisky’

iCM/Tomcat5506

API Server5706

127.0.0.1:5706

Server ‘Alpha’

Site Web Server80

API Server5706

127.0.0.1:5706

Server ‘Bravo’

Site Web Server80

API Server5706

127.0.0.1:5706

Bravo:5706

Whisky:5706

Access to API Server Services always ‘localhost’

Page 20: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

20

Multiple Delivery and iCM Server Architecture

Alpha:5706

Configuration and Management Requests

Server ‘Alpha’

Site Web Server80

API Server5706

127.0.0.1:5706

Server ‘Bravo’

Site Web Server80

API Server5706

127.0.0.1:5706

Bravo:5706

Server ‘Whisky’

iCM/Tomcat5506

API Server5706

127.0.0.1:5706Whisky:5706

Server ‘X-Ray’

iCM/Tomcat5506

API Server5706

127.0.0.1:5706

Whisky:5706

Access to API Server Services always ‘localhost’

Page 21: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

21

Worker Security

• Defined in iCM API Server Security

• IP Restrictions for workers– Defaults limited to local network or machine

• API Keys– Provided for external, 3rd part access

• iCM or Site user authentication– HTTP/HTTPS Basic Authentication

Page 22: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

22

Worker Security

Page 23: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

23

Worker Security

Page 24: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

24

Worker Security

Page 25: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

25

Worker Security

Page 26: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

26

Console

• Fairly limited at present

– Review complete configuration

– View HTTP access logs

– View trace logs

• Limited network access for security– Uses Manager worker for IP restrictions

Page 27: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

27

Configuration Files - workers

Page 28: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

28

Console

• Fairly limited at present

– Review complete configuration

– View HTTP access logs

– View trace logs

• Limited network access for security– Uses Manager worker for IP restrictions

Page 29: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

29

API Server in iCM

DEMO

Page 30: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

30

Using API Server Services

• Based on JSON-RPC/2– http://www.jsonrpc.org/

• Essentially an HTTP/S POST of JSON Data that represents a function call– Response is also JSON

• Multi-part Mime format also support for sending files with requests– JSON-RPC request sent in JSONRPC part

• CORS and JSONP Support for cross-site browser requests– http://www.w3.org/TR/cors/– http://json-p.org/

• Google Chrome Postman plugin recommended for trying calls

Page 31: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

31

JSON-RPC Examples

• Request:– {

"id":"1","method":"greeting","params":{"name": "Gary"},"jsonrpc":"2.0"

}

• Response:– {

"id": "1","result": "Hello Gary""jsonrpc": "2.0",

}

Page 32: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

32

JSON-RPC - Request

• id– String or number identifying request

• method– Name of service method to invoke

• params– Parameters, can be an array or object depending on service

• jsonrpc– Must be set to “2.0”

Page 33: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

33

JSON-RPC - Response

• id– String or number identifying request

• result– Simple type, array or object depending on service

• jsonrpc– Will be set to “2.0”

Page 34: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

34

JSON-RPC – Error Response

• { "jsonrpc": "2.0", "id": "1", "error": { "message": "Function reeting not found!", "code": -32601 }}

• Id– String or number identifying request

• error– Error details

• jsonrpc– Will be set to “2.0”

Page 35: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

35

API Server JSON-RPC Calls

DEMO

Page 36: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

36

iCM API Service

• Provides access to iCM content– In current form a combination of the Java API and Cold Fusion API– Documentation for these is essential– Note that Java and .NET API are virtually identical

• Example forms that create articles are the best starting point– Technical document is becoming available on help text site

• Not pretending this is easy or non-technical but it is very powerful

Page 37: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

37

iCM API Service - Examples

• Article Get

• Creating a form data object

• Getting a form data object

• Getting multiple form data objects

• Updating a form data object

Page 38: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

38

iCM API Service – Article Get

Page 39: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

39

iCM API Service – Create Form Object

Page 40: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

40

iCM API Service – Get Form Object

Page 41: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

41

iCM API Service – Update Form Object

Page 42: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

42

Invoking iCM API

DEMO

Page 43: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

43

API Server and Forms

• API Server services can be easily invoked from:– Field ‘default’ function– Scripted Action Handlers

• JavaScript library available to help

– These are server side requests so security no an issue

• Invoking services from browser– Required jQuery– API Key should be used

• JavaScript library available to help

• This will be covered in more detail at the next webinar

Page 44: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

44

API Server and Forms

DEMO

Page 45: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

45

New Services Under Development

• Workflow engine – started– Supports BPMN 2.0– Greater control over form workflow– Site users can trigger processes, view status– Site and iCM users can be assigned to tasks to action

• Low level database access – started– Almost complete

• Master media image manipulation – started– Allows site to generate cached images of required size from media image

Page 46: ICM 10.0.0.0 – API Server Gary Ratcliffe. 2 Agenda Webinar Programme API Server Overview JSON-RPC iCM API Service API Server and Forms New services under

Questions?