SlideShare a Scribd company logo
1
UKLUG 2012 – Cardiff, Wales
REST services
and
IBM Domino/XWork
A presentation for ICON UK 2015
21-22 September 2015
by John Dalsgaard
2
UKLUG 2012 – Cardiff, Wales
Agenda
● About me
● Webservices
● REST & JSON
● Domino/XWork – out of the box...
– Domino Access Service (DAS)
– Extension Library controls
– Build your own
– Demos
● Round up
3
UKLUG 2012 – Cardiff, Wales
About me
● Worked with Notes since 1995
version 4.5
● Java since Notes 5.0.7 (2000)
● Large web-apps. (40.000+ users)
● Object Oriented approach since 1999 (yes, in
LotusScript...)
● XPages & mobile apps (Appcelerator Titanium)....
● Certified Principal/advanced administrator and
developer – all versions 4.6 → 9.0
● Developer, project manager, IT manager – own
company (Dalsgaard Data A/S) since 1998.
● IBM Champion for 2015
4
UKLUG 2012 – Cardiff, Wales
About me
5
UKLUG 2012 – Cardiff, Wales
Webservices
● What is a webservice?
– Program to program communication
– Implemementation independent
– ”Contract” about interface
● Traditionally SOAP & XML...
– Very ”verbose” (=not ”light”)
– Needs pre-/post processing to ”extract” data
→ Meet the ”new kid on the block”:
6
UKLUG 2012 – Cardiff, Wales
REST services using JSON
● REST = REpresentational State Transfer
● JSON = JavaScript Object Notation
● Why?? → Loose coupling...
– Angular, Ext.js, etc.
– Mobile apps/web apps
● Let's take a quick look at these terms:
7
UKLUG 2012 – Cardiff, Wales
REST
● Wikipedia:
Representational state transfer (REST) is an abstraction of the
architecture of the World Wide Web; more precisely, REST is an
architectural style consisting of a coordinated set of architectural
constraints applied to components, connectors, and data elements,
within a distributed hypermedia system. REST ignores the details of
component implementation and protocol syntax in order to focus on the
roles of components, the constraints upon their interaction with other
components, and their interpretation of significant data elements.....
WHAT?????
8
UKLUG 2012 – Cardiff, Wales
REST
● Client-server architecture
– Uniform interface separates client from server
● Stateless
– All info in request
● Cacheable communications protocol
– Almost always HTTP
● Uniform interface...
– HTML, URIs, XML, JSON, MIME, meta-data....
● Actually, WWW via HTTP can also be viewed as a REST-based
architecture – so nothing new here that you did not know... :-)
9
UKLUG 2012 – Cardiff, Wales
”RESTful” web-service
● Architectural style:
– URI structure (base URI)
– Internet media type. JSON – or: XML, Atom, …
– Standard HTTP methods:
● GET
● POST
● PUT
● DELETE
… also known as: CRUD (Create, Read, Update,
Delete) methods
10
UKLUG 2012 – Cardiff, Wales
”RESTful” web-service
● Designed for networked applications
● Using HTTP as a simple alternative to more
complex mechanisms to connect between
machines:
– WebServices (SOAP, WSDLs etc.)
– CORBA
– RPC
11
UKLUG 2012 – Cardiff, Wales
”RESTful” web-service
● Example – SOAP:
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:body pb="http://www.acme.com/phonebook">
<pb:GetUserDetails>
<pb:UserID>12345</pb:UserID>
</pb:GetUserDetails>
</soap:Body>
</soap:Envelope>
– … must be sent via a request (HTTP POST)
● Example – RESTful web-service:
http://www.acme.com/phonebook/UserDetails/12345
– … just a URL!! (HTTP GET) – simple....
12
UKLUG 2012 – Cardiff, Wales
JSON
● Wikipedia:
JSON (/ d e sən/ jay-sən), orˈ ʒ ɪ JavaScript Object Notation, is an
open standard format that uses human-readable text to transmit
data objects consisting of attribute–value pairs. It is used primarily
to transmit data between a server and web application, as an
alternative to XML.
Although originally derived from the JavaScript scripting
language, JSON is a language-independent data format. Code for
parsing and generating JSON data is readily available in a large
variety of programming languages.
13
UKLUG 2012 – Cardiff, Wales
JSON
● A syntax for storing & exchanging data
● An easier to use alternative to XML
● Is a lightweight data interchange format
● Is language independant
● Is ”self-describing” and easy to understand
JSON uses JavaScript syntax, but the JSON format is text only,
just like XML. Text can be read and used as a data format by any
programming language...
14
UKLUG 2012 – Cardiff, Wales
JSON vs. XML
● XML
<employees>
<employee>
<firstName>John</firstName> <lastName>Doe</lastName>
</employee>
<employee>
<firstName>Anna</firstName> <lastName>Smith</lastName>
</employee>
<employee>
<firstName>Peter</firstName> <lastName>Jones</lastName>
</employee>
</employees>
● JSON
{"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
]}
15
UKLUG 2012 – Cardiff, Wales
JSON syntax
● Object: {}
{ 'text' : 'Hello world!',
'number' : 123,
'valid' : true }
● Array: []
{ 'numbers' : [ 1, 2, 3 ] }
{ 'objects' : [ {'a':1}, {'b':2}, {'c':3} ] }
● Value:
– string, number, object, array, boolean, null
● Please note: NO date/time type...!!! Grrrrr.....
16
UKLUG 2012 – Cardiff, Wales
JSON and JavaScript
Sample data:
var text = ”{ 'name' : 'ICON UK', 'current' : 2015 }”;
● Create an object:
– var iconUK = JSON.parse(text);
● Create text representation of an object:
– var iconUKText = JSON.stringify(iconUK);
● Refer to attributes:
– var name = iconUK.name;
● Add another attribute:
– iconUK['venue'] = 'London'
17
UKLUG 2012 – Cardiff, Wales
Domino/XWork - out of the box
● Webservices (SOAP, XML, etc...)
– Provider (server) – since 7.0
– Consumer (client) – since 8.0
– Written in LotusScript/Java
RESTful service using JSON →
● Domino Access Services (DAS)
– core service - since 9.0.1
– data service - since 8.5.3 UP1 (~DDS)
– calendar service - since 9.0.1
18
UKLUG 2012 – Cardiff, Wales
Domino Access Services
● Implemented as OSGi plugins/servlets
● Based on Apache Wink
● How to enable & configure
– Web access
– Enable Domino Access Service (DAS)
– Enable for database
– Enable for specific elements
19
UKLUG 2012 – Cardiff, Wales
Enable web access
● HTTP Server must be started.
– Check console: show tasks
HTTP Server Listen for connect requests on TCP Port:80
● Use internet sites – just do it!
– Activate in server document
– Create Internet site document for domain
● After changes: restart task http
● Check:
– Open the server on the port you saw on the console
– http://server.dom.dk:80/ (leave out port if 80)
20
UKLUG 2012 – Cardiff, Wales
Check DAS
Open: server.dom.dk/api
– lists services and
their state
21
UKLUG 2012 – Cardiff, Wales
Enable data service
● On Internet site document (configuration tab):
● Need to refresh http to take effect
– tell http refresh
22
UKLUG 2012 – Cardiff, Wales
DAS: List all ”services” (db's)
● Open: server.dom.dk/api/data
23
UKLUG 2012 – Cardiff, Wales
DAS: Open a specific database
● Try: server.dom.dk/reports.nsf/api/data/collections
→ We need to enable DAS for the database
24
UKLUG 2012 – Cardiff, Wales
DAS: Enable for database
● On the advanced properties of the database:
● Select level in ”Allow Domino Data Service”:
● Important decision:
– Views only or views and documents
25
UKLUG 2012 – Cardiff, Wales
DAS: Open database again
● Try: server.dom.dk/demo/json.nsf/api/data/collections
26
UKLUG 2012 – Cardiff, Wales
DAS: Enable for view
● We need to enable DAS for the view first
● Open the view in Domino Designer
● On the view properties – advanced tab
● Enable: ”Allow Domino Data Service operations”:
● Save the view, open it using the url returned
27
UKLUG 2012 – Cardiff, Wales
DAS: Open a view
● Try: server.dom.dk/.../collections/unid/A892133953...
● Heureka!! - we see a list of all documents!
● Also try: server.dom.dk/.../collections/name/persons
28
UKLUG 2012 – Cardiff, Wales
DAS: Open a document
● Try: server.dom.dk/.../documents/unid/33735D0BC...
● Requires ”Views and documents” to be set in DB props.
29
UKLUG 2012 – Cardiff, Wales
DAS: Writing back...
● Remember content type MUST be:
– application/json
– Set ”Content-type” in header of request
● If you get ”405 Method not allowed”
– Enable method in internet site
● By default these are NOT enabled:
– PUT
– PATCH
– DELETE
– Or override header in your request
● ”X-HTTP-Method-Override” : ”POST”
30
UKLUG 2012 – Cardiff, Wales
DAS: Save existing document
● Use ”PATCH” to change specific fields
– url: …/documents/unid/33735D0BCE799....
– updates only the fields in the request
● Use ”PUT” to change ALL fields
– url: …/documents/unid/33735D0BCE799....
– All fields are replaced with the fields from
request – fields not specified are blanked....
31
UKLUG 2012 – Cardiff, Wales
DAS: Create / delete document
● Use ”POST” to create a document with
specified fields
– url: …/documents?form=Person
– You MUST add form to url
● Use ”DELETE” to remove the document
entirely
– url: …/documents/unid/33735D0BCE799....
32
UKLUG 2012 – Cardiff, Wales
DAS: Data service - more...
● See the design of a view:
– //.../collections/name/persons/design
● Compute values on update of document
– //.../documents/unid/33735D0BC...?computewithform=true
● Use ”normal” url actions to control view collection,
e.g.
– //.../collections/name/persons?start=1&count=2
33
UKLUG 2012 – Cardiff, Wales
Live
D
EM
O
34
UKLUG 2012 – Cardiff, Wales
Demo...
● Server:
– Local VM with Domino 9.0.1FP2 on CentOS 6.7
– Extension Library (from IBM)
– OpenNTF Domino API installed
– OpenNTF Essentials installed
● A demo database (download from Bitbucket.org)
– Showing an MVC pattern I use
– Added a number of JSON demos
– Is available for download
● Tool for testing:
– Google Chrome Postman
35
UKLUG 2012 – Cardiff, Wales
DAS: Calendar service
● There is a ”catch” to enabling this service...
– In the internet site document you have to type
”Calendar” as an option.... - it is not predefined
36
UKLUG 2012 – Cardiff, Wales
DAS: Calendar service
● Built on the new calendar backend classes in
Domino/XWork 9.0.1
● Current user's calendars, email address, and
services
server.dom.dk/api/calendar
● Events from specific calendar
server.dom.dk/demo/cal.nsf/api/calendar/events
● Events from specific calendar (iCal format)
server.dom.dk/.../events?format=iCalendar
● Only shows events that have NOT started yet
37
UKLUG 2012 – Cardiff, Wales
DAS: Calendar service
● You can also CREATE new events!!!
– Using POST and specifiying all fields under an
”events” object
– Handles the various types: Meeting, appointment,
etc.
– Will send invites to participants of meetings
– Handles notifications
– Actions for complete workflow: Accept, decline,
delegate, etc.
– … and more!
38
UKLUG 2012 – Cardiff, Wales
DAS: Calendar service
● You can also UPDATE existing events!!!
– Using PUT and specifiying ALL fields under an
”events” object – as it is returned by creating or
getting the event
● Use ”.../events/<exact id as from request>
–including ”....-Lotus_Auto_Generated” !!!
● You should keep all fields – including system fields
– If you don't → Defaults are applied...
● E.g. specifying only start time → end time set to same..!!!
● Failure to follow these guidelines will result in an error
400 ”Bad request”
39
UKLUG 2012 – Cardiff, Wales
Live
D
EM
O
40
UKLUG 2012 – Cardiff, Wales
Extension Library
● Comes with the Domino 9.0.x server (and Domino
Designer)
● Just needs to be enabled in XSP properties
● Does NOT require DAS to be enabled
● Provides easy to use controls:
– REST Service (data)
– Remote Service (JSON-RPC)
● Allow you to run serverside code as a REST service...
● Also provide support for:
– NSF and OSGi servlets... - advanced stuff!!
41
UKLUG 2012 – Cardiff, Wales
Extension Library
● Why would you use it...????
● → Allows further customizations
– Include/exclude certain data columns
– Include/exclude system columns (@....)
– Calculate contents of own columns
– Run code before/after CRUD operations
– Sort and search
– Create ”handles” (variable) to use in XPage as
datasources
42
UKLUG 2012 – Cardiff, Wales
Ext. Lib. REST Service
● Create a new XPage
● Drag a ”REST Service” component
to it:
● Fill in ”the blanks”
– pathInfo → identifies
the service
– Select service
– Fill in the info
needed for that
type of service
43
UKLUG 2012 – Cardiff, Wales
Ext. Lib. REST Service
● To call your service you open the XPage with the
REST Service control(s) and add the pathInfo,
e.g.:
server.dom.dk/db.nsf/yourpage.xsp/persons
– ...assuming you set pathInfo to ”persons” for one of
the REST Services on the ”yourpage” XPage
44
UKLUG 2012 – Cardiff, Wales
Ext. Lib. NSF servlet
● You can register a servlet to e.g. give you a
JSON representation of a view
● Extends DefaultServletFactory
– add a factory that maps to a service (e.g. view
name)
– Register in Code/Java/META-INF/services
● file: com.ibm.xsp.adapter.servletFactory
→ Full name of servlet class
● Refer to using url, e.g.:
server.dom.dk/db.nsf/xsp/services/Persons
● Does NOT require DAS to be enabled
45
UKLUG 2012 – Cardiff, Wales
Live
D
EM
O
46
UKLUG 2012 – Cardiff, Wales
Build your own...
● Why??
– … using your own MVC – Java objects
– Full control
– Does NOT require DAS to be enabled
● Handy ”ingredients”
– Java
– XPages
● Use an ”XAgent” (or an NSF/OSGi servlet)
● Select a JSON ”package”
– Built-in with XPages
– Or others like GSON – (wrap as plugin!!)
47
UKLUG 2012 – Cardiff, Wales
Build your own...
● Use cases:
– Generate JSON directly from your Java class
– Consume your JSON POSTs directly by parsing
them to the corresponding Java class
→ Ready to use in your logic
– Control e.g. date formating generally for all Date
fields
● Eg. use ISO datetime format
48
UKLUG 2012 – Cardiff, Wales
Build your own...
● LotusScript....
– You didn't expect me to say this!
– An option if you have existing systems with
business logic written in LotusScript
– Simple:
● print – correct content-type
● print …. your JSON (as text)
– … but I would not advice to build new this way →
you would like to use a library/package to build
your JSON for you!
● Does NOT require DAS to be enabled
49
UKLUG 2012 – Cardiff, Wales
Live
D
EM
O
50
UKLUG 2012 – Cardiff, Wales
Round Up
● What are REST and JSON
● GET, POST, PUT, DELETE – ~CRUD
● Domino Access Services – out of the box
– Data
– Calendar
● Extension Library
– REST Service
– (Remote Service)
● Build own solution
– Java & JSON ”package” - …. & LotusScript ;-)
51
UKLUG 2012 – Cardiff, Wales
Questions??
● Did you learn something?
● Could you use it?
?
52
UKLUG 2012 – Cardiff, Wales
Contact info
Please feel free to contact me:
John Dalsgaard
Dalsgaard Data A/S
Solbjergvej 42
Solbjerg
DK-4270 Høng
Phone: +45 4914-1271
Email: john@dalsgaard-data.dk
www.dalsgaard-data.dk
Blog: www.dalsgaard-data.eu
Twitter: @john_dalsgaard, @DalsgaardDataAS
Skype: john_dalsgaard
53
UKLUG 2012 – Cardiff, Wales
Sources & links
● Wikipedia: Representational state transfer
● Learn REST: A Tutorial
● VIEW Tips: Brad Balassaitis on JSON-RPC
● IBM Domino Access Services 9.0.1
● Wikipedia: JSON / JavaScript Object Notation
● Introducing JSON
● JSON Tutorial
● REST services in Domino - Domino Access Services (PDF)
● Extension Library REST Services (PDF)
● Extension Library on OpenNTF (includes demo db)
● JSON test client: Chrome Postman
● Wrap an existing jar into a plugin
● Demo-DB on Bitbucket.org
54
UKLUG 2012 – Cardiff, Wales
Sources & links
● For the advanced – check these frameworks....
– Apache Wink (what DAS etc. is build on)
– … and Wink with OpenNTF Extension Library
– Jersey
– Specifikation: Java API for RESTful Services (JAX-RS)

More Related Content

What's hot

What's New and Next in OpenNTF Domino API (ICON UK 2014)
What's New and Next in OpenNTF Domino API (ICON UK 2014)What's New and Next in OpenNTF Domino API (ICON UK 2014)
What's New and Next in OpenNTF Domino API (ICON UK 2014)
Paul Withers
 
Everything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus scriptEverything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus script
Bill Buchan
 
On the Move, Website Migrations Debunked
On the Move, Website Migrations DebunkedOn the Move, Website Migrations Debunked
On the Move, Website Migrations Debunked
Jonathan Perlman
 
MPLS on Router OS V7 - Part 2
MPLS on Router OS V7 - Part 2MPLS on Router OS V7 - Part 2
MPLS on Router OS V7 - Part 2
GLC Networks
 
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchRestlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
DataStax Academy
 
MongoDB as a fast and queryable cache
MongoDB as a fast and queryable cacheMongoDB as a fast and queryable cache
MongoDB as a fast and queryable cache
MongoDB
 
Zettabyte File System (ZFS)
Zettabyte File System (ZFS)Zettabyte File System (ZFS)
Zettabyte File System (ZFS)
GLC Networks
 
The Dawson Way of Doing Things
The Dawson Way of Doing ThingsThe Dawson Way of Doing Things
The Dawson Way of Doing Things
Jonathan Perlman
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQL
OSInet
 
Reintroducing Web Technology
Reintroducing Web TechnologyReintroducing Web Technology
Reintroducing Web Technology
Isriya Paireepairit
 
Part One: Building Web Apps with the MERN Stack
Part One: Building Web Apps with the MERN StackPart One: Building Web Apps with the MERN Stack
Part One: Building Web Apps with the MERN Stack
MongoDB
 
ODN - Technical introduction of the platform
ODN - Technical introduction of the platformODN - Technical introduction of the platform
ODN - Technical introduction of the platform
Comsode - FP7 project
 
Web Services
Web ServicesWeb Services
Web Services
Katrien Verbert
 
Balisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionBalisage - EXPath - A practical introduction
Balisage - EXPath - A practical introduction
Florent Georges
 
Xml schema
Xml schemaXml schema
Xml schema
Dr.Saranya K.G
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
Alive Kuo
 

What's hot (16)

What's New and Next in OpenNTF Domino API (ICON UK 2014)
What's New and Next in OpenNTF Domino API (ICON UK 2014)What's New and Next in OpenNTF Domino API (ICON UK 2014)
What's New and Next in OpenNTF Domino API (ICON UK 2014)
 
Everything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus scriptEverything you ever wanted to know about lotus script
Everything you ever wanted to know about lotus script
 
On the Move, Website Migrations Debunked
On the Move, Website Migrations DebunkedOn the Move, Website Migrations Debunked
On the Move, Website Migrations Debunked
 
MPLS on Router OS V7 - Part 2
MPLS on Router OS V7 - Part 2MPLS on Router OS V7 - Part 2
MPLS on Router OS V7 - Part 2
 
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise SearchRestlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
Restlet: Building a multi-tenant API PaaS with DataStax Enterprise Search
 
MongoDB as a fast and queryable cache
MongoDB as a fast and queryable cacheMongoDB as a fast and queryable cache
MongoDB as a fast and queryable cache
 
Zettabyte File System (ZFS)
Zettabyte File System (ZFS)Zettabyte File System (ZFS)
Zettabyte File System (ZFS)
 
The Dawson Way of Doing Things
The Dawson Way of Doing ThingsThe Dawson Way of Doing Things
The Dawson Way of Doing Things
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQL
 
Reintroducing Web Technology
Reintroducing Web TechnologyReintroducing Web Technology
Reintroducing Web Technology
 
Part One: Building Web Apps with the MERN Stack
Part One: Building Web Apps with the MERN StackPart One: Building Web Apps with the MERN Stack
Part One: Building Web Apps with the MERN Stack
 
ODN - Technical introduction of the platform
ODN - Technical introduction of the platformODN - Technical introduction of the platform
ODN - Technical introduction of the platform
 
Web Services
Web ServicesWeb Services
Web Services
 
Balisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionBalisage - EXPath - A practical introduction
Balisage - EXPath - A practical introduction
 
Xml schema
Xml schemaXml schema
Xml schema
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
 

Viewers also liked

Out of the Blue - the Workflow in Bluemix Development
Out of the Blue - the Workflow in Bluemix DevelopmentOut of the Blue - the Workflow in Bluemix Development
Out of the Blue - the Workflow in Bluemix Development
Oliver Busse
 
ICON UK 2015 - ODA and CrossWorlds
ICON UK 2015 - ODA and CrossWorldsICON UK 2015 - ODA and CrossWorlds
ICON UK 2015 - ODA and CrossWorlds
Paul Withers
 
Planning & Completing An IBM Connections Upgrade
Planning & Completing An IBM Connections UpgradePlanning & Completing An IBM Connections Upgrade
Planning & Completing An IBM Connections Upgrade
Gabriella Davis
 
Changing technologies
Changing technologiesChanging technologies
Changing technologies
Gabriella Davis
 
Pentesting RESTful webservices
Pentesting RESTful webservicesPentesting RESTful webservices
Pentesting RESTful webservices
Mohammed A. Imran
 
Getting to the core, requirements gathering in the wild
Getting to the core, requirements gathering in the wildGetting to the core, requirements gathering in the wild
Getting to the core, requirements gathering in the wild
Femke Goedhart
 

Viewers also liked (6)

Out of the Blue - the Workflow in Bluemix Development
Out of the Blue - the Workflow in Bluemix DevelopmentOut of the Blue - the Workflow in Bluemix Development
Out of the Blue - the Workflow in Bluemix Development
 
ICON UK 2015 - ODA and CrossWorlds
ICON UK 2015 - ODA and CrossWorldsICON UK 2015 - ODA and CrossWorlds
ICON UK 2015 - ODA and CrossWorlds
 
Planning & Completing An IBM Connections Upgrade
Planning & Completing An IBM Connections UpgradePlanning & Completing An IBM Connections Upgrade
Planning & Completing An IBM Connections Upgrade
 
Changing technologies
Changing technologiesChanging technologies
Changing technologies
 
Pentesting RESTful webservices
Pentesting RESTful webservicesPentesting RESTful webservices
Pentesting RESTful webservices
 
Getting to the core, requirements gathering in the wild
Getting to the core, requirements gathering in the wildGetting to the core, requirements gathering in the wild
Getting to the core, requirements gathering in the wild
 

Similar to RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)

Talend connect BE Vincent Harcq - Talend ESB - DI
Talend connect BE Vincent Harcq - Talend  ESB - DITalend connect BE Vincent Harcq - Talend  ESB - DI
Talend connect BE Vincent Harcq - Talend ESB - DI
Vincent Harcq
 
GoldenGate and Oracle Data Integrator - A Perfect Match- Upgrade to 12c
GoldenGate and Oracle Data Integrator - A Perfect Match- Upgrade to 12cGoldenGate and Oracle Data Integrator - A Perfect Match- Upgrade to 12c
GoldenGate and Oracle Data Integrator - A Perfect Match- Upgrade to 12c
Michael Rainey
 
Ar*@!+$es to this. getting IBM connections to do what you want
Ar*@!+$es to this. getting IBM connections to do what you want Ar*@!+$es to this. getting IBM connections to do what you want
Ar*@!+$es to this. getting IBM connections to do what you want
Mark Myers
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...
Ari Jolma
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotCloud
daoswald
 
Todd vatalaro oracle 2004
Todd vatalaro oracle 2004Todd vatalaro oracle 2004
Todd vatalaro oracle 2004
Todd Vatalaro
 
Open Data Node - Platform and Methodology - 2015-May
Open Data Node - Platform and Methodology - 2015-MayOpen Data Node - Platform and Methodology - 2015-May
Open Data Node - Platform and Methodology - 2015-May
Comsode - FP7 project
 
Slides semantic web and Drupal 7 NYCCamp 2012
Slides semantic web and Drupal 7 NYCCamp 2012Slides semantic web and Drupal 7 NYCCamp 2012
Slides semantic web and Drupal 7 NYCCamp 2012
scorlosquet
 
Introduction to W3C Linked Data Platform
Introduction to W3C Linked Data PlatformIntroduction to W3C Linked Data Platform
Introduction to W3C Linked Data Platform
Nandana Mihindukulasooriya
 
TechEvent EUS, Kerberos, SSL and OUD
TechEvent EUS, Kerberos, SSL and OUDTechEvent EUS, Kerberos, SSL and OUD
TechEvent EUS, Kerberos, SSL and OUD
Trivadis
 
Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1
GLC Networks
 
OData – Super Cola W3
OData – Super Cola W3OData – Super Cola W3
OData – Super Cola W3
Comunidade NetPonto
 
Apache solr
Apache solrApache solr
Apache solr
Péter Király
 
Building Local-loop Services for Customers
Building Local-loop Services for CustomersBuilding Local-loop Services for Customers
Building Local-loop Services for Customers
GLC Networks
 
The lazy administrator, how to make your life easier by using tdi to automate...
The lazy administrator, how to make your life easier by using tdi to automate...The lazy administrator, how to make your life easier by using tdi to automate...
The lazy administrator, how to make your life easier by using tdi to automate...
Klaus Bild
 
The complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, Paris
The complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, ParisThe complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, Paris
The complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, Paris
OW2
 
webthing-floss-iot-20180607rzr
webthing-floss-iot-20180607rzrwebthing-floss-iot-20180607rzr
webthing-floss-iot-20180607rzr
Phil www.rzr.online.fr
 
The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
Samsung Open Source Group
 

Similar to RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015) (20)

Talend connect BE Vincent Harcq - Talend ESB - DI
Talend connect BE Vincent Harcq - Talend  ESB - DITalend connect BE Vincent Harcq - Talend  ESB - DI
Talend connect BE Vincent Harcq - Talend ESB - DI
 
GoldenGate and Oracle Data Integrator - A Perfect Match- Upgrade to 12c
GoldenGate and Oracle Data Integrator - A Perfect Match- Upgrade to 12cGoldenGate and Oracle Data Integrator - A Perfect Match- Upgrade to 12c
GoldenGate and Oracle Data Integrator - A Perfect Match- Upgrade to 12c
 
Ar*@!+$es to this. getting IBM connections to do what you want
Ar*@!+$es to this. getting IBM connections to do what you want Ar*@!+$es to this. getting IBM connections to do what you want
Ar*@!+$es to this. getting IBM connections to do what you want
 
Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...Geospatial web services using little-known GDAL features and modern Perl midd...
Geospatial web services using little-known GDAL features and modern Perl midd...
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Deploying Perl apps on dotCloud
Deploying Perl apps on dotCloudDeploying Perl apps on dotCloud
Deploying Perl apps on dotCloud
 
Todd vatalaro oracle 2004
Todd vatalaro oracle 2004Todd vatalaro oracle 2004
Todd vatalaro oracle 2004
 
Open Data Node - Platform and Methodology - 2015-May
Open Data Node - Platform and Methodology - 2015-MayOpen Data Node - Platform and Methodology - 2015-May
Open Data Node - Platform and Methodology - 2015-May
 
Slides semantic web and Drupal 7 NYCCamp 2012
Slides semantic web and Drupal 7 NYCCamp 2012Slides semantic web and Drupal 7 NYCCamp 2012
Slides semantic web and Drupal 7 NYCCamp 2012
 
Introduction to W3C Linked Data Platform
Introduction to W3C Linked Data PlatformIntroduction to W3C Linked Data Platform
Introduction to W3C Linked Data Platform
 
TechEvent EUS, Kerberos, SSL and OUD
TechEvent EUS, Kerberos, SSL and OUDTechEvent EUS, Kerberos, SSL and OUD
TechEvent EUS, Kerberos, SSL and OUD
 
Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1Automatic Backup via FTP - Part 1
Automatic Backup via FTP - Part 1
 
OData – Super Cola W3
OData – Super Cola W3OData – Super Cola W3
OData – Super Cola W3
 
Apache solr
Apache solrApache solr
Apache solr
 
Building Local-loop Services for Customers
Building Local-loop Services for CustomersBuilding Local-loop Services for Customers
Building Local-loop Services for Customers
 
The lazy administrator, how to make your life easier by using tdi to automate...
The lazy administrator, how to make your life easier by using tdi to automate...The lazy administrator, how to make your life easier by using tdi to automate...
The lazy administrator, how to make your life easier by using tdi to automate...
 
The complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, Paris
The complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, ParisThe complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, Paris
The complex IoT equation, and FLOSS solutions, OW2con'18, June 7-8, 2018, Paris
 
webthing-floss-iot-20180607rzr
webthing-floss-iot-20180607rzrwebthing-floss-iot-20180607rzr
webthing-floss-iot-20180607rzr
 
The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
 

Recently uploaded

GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Ukraine
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's TipsGetting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
ScyllaDB
 
ScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking ReplicationScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking Replication
ScyllaDB
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptxAI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
Sunil Jagani
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Discover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched ContentDiscover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched Content
ScyllaDB
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
UiPathCommunity
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
Sease
 
Introducing BoxLang : A new JVM language for productivity and modularity!
Introducing BoxLang : A new JVM language for productivity and modularity!Introducing BoxLang : A new JVM language for productivity and modularity!
Introducing BoxLang : A new JVM language for productivity and modularity!
Ortus Solutions, Corp
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
Fwdays
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Neo4j
 
AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)
HarpalGohil4
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 

Recently uploaded (20)

GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's TipsGetting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
 
ScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking ReplicationScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking Replication
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptxAI in the Workplace Reskilling, Upskilling, and Future Work.pptx
AI in the Workplace Reskilling, Upskilling, and Future Work.pptx
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Discover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched ContentDiscover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched Content
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
 
Introducing BoxLang : A new JVM language for productivity and modularity!
Introducing BoxLang : A new JVM language for productivity and modularity!Introducing BoxLang : A new JVM language for productivity and modularity!
Introducing BoxLang : A new JVM language for productivity and modularity!
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
 
AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 

RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)

  • 1. 1 UKLUG 2012 – Cardiff, Wales REST services and IBM Domino/XWork A presentation for ICON UK 2015 21-22 September 2015 by John Dalsgaard
  • 2. 2 UKLUG 2012 – Cardiff, Wales Agenda ● About me ● Webservices ● REST & JSON ● Domino/XWork – out of the box... – Domino Access Service (DAS) – Extension Library controls – Build your own – Demos ● Round up
  • 3. 3 UKLUG 2012 – Cardiff, Wales About me ● Worked with Notes since 1995 version 4.5 ● Java since Notes 5.0.7 (2000) ● Large web-apps. (40.000+ users) ● Object Oriented approach since 1999 (yes, in LotusScript...) ● XPages & mobile apps (Appcelerator Titanium).... ● Certified Principal/advanced administrator and developer – all versions 4.6 → 9.0 ● Developer, project manager, IT manager – own company (Dalsgaard Data A/S) since 1998. ● IBM Champion for 2015
  • 4. 4 UKLUG 2012 – Cardiff, Wales About me
  • 5. 5 UKLUG 2012 – Cardiff, Wales Webservices ● What is a webservice? – Program to program communication – Implemementation independent – ”Contract” about interface ● Traditionally SOAP & XML... – Very ”verbose” (=not ”light”) – Needs pre-/post processing to ”extract” data → Meet the ”new kid on the block”:
  • 6. 6 UKLUG 2012 – Cardiff, Wales REST services using JSON ● REST = REpresentational State Transfer ● JSON = JavaScript Object Notation ● Why?? → Loose coupling... – Angular, Ext.js, etc. – Mobile apps/web apps ● Let's take a quick look at these terms:
  • 7. 7 UKLUG 2012 – Cardiff, Wales REST ● Wikipedia: Representational state transfer (REST) is an abstraction of the architecture of the World Wide Web; more precisely, REST is an architectural style consisting of a coordinated set of architectural constraints applied to components, connectors, and data elements, within a distributed hypermedia system. REST ignores the details of component implementation and protocol syntax in order to focus on the roles of components, the constraints upon their interaction with other components, and their interpretation of significant data elements..... WHAT?????
  • 8. 8 UKLUG 2012 – Cardiff, Wales REST ● Client-server architecture – Uniform interface separates client from server ● Stateless – All info in request ● Cacheable communications protocol – Almost always HTTP ● Uniform interface... – HTML, URIs, XML, JSON, MIME, meta-data.... ● Actually, WWW via HTTP can also be viewed as a REST-based architecture – so nothing new here that you did not know... :-)
  • 9. 9 UKLUG 2012 – Cardiff, Wales ”RESTful” web-service ● Architectural style: – URI structure (base URI) – Internet media type. JSON – or: XML, Atom, … – Standard HTTP methods: ● GET ● POST ● PUT ● DELETE … also known as: CRUD (Create, Read, Update, Delete) methods
  • 10. 10 UKLUG 2012 – Cardiff, Wales ”RESTful” web-service ● Designed for networked applications ● Using HTTP as a simple alternative to more complex mechanisms to connect between machines: – WebServices (SOAP, WSDLs etc.) – CORBA – RPC
  • 11. 11 UKLUG 2012 – Cardiff, Wales ”RESTful” web-service ● Example – SOAP: <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:body pb="http://www.acme.com/phonebook"> <pb:GetUserDetails> <pb:UserID>12345</pb:UserID> </pb:GetUserDetails> </soap:Body> </soap:Envelope> – … must be sent via a request (HTTP POST) ● Example – RESTful web-service: http://www.acme.com/phonebook/UserDetails/12345 – … just a URL!! (HTTP GET) – simple....
  • 12. 12 UKLUG 2012 – Cardiff, Wales JSON ● Wikipedia: JSON (/ d e sən/ jay-sən), orˈ ʒ ɪ JavaScript Object Notation, is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML. Although originally derived from the JavaScript scripting language, JSON is a language-independent data format. Code for parsing and generating JSON data is readily available in a large variety of programming languages.
  • 13. 13 UKLUG 2012 – Cardiff, Wales JSON ● A syntax for storing & exchanging data ● An easier to use alternative to XML ● Is a lightweight data interchange format ● Is language independant ● Is ”self-describing” and easy to understand JSON uses JavaScript syntax, but the JSON format is text only, just like XML. Text can be read and used as a data format by any programming language...
  • 14. 14 UKLUG 2012 – Cardiff, Wales JSON vs. XML ● XML <employees> <employee> <firstName>John</firstName> <lastName>Doe</lastName> </employee> <employee> <firstName>Anna</firstName> <lastName>Smith</lastName> </employee> <employee> <firstName>Peter</firstName> <lastName>Jones</lastName> </employee> </employees> ● JSON {"employees":[ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Anna", "lastName":"Smith"}, {"firstName":"Peter", "lastName":"Jones"} ]}
  • 15. 15 UKLUG 2012 – Cardiff, Wales JSON syntax ● Object: {} { 'text' : 'Hello world!', 'number' : 123, 'valid' : true } ● Array: [] { 'numbers' : [ 1, 2, 3 ] } { 'objects' : [ {'a':1}, {'b':2}, {'c':3} ] } ● Value: – string, number, object, array, boolean, null ● Please note: NO date/time type...!!! Grrrrr.....
  • 16. 16 UKLUG 2012 – Cardiff, Wales JSON and JavaScript Sample data: var text = ”{ 'name' : 'ICON UK', 'current' : 2015 }”; ● Create an object: – var iconUK = JSON.parse(text); ● Create text representation of an object: – var iconUKText = JSON.stringify(iconUK); ● Refer to attributes: – var name = iconUK.name; ● Add another attribute: – iconUK['venue'] = 'London'
  • 17. 17 UKLUG 2012 – Cardiff, Wales Domino/XWork - out of the box ● Webservices (SOAP, XML, etc...) – Provider (server) – since 7.0 – Consumer (client) – since 8.0 – Written in LotusScript/Java RESTful service using JSON → ● Domino Access Services (DAS) – core service - since 9.0.1 – data service - since 8.5.3 UP1 (~DDS) – calendar service - since 9.0.1
  • 18. 18 UKLUG 2012 – Cardiff, Wales Domino Access Services ● Implemented as OSGi plugins/servlets ● Based on Apache Wink ● How to enable & configure – Web access – Enable Domino Access Service (DAS) – Enable for database – Enable for specific elements
  • 19. 19 UKLUG 2012 – Cardiff, Wales Enable web access ● HTTP Server must be started. – Check console: show tasks HTTP Server Listen for connect requests on TCP Port:80 ● Use internet sites – just do it! – Activate in server document – Create Internet site document for domain ● After changes: restart task http ● Check: – Open the server on the port you saw on the console – http://server.dom.dk:80/ (leave out port if 80)
  • 20. 20 UKLUG 2012 – Cardiff, Wales Check DAS Open: server.dom.dk/api – lists services and their state
  • 21. 21 UKLUG 2012 – Cardiff, Wales Enable data service ● On Internet site document (configuration tab): ● Need to refresh http to take effect – tell http refresh
  • 22. 22 UKLUG 2012 – Cardiff, Wales DAS: List all ”services” (db's) ● Open: server.dom.dk/api/data
  • 23. 23 UKLUG 2012 – Cardiff, Wales DAS: Open a specific database ● Try: server.dom.dk/reports.nsf/api/data/collections → We need to enable DAS for the database
  • 24. 24 UKLUG 2012 – Cardiff, Wales DAS: Enable for database ● On the advanced properties of the database: ● Select level in ”Allow Domino Data Service”: ● Important decision: – Views only or views and documents
  • 25. 25 UKLUG 2012 – Cardiff, Wales DAS: Open database again ● Try: server.dom.dk/demo/json.nsf/api/data/collections
  • 26. 26 UKLUG 2012 – Cardiff, Wales DAS: Enable for view ● We need to enable DAS for the view first ● Open the view in Domino Designer ● On the view properties – advanced tab ● Enable: ”Allow Domino Data Service operations”: ● Save the view, open it using the url returned
  • 27. 27 UKLUG 2012 – Cardiff, Wales DAS: Open a view ● Try: server.dom.dk/.../collections/unid/A892133953... ● Heureka!! - we see a list of all documents! ● Also try: server.dom.dk/.../collections/name/persons
  • 28. 28 UKLUG 2012 – Cardiff, Wales DAS: Open a document ● Try: server.dom.dk/.../documents/unid/33735D0BC... ● Requires ”Views and documents” to be set in DB props.
  • 29. 29 UKLUG 2012 – Cardiff, Wales DAS: Writing back... ● Remember content type MUST be: – application/json – Set ”Content-type” in header of request ● If you get ”405 Method not allowed” – Enable method in internet site ● By default these are NOT enabled: – PUT – PATCH – DELETE – Or override header in your request ● ”X-HTTP-Method-Override” : ”POST”
  • 30. 30 UKLUG 2012 – Cardiff, Wales DAS: Save existing document ● Use ”PATCH” to change specific fields – url: …/documents/unid/33735D0BCE799.... – updates only the fields in the request ● Use ”PUT” to change ALL fields – url: …/documents/unid/33735D0BCE799.... – All fields are replaced with the fields from request – fields not specified are blanked....
  • 31. 31 UKLUG 2012 – Cardiff, Wales DAS: Create / delete document ● Use ”POST” to create a document with specified fields – url: …/documents?form=Person – You MUST add form to url ● Use ”DELETE” to remove the document entirely – url: …/documents/unid/33735D0BCE799....
  • 32. 32 UKLUG 2012 – Cardiff, Wales DAS: Data service - more... ● See the design of a view: – //.../collections/name/persons/design ● Compute values on update of document – //.../documents/unid/33735D0BC...?computewithform=true ● Use ”normal” url actions to control view collection, e.g. – //.../collections/name/persons?start=1&count=2
  • 33. 33 UKLUG 2012 – Cardiff, Wales Live D EM O
  • 34. 34 UKLUG 2012 – Cardiff, Wales Demo... ● Server: – Local VM with Domino 9.0.1FP2 on CentOS 6.7 – Extension Library (from IBM) – OpenNTF Domino API installed – OpenNTF Essentials installed ● A demo database (download from Bitbucket.org) – Showing an MVC pattern I use – Added a number of JSON demos – Is available for download ● Tool for testing: – Google Chrome Postman
  • 35. 35 UKLUG 2012 – Cardiff, Wales DAS: Calendar service ● There is a ”catch” to enabling this service... – In the internet site document you have to type ”Calendar” as an option.... - it is not predefined
  • 36. 36 UKLUG 2012 – Cardiff, Wales DAS: Calendar service ● Built on the new calendar backend classes in Domino/XWork 9.0.1 ● Current user's calendars, email address, and services server.dom.dk/api/calendar ● Events from specific calendar server.dom.dk/demo/cal.nsf/api/calendar/events ● Events from specific calendar (iCal format) server.dom.dk/.../events?format=iCalendar ● Only shows events that have NOT started yet
  • 37. 37 UKLUG 2012 – Cardiff, Wales DAS: Calendar service ● You can also CREATE new events!!! – Using POST and specifiying all fields under an ”events” object – Handles the various types: Meeting, appointment, etc. – Will send invites to participants of meetings – Handles notifications – Actions for complete workflow: Accept, decline, delegate, etc. – … and more!
  • 38. 38 UKLUG 2012 – Cardiff, Wales DAS: Calendar service ● You can also UPDATE existing events!!! – Using PUT and specifiying ALL fields under an ”events” object – as it is returned by creating or getting the event ● Use ”.../events/<exact id as from request> –including ”....-Lotus_Auto_Generated” !!! ● You should keep all fields – including system fields – If you don't → Defaults are applied... ● E.g. specifying only start time → end time set to same..!!! ● Failure to follow these guidelines will result in an error 400 ”Bad request”
  • 39. 39 UKLUG 2012 – Cardiff, Wales Live D EM O
  • 40. 40 UKLUG 2012 – Cardiff, Wales Extension Library ● Comes with the Domino 9.0.x server (and Domino Designer) ● Just needs to be enabled in XSP properties ● Does NOT require DAS to be enabled ● Provides easy to use controls: – REST Service (data) – Remote Service (JSON-RPC) ● Allow you to run serverside code as a REST service... ● Also provide support for: – NSF and OSGi servlets... - advanced stuff!!
  • 41. 41 UKLUG 2012 – Cardiff, Wales Extension Library ● Why would you use it...???? ● → Allows further customizations – Include/exclude certain data columns – Include/exclude system columns (@....) – Calculate contents of own columns – Run code before/after CRUD operations – Sort and search – Create ”handles” (variable) to use in XPage as datasources
  • 42. 42 UKLUG 2012 – Cardiff, Wales Ext. Lib. REST Service ● Create a new XPage ● Drag a ”REST Service” component to it: ● Fill in ”the blanks” – pathInfo → identifies the service – Select service – Fill in the info needed for that type of service
  • 43. 43 UKLUG 2012 – Cardiff, Wales Ext. Lib. REST Service ● To call your service you open the XPage with the REST Service control(s) and add the pathInfo, e.g.: server.dom.dk/db.nsf/yourpage.xsp/persons – ...assuming you set pathInfo to ”persons” for one of the REST Services on the ”yourpage” XPage
  • 44. 44 UKLUG 2012 – Cardiff, Wales Ext. Lib. NSF servlet ● You can register a servlet to e.g. give you a JSON representation of a view ● Extends DefaultServletFactory – add a factory that maps to a service (e.g. view name) – Register in Code/Java/META-INF/services ● file: com.ibm.xsp.adapter.servletFactory → Full name of servlet class ● Refer to using url, e.g.: server.dom.dk/db.nsf/xsp/services/Persons ● Does NOT require DAS to be enabled
  • 45. 45 UKLUG 2012 – Cardiff, Wales Live D EM O
  • 46. 46 UKLUG 2012 – Cardiff, Wales Build your own... ● Why?? – … using your own MVC – Java objects – Full control – Does NOT require DAS to be enabled ● Handy ”ingredients” – Java – XPages ● Use an ”XAgent” (or an NSF/OSGi servlet) ● Select a JSON ”package” – Built-in with XPages – Or others like GSON – (wrap as plugin!!)
  • 47. 47 UKLUG 2012 – Cardiff, Wales Build your own... ● Use cases: – Generate JSON directly from your Java class – Consume your JSON POSTs directly by parsing them to the corresponding Java class → Ready to use in your logic – Control e.g. date formating generally for all Date fields ● Eg. use ISO datetime format
  • 48. 48 UKLUG 2012 – Cardiff, Wales Build your own... ● LotusScript.... – You didn't expect me to say this! – An option if you have existing systems with business logic written in LotusScript – Simple: ● print – correct content-type ● print …. your JSON (as text) – … but I would not advice to build new this way → you would like to use a library/package to build your JSON for you! ● Does NOT require DAS to be enabled
  • 49. 49 UKLUG 2012 – Cardiff, Wales Live D EM O
  • 50. 50 UKLUG 2012 – Cardiff, Wales Round Up ● What are REST and JSON ● GET, POST, PUT, DELETE – ~CRUD ● Domino Access Services – out of the box – Data – Calendar ● Extension Library – REST Service – (Remote Service) ● Build own solution – Java & JSON ”package” - …. & LotusScript ;-)
  • 51. 51 UKLUG 2012 – Cardiff, Wales Questions?? ● Did you learn something? ● Could you use it? ?
  • 52. 52 UKLUG 2012 – Cardiff, Wales Contact info Please feel free to contact me: John Dalsgaard Dalsgaard Data A/S Solbjergvej 42 Solbjerg DK-4270 Høng Phone: +45 4914-1271 Email: john@dalsgaard-data.dk www.dalsgaard-data.dk Blog: www.dalsgaard-data.eu Twitter: @john_dalsgaard, @DalsgaardDataAS Skype: john_dalsgaard
  • 53. 53 UKLUG 2012 – Cardiff, Wales Sources & links ● Wikipedia: Representational state transfer ● Learn REST: A Tutorial ● VIEW Tips: Brad Balassaitis on JSON-RPC ● IBM Domino Access Services 9.0.1 ● Wikipedia: JSON / JavaScript Object Notation ● Introducing JSON ● JSON Tutorial ● REST services in Domino - Domino Access Services (PDF) ● Extension Library REST Services (PDF) ● Extension Library on OpenNTF (includes demo db) ● JSON test client: Chrome Postman ● Wrap an existing jar into a plugin ● Demo-DB on Bitbucket.org
  • 54. 54 UKLUG 2012 – Cardiff, Wales Sources & links ● For the advanced – check these frameworks.... – Apache Wink (what DAS etc. is build on) – … and Wink with OpenNTF Extension Library – Jersey – Specifikation: Java API for RESTful Services (JAX-RS)