Upload
martha-norton
View
241
Download
4
Embed Size (px)
Citation preview
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 development
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)
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
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
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
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
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
Overview – Why?
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.
11
API Server Definition in iCM
12
API Server Definition in iCM
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
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": []
}
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
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
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’
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’
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’
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’
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
22
Worker Security
23
Worker Security
24
Worker Security
25
Worker Security
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
27
Configuration Files - workers
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
29
API Server in iCM
DEMO
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
31
JSON-RPC Examples
• Request:– {
"id":"1","method":"greeting","params":{"name": "Gary"},"jsonrpc":"2.0"
}
• Response:– {
"id": "1","result": "Hello Gary""jsonrpc": "2.0",
}
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”
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”
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”
35
API Server JSON-RPC Calls
DEMO
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
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
38
iCM API Service – Article Get
39
iCM API Service – Create Form Object
40
iCM API Service – Get Form Object
41
iCM API Service – Update Form Object
42
Invoking iCM API
DEMO
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
44
API Server and Forms
DEMO
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
Questions?