SlideShare a Scribd company logo
© 2013 Wellesley Information Services. All rights reserved.
C&S APIs in
IBM Notes and Domino
Dave Delay
IBM
2
Please Note ...
IBM’s statements regarding its plans, directions, and intent are subject to change or
withdrawal without notice at IBM’s sole discretion.
Information regarding potential future products is intended to outline our general product
direction and it should not be relied on in making a purchasing decision.
The information mentioned regarding potential future products is not a commitment,
promise, or legal obligation to deliver any material, code or functionality. Information
about potential future products may not be incorporated into any contract. The
development, release, and timing of any future features or functionality described for our
products remains at our sole discretion.
3
What We’ll Cover …
• Overview of C&S APIs
• C&S in the C API toolkit
• C&S in LotusScript, Java and SSJS
• REST calendar service
• Wrap-up
4
9.0 Social Edition C&S API Design Goals
• Allow an application to manage data on a user's calendar
 Includes robust and reliable scheduling
 Does not include ToDos, busy-time, and rooms & resources
• Keep it simple
 Encapsulate the Notes/Domino data and recurrence model
 Leverage the iCalendar standard
• Available to developers working in C/C++, LotusScript, Java and
server-side JavaScript
• Easily expandable in future releases
5
C&S APIs Available in 9.0 Social Edition
C API Toolkit (calapi.h)
Java Wrappers
LotusScript
Wrappers
Core C&S Logic
NotesCalendar Back-end Classes
Customer
solutions
using
LotusScript
Customer solutions using
Notes Java API
Customer
solutions
using C / C++
Customer
solutions
using
SSJS
JS Wrappers
• One C&S implementation; multiple interfaces
• All four interfaces are new in 9.0
6
What is iCalendar?
• Text-based, standard representation of calendar data (see
RFC5545)
• Open source iCalendar libraries available (e.g. ical4j & libical)
iCalendar Example:
BEGIN:VCALENDAR
PRODID:-//Renovations Inc//MyApp 1.0//EN
BEGIN:VEVENT
DTSTART:20130204T140000Z
DTEND:20130204T143000Z
SUMMARY:Team meeting
ORGANIZER;CN="Samantha Daryn":mailto:sdaryn@renovations.com
ATTENDEE;CN="Ted Amado":mailto:tamado@renovations.com
DESCRIPTION:Discuss status
LOCATION:My office
END:VEVENT
END:VCALENDAR
7
C&S API Features
• Working with calendar entries
 Read a range of entries
 Create, read, update or delete an individual calendar entry
 Implicit scheduling for meetings
 Simple actions on meetings (decline, delegate, cancel, etc.)
 Complete support for repeating entries
 Support for all entry types (meetings, appointments, all day
events, anniversaries, reminders)
• Working with calendar notices
 Read the list of new invitations
 Read a list of unapplied notices (for an entry)
 Process a notice (accept, decline, delegate, counter, etc.)
8
What We’ll Cover …
• Overview of C&S APIs
• C&S in the C API toolkit
• C&S in LotusScript, Java and SSJS
• REST calendar service
• Wrap-up
9
C&S in the C API Toolkit
• All functions defined in calapi.h
• The C API is the foundation for all other
language bindings
• Implemented using core C&S and iCalendar logic
• Can be used with open source libical
C API Toolkit (calapi.h)
Core C&S Logic
Customer
solutions
using C / C++
10
A Few Calendar Entry Functions (C API)
• Read the iCalendar representation for a range of events
 STATUS CalReadRange(DBHANDLE hDB, TIMEDATE tdStart,
TIMEDATE tdEnd, ...);
• Read the iCalendar for a single event
 STATUS CalReadEntry(DBHANDLE hDB, const char* pszUID,
const char* pszRecurID, ...);
• Create a new event from iCalendar
 STATUS CalCreateEntry(DBHANDLE hDB, const char*
pszCalEntry, DWORD dwFlags, ...);
11
A Few Calendar Notice Functions (C API)
• Get a list of new invitations
 STATUS CalGetNewInvitations(DBHANDLE hDB, TIMEDATE*
ptdStart, ...);
• Get a list of notices for a single event
 STATUS CalGetUnappliedNotices(DBHANDLE hDB, const char*
pszUID, ...);
• Process a single notice (accept, decline, etc.)
 STATUS CalNoticeAction(DBHANDLE hDB, NOTEID noteID,
DWORD dwAction, ...);
12
Debugging the C API functions
• Notes.ini setting for tracing the C&S API
 CSDebugAPI=1
• This works for the LotusScript, Java and SSJS classes too
Sample console log:
[268C:000A-188C] 04/05/2013 09:03:30.65 AM [CS API]> Enter CalReadEntry,
UID:A6F3B8508B90461A85257B4100601786-Lotus_Notes_Generated, RID:NULL, Flags:0x0.
[268C:000A-188C] 04/05/2013 09:03:30.69 AM [CS API]> Exit CalReadEntry,
return:0x0000, No error.
[268C:000A-188C] 04/05/2013 09:07:49.97 AM [CS API]> Enter CalCreateEntry,
Flags:0x0.
[268C:000A-188C] 04/05/2013 09:07:50.45 AM [CS API]> PRODID required in C&S API
input but was not found
[268C:000A-188C] 04/05/2013 09:07:50.45 AM [CS API]> Error |
ConvertIcal2NoteRequest.cpp(189) : Missing VEvent components (0x892)
[268C:000A-188C] 04/05/2013 09:07:50.49 AM [CS API]> Error |
VersitInterface.cpp(1769) : Missing VEvent components (0x892)
[268C:000A-188C] 04/05/2013 09:07:50.49 AM [CS API]> Error |
VersitInterface.cpp(1966) : Missing VEvent components (0x892)
[268C:000A-188C] 04/05/2013 09:07:50.49 AM [CS API]> Error |
calendarapiworker.cpp(405) : Missing VEvent components (0x892)
[268C:000A-188C] 04/05/2013 09:07:50.49 AM [CS API]> Exit CalCreateEntry,
return:0x0892, Missing VEvent components.
[268C:000A-188C] 04/05/2013 09:07:50.49 AM [CS API]> Error | calendarapi.c(370) :
Missing VEvent components (0x892)
13
C API Documentation
• A complete function reference is included in the C API toolkit
• The calapi.h file also has lots of useful comments
Sample comment:
/*********************************************************************************
* CalReadRange
* This will return data for all entries that begin within a specified date range,
* with paging capabilities (similar to NIFReadEntries) in cases where there is
* more data than can be returned in a single call.
* Specifically, this can return one or both of:
* 1) iCalendar generated from view level data about the calendar entries in the
* date range
* 2) A list of UIDs for each calendar entry in the date range
*
* ...
*
* Inputs: ...
*
* Outputs: ...
*
* Returns: ...
*/
14
What We’ll Cover …
• Overview of C&S APIs
• C&S in the C API toolkit
• C&S in LotusScript, Java and SSJS
• REST calendar service
• Wrap-up
15
C&S in LotusScript, Java & SSJS
• One object model
 NotesCalendar
 NotesCalendarEntry
 NotesCalendarNotice
• Three language bindings
• Java developers can use
open source ical4j
C API Toolkit (calapi.h)
Java Wrappers
LotusScript
Wrappers
Core C&S Logic
NotesCalendar Back-end Classes
Customer
solutions
using
LotusScript
Customer
solutions
using
Notes Java
API
Customer
solutions
using
SSJS
JS Wrappers
16
C&S Backend Classes
Session
getCalendar(Database db) NotesCalendar
readRange(...)
getEntry(String uid)
createEntry(String ical)
getNewInvitations()
NotesCalendarEntry
read()
update(String ical)
remove()
delegate(...)
...
getNotices()
NotesCalendarNotice
read()
accept()
decline()
delegate(...)
...
17
A Few Calendar Entry Methods (Java)
• Read the iCalendar representation for a range of events
 (NotesCalendar class) String readRange(DateTime start,
DateTime end);
• Read the iCalendar for a single event
 (NotesEntryCalendar class) String read();
• Create a new event from iCalendar
 (NotesCalendar class) NotesCalendarEntry createEntry(String
icalentry);
Compare
these
methods
with the
equivalent C
functions.
18
A Few Calendar Notice Methods (Java)
• Get a list of new invitations
 (NotesCalendar class) Vector getNewInvitations(DateTime start,
DateTime since);
• Get a list of notices for a single event
 (NotesCalendarEntry class) Vector getNotices();
• Process a single notice (accept, decline, etc.)
 (NotesCalendarNotice class) void accept(String comments);
 (NotesCalendarNotice class) void decline(String comments);
19
C&S Java API Demo
20
Tips for Using the C&S Backend Classes
• Remember the Notes.ini setting
 CSDebugAPI=1
• Don't forget to recycle (Java and SSJS)
 For example NotesCalendarEntry.recycle() frees any native
memory associated with the entry
 Particularly important when the parent database and session
remain open
• See the NotesError class for useful error codes (Java and SSJS)
 NOTES_ERR_ERRSENDINGNOTICES
 NOTES_ERR_NOTACCEPTED
 NOTES_ERR_NEWERVERSIONEXISTS, etc.
21
C&S Backend Classes Documentation
• See Domino Designer for help on each language binding
• LotusScript help
 IBM Domino Designer Basic User Guide and Reference >
LotusScript/COM/OLE Classes > LotusScript Classes A-Z > NotesCalendar
(LotusScript)
• Java help
 IBM Domino Designer Basic User Guide and Reference > Java/CORBA
Classes > Java Classes A-Z > NotesCalendar (Java)
• Server-side JavaScript help
 IBM Domino Designer XPages Reference > Domino > NotesCalendar
(JavaScript)
22
What We’ll Cover …
• Overview of C&S APIs
• C&S in the C API toolkit
• C&S in LotusScript, Java and SSJS
• REST calendar service
• Wrap-up
23
Review of C&S APIs Available in 9.0 Social Edition
C API Toolkit (calapi.h)
Java Wrappers
LotusScript
Wrappers
Core C&S Logic
NotesCalendar Back-end Classes
Customer
solutions
using
LotusScript
Customer solutions using
Notes Java API
Customer
solutions
using C / C++
Customer
solutions
using
SSJS
JS Wrappers
• Each interface works on either Notes or Domino
• But your application must be co-located with Notes or Domino
24
C&S APIs Planned for 9.x
C API Toolkit (calapi.h)
Java Wrappers
LotusScript
Wrappers
Core C&S Logic
NotesCalendar Back-end Classes
Customer
solutions
using
LotusScript
Customer
solutions
using
Notes Java
API
Customer
solutions
using C / C++
Customer
solutions
using
SSJS
JS Wrappers
Customer
solutions
using
REST
REST Service
HTTP
• Calendar service will provide remote access to the
same C&S implementation
25
Calendar Service Design
• Accessible from any HTTP client
 Web applications (Dojo, jQuery, etc.)
 Native mobile applications
 Open Social gadgets
 Server-to-server applications
• Keep it simple
 Uses the C&S back-end classes
 Uses any authentication scheme supported by Domino (basic,
session, SAML, etc.)
 Same syntax as other IBM services
26
Calendar Service Design (continued)
• Functional design
 Create, read, update and delete calendar entries
 Get a list of new invitations or unapplied notices
 Simple actions to process entries and notices
 Control implicit scheduling
• Resource-oriented
 Calendars, events and notices are resources – each with a
unique URL
 Use simple verbs to act on resources (GET, PUT, POST &
DELETE)
 Navigate between resources
27
iCalendar vs. JSON
• Most calendar service requests support either iCalendar or JSON
• JSON may be easier to use with JavaScript
• iCalendar may be easier to use with an open source parser / generator (ical4j,
libical, etc.)
JSON event:
{
"events": [
{
"id": "8A3941390301436885257AD700661DAE",
"summary": "Super Bowl XLVII",
"location": "New Orleans",
"start": {
"date": "2013-02-03",
"time": "23:30:00",
"utc": true
},
"end": {
"date": "2013-02-04",
"time": "03:00:00",
"utc": true
}
}
]
}
iCalendar event:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Lotus ... //NONSGML ...
BEGIN:VEVENT
DTSTART:20130203T233000Z
DTEND:20130204T030000Z
LAST-MODIFIED:20121217T183957Z
DTSTAMP:20121217T184244Z
SUMMARY:Super Bowl XLVII
LOCATION:New Orleans
UID:8A3941390301436885257AD700661DAE
END:VEVENT
END:VCALENDAR
28
A Few Calendar Entry Requests (REST)
• Read a range of events (JSON or iCalendar)
 GET /{database}/api/calendar/events
 GET /{database}/api/calendar/events?format=icalendar
• Read a single event (JSON or iCalendar)
 GET /{database}/api/calendar/events/{uid}
 GET /{database}/api/calendar/events/{uid}?format=icalendar
• Create a new event
 POST /{database}/api/calendar/events
Compare
these REST
requests
with the
other C&S
APIs.
29
A Few Calendar Notice Requests (REST)
• Get a list of new invitations
 GET /{database}/api/calendar/invitations
• Get a list of notices for a single event
 GET /{database}/api/calendar/events/{uid}/notices
• Process a single notice (accept, decline, etc.)
 PUT /{database}/api/calendar/events/{uid}/action?type={action}
30
Sample JSON Response
• Read a range of events
 GET /{database}/api/calendar/events
JSON response:
{
"events": [
{
"id": "8A3941390301436885257AD700661DAE",
"summary": "Super Bowl XLVII",
"location": "New Orleans",
"start": {
"date": "2013-02-03",
"time": "23:30:00",
"utc": true
},
"end": {
"date": "2013-02-04",
"time": "03:00:00",
"utc": true
}
},
{
"id": "09C4206D7BD743D685257AB0007BA513",
"summary": "Repeating Appointment",
"location": "test",
"start": {...},
"end": {...}
}, ...
]
}
31
Sample iCalendar Response
• Read a range of events
 GET /{database}/api/calendar/events?format=icalendar
iCalendar response:
BEGIN:VCALENDAR
X-LOTUS-CHARSET:UTF-8
VERSION:2.0
BEGIN:VEVENT
DTSTART:20130203T233000Z
DTEND:20130204T030000Z
SUMMARY:Super Bowl XLVII
LOCATION:New Orleans
UID:8A3941390301436885257AD700661DAE
X-LOTUS-SUMMARYDATAONLY:TRUE
END:VEVENT
BEGIN:VEVENT
DTSTART:20130205T140000Z
DTEND:20130205T150000Z
SUMMARY:Repeating Appointment
LOCATION:test
UID:09C4206D7BD743D685257AB0007BA513
X-LOTUS-SUMMARYDATAONLY:TRUE
END:VEVENT
...
END:VCALENDAR
32
Calendar Service Demo
33
Calendar Service Release Plan
• Like other REST services, it will be released on OpenNTF first
 Part of the XPages Extension Library
 Available to early adopters, source included
 Limited support by the OpenNTF community
• Product release vehicle is TBD
• More on the extension library development model:
Continuous development released as open source
8.5.3 UP1
N/D 8.5.3 N/D 9.0 Social Edition
9.0 UP1 (not in plan)
34
What We’ll Cover …
• Overview of C&S APIs
• C&S in the C API toolkit
• C&S in LotusScript, Java and SSJS
• REST calendar service
• Wrap-up
35
Additional Resources
• www-01.ibm.com/software/lotus/category/messaging
 IBM Notes and Domino 9.0 Social Edition
• www-10.lotus.com/ldd/ddwiki.nsf
 IBM Notes and Domino Application Development Wiki
• extlib.openntf.org
 Extension library on OpenNTF
• tools.ietf.org/pdf/rfc5545.pdf
 iCalendar standard specification
• ical4j.sourceforge.net/index.html
 Java library for parsing and generating iCalendar
36
7 Key Points to Take Home
• One C&S implementation; multiple interfaces
• iCalendar model encapsulates internal complexity
• Take advantage of implicit scheduling
• Choose an open source iCalendar library
• Use CSDebugAPI=1 for development
• Watch OpenNTF for the REST calendar service
• REST services are strategically important for remote access to
Domino
37
Your Turn!
How to contact me:
Dave Delay
ddelay@us.ibm.com

More Related Content

PPTX
Electron - cross platform desktop applications made easy
PPTX
dominocamp2022.t1s1.dde.pptx
PPTX
Docker - Der Wal in der Kiste
PDF
BP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPages
PDF
Entwicker camp2007 calling-the-c-api-from-lotusscript
PPTX
What is new in Notes & Domino Deleopment V10.x
PPT
Custom Metadata Records Deployment From Apex Code
PPTX
Migrating from MFC to Qt
Electron - cross platform desktop applications made easy
dominocamp2022.t1s1.dde.pptx
Docker - Der Wal in der Kiste
BP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPages
Entwicker camp2007 calling-the-c-api-from-lotusscript
What is new in Notes & Domino Deleopment V10.x
Custom Metadata Records Deployment From Apex Code
Migrating from MFC to Qt

What's hot (20)

PPT
Csharp dot net
PDF
Android App development and test environment, Understaing android app structure
PPT
Introduction to Programming Lesson 01
PPT
SFDX - Spring 2019 Update
PPTX
Post-mortem Debugging of Windows Applications
PDF
Advanced iOS Debbuging (Reloaded)
PPT
01 Introduction to programming
PPT
Salesforce Developer eXperience (SFDX)
PDF
Db2 version 9 for linux, unix, and windows
PDF
Hierarchy Viewer Internals
PDF
invokedynamic for Mere Mortals [Code One 2019]
PDF
Ad108 - XPages in the IBM Lotus Notes Client - A Deep Dive!
PDF
Introduction to cdi given at java one 2014
PDF
GBDC 勉強会 #6 Java イベントレポート 2016
PPT
VB.Net GUI Unit_01
PDF
Java Bytecode Crash Course [Code One 2019]
KEY
Titanium appcelerator my first app
PDF
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
PDF
Using the Android Native Development Kit (NDK)
PPTX
MAX 2008 - Building your 1st AIR application
Csharp dot net
Android App development and test environment, Understaing android app structure
Introduction to Programming Lesson 01
SFDX - Spring 2019 Update
Post-mortem Debugging of Windows Applications
Advanced iOS Debbuging (Reloaded)
01 Introduction to programming
Salesforce Developer eXperience (SFDX)
Db2 version 9 for linux, unix, and windows
Hierarchy Viewer Internals
invokedynamic for Mere Mortals [Code One 2019]
Ad108 - XPages in the IBM Lotus Notes Client - A Deep Dive!
Introduction to cdi given at java one 2014
GBDC 勉強会 #6 Java イベントレポート 2016
VB.Net GUI Unit_01
Java Bytecode Crash Course [Code One 2019]
Titanium appcelerator my first app
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
Using the Android Native Development Kit (NDK)
MAX 2008 - Building your 1st AIR application
Ad

Similar to C&S APIs in IBM Notes and Domino (20)

ODP
IBM Connect 2014 - AD204: What's new in the IBM Domino Objects: By Example
PDF
Why and How to Run Your Own Gitlab Runners as Your Company Grows
PDF
Why use Gitlab
PDF
Serverless Computing
PDF
Suite Script 2.0 API Basics
PDF
Virtual training intro to InfluxDB - June 2021
PPTX
Tackle Containerization Advisor (TCA) for Legacy Applications
PDF
DB2 Accounting Reporting
PPTX
AMIS Oracle OpenWorld 2015 Review – part 3- PaaS Database, Integration, Ident...
PDF
Tips and Tricks for Swift & Dot Swift 2016
PDF
Dev buchan leveraging the notes c api
PDF
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
PPTX
How bol.com makes sense of its logs, using the Elastic technology stack.
PDF
.NET 8Developer Roadmap By Scholarhat PDF
PDF
2017 Microservices Practitioner Virtual Summit: Microservices at Squarespace ...
PPTX
SQL for Data Science - for everyone.pptx
DOC
Balamurugan msbi cv
PDF
Dot NET Solution Architect Roadmap By Scholarhat PDF
PDF
Kandroid for nhn_deview_20131013_v5_final
PDF
MineDB Mineral Resource Evaluation White Paper
IBM Connect 2014 - AD204: What's new in the IBM Domino Objects: By Example
Why and How to Run Your Own Gitlab Runners as Your Company Grows
Why use Gitlab
Serverless Computing
Suite Script 2.0 API Basics
Virtual training intro to InfluxDB - June 2021
Tackle Containerization Advisor (TCA) for Legacy Applications
DB2 Accounting Reporting
AMIS Oracle OpenWorld 2015 Review – part 3- PaaS Database, Integration, Ident...
Tips and Tricks for Swift & Dot Swift 2016
Dev buchan leveraging the notes c api
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
How bol.com makes sense of its logs, using the Elastic technology stack.
.NET 8Developer Roadmap By Scholarhat PDF
2017 Microservices Practitioner Virtual Summit: Microservices at Squarespace ...
SQL for Data Science - for everyone.pptx
Balamurugan msbi cv
Dot NET Solution Architect Roadmap By Scholarhat PDF
Kandroid for nhn_deview_20131013_v5_final
MineDB Mineral Resource Evaluation White Paper
Ad

Recently uploaded (20)

PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
medical staffing services at VALiNTRY
PPTX
L1 - Introduction to python Backend.pptx
PPT
Introduction Database Management System for Course Database
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administration Chapter 2
Which alternative to Crystal Reports is best for small or large businesses.pdf
medical staffing services at VALiNTRY
L1 - Introduction to python Backend.pptx
Introduction Database Management System for Course Database
How to Choose the Right IT Partner for Your Business in Malaysia
CHAPTER 2 - PM Management and IT Context
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Digital Systems & Binary Numbers (comprehensive )
wealthsignaloriginal-com-DS-text-... (1).pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Navsoft: AI-Powered Business Solutions & Custom Software Development
PTS Company Brochure 2025 (1).pdf.......
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Design an Analysis of Algorithms I-SECS-1021-03
top salesforce developer skills in 2025.pdf
System and Network Administration Chapter 2

C&S APIs in IBM Notes and Domino

  • 1. © 2013 Wellesley Information Services. All rights reserved. C&S APIs in IBM Notes and Domino Dave Delay IBM
  • 2. 2 Please Note ... IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion. Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision. The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract. The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.
  • 3. 3 What We’ll Cover … • Overview of C&S APIs • C&S in the C API toolkit • C&S in LotusScript, Java and SSJS • REST calendar service • Wrap-up
  • 4. 4 9.0 Social Edition C&S API Design Goals • Allow an application to manage data on a user's calendar  Includes robust and reliable scheduling  Does not include ToDos, busy-time, and rooms & resources • Keep it simple  Encapsulate the Notes/Domino data and recurrence model  Leverage the iCalendar standard • Available to developers working in C/C++, LotusScript, Java and server-side JavaScript • Easily expandable in future releases
  • 5. 5 C&S APIs Available in 9.0 Social Edition C API Toolkit (calapi.h) Java Wrappers LotusScript Wrappers Core C&S Logic NotesCalendar Back-end Classes Customer solutions using LotusScript Customer solutions using Notes Java API Customer solutions using C / C++ Customer solutions using SSJS JS Wrappers • One C&S implementation; multiple interfaces • All four interfaces are new in 9.0
  • 6. 6 What is iCalendar? • Text-based, standard representation of calendar data (see RFC5545) • Open source iCalendar libraries available (e.g. ical4j & libical) iCalendar Example: BEGIN:VCALENDAR PRODID:-//Renovations Inc//MyApp 1.0//EN BEGIN:VEVENT DTSTART:20130204T140000Z DTEND:20130204T143000Z SUMMARY:Team meeting ORGANIZER;CN="Samantha Daryn":mailto:sdaryn@renovations.com ATTENDEE;CN="Ted Amado":mailto:tamado@renovations.com DESCRIPTION:Discuss status LOCATION:My office END:VEVENT END:VCALENDAR
  • 7. 7 C&S API Features • Working with calendar entries  Read a range of entries  Create, read, update or delete an individual calendar entry  Implicit scheduling for meetings  Simple actions on meetings (decline, delegate, cancel, etc.)  Complete support for repeating entries  Support for all entry types (meetings, appointments, all day events, anniversaries, reminders) • Working with calendar notices  Read the list of new invitations  Read a list of unapplied notices (for an entry)  Process a notice (accept, decline, delegate, counter, etc.)
  • 8. 8 What We’ll Cover … • Overview of C&S APIs • C&S in the C API toolkit • C&S in LotusScript, Java and SSJS • REST calendar service • Wrap-up
  • 9. 9 C&S in the C API Toolkit • All functions defined in calapi.h • The C API is the foundation for all other language bindings • Implemented using core C&S and iCalendar logic • Can be used with open source libical C API Toolkit (calapi.h) Core C&S Logic Customer solutions using C / C++
  • 10. 10 A Few Calendar Entry Functions (C API) • Read the iCalendar representation for a range of events  STATUS CalReadRange(DBHANDLE hDB, TIMEDATE tdStart, TIMEDATE tdEnd, ...); • Read the iCalendar for a single event  STATUS CalReadEntry(DBHANDLE hDB, const char* pszUID, const char* pszRecurID, ...); • Create a new event from iCalendar  STATUS CalCreateEntry(DBHANDLE hDB, const char* pszCalEntry, DWORD dwFlags, ...);
  • 11. 11 A Few Calendar Notice Functions (C API) • Get a list of new invitations  STATUS CalGetNewInvitations(DBHANDLE hDB, TIMEDATE* ptdStart, ...); • Get a list of notices for a single event  STATUS CalGetUnappliedNotices(DBHANDLE hDB, const char* pszUID, ...); • Process a single notice (accept, decline, etc.)  STATUS CalNoticeAction(DBHANDLE hDB, NOTEID noteID, DWORD dwAction, ...);
  • 12. 12 Debugging the C API functions • Notes.ini setting for tracing the C&S API  CSDebugAPI=1 • This works for the LotusScript, Java and SSJS classes too Sample console log: [268C:000A-188C] 04/05/2013 09:03:30.65 AM [CS API]> Enter CalReadEntry, UID:A6F3B8508B90461A85257B4100601786-Lotus_Notes_Generated, RID:NULL, Flags:0x0. [268C:000A-188C] 04/05/2013 09:03:30.69 AM [CS API]> Exit CalReadEntry, return:0x0000, No error. [268C:000A-188C] 04/05/2013 09:07:49.97 AM [CS API]> Enter CalCreateEntry, Flags:0x0. [268C:000A-188C] 04/05/2013 09:07:50.45 AM [CS API]> PRODID required in C&S API input but was not found [268C:000A-188C] 04/05/2013 09:07:50.45 AM [CS API]> Error | ConvertIcal2NoteRequest.cpp(189) : Missing VEvent components (0x892) [268C:000A-188C] 04/05/2013 09:07:50.49 AM [CS API]> Error | VersitInterface.cpp(1769) : Missing VEvent components (0x892) [268C:000A-188C] 04/05/2013 09:07:50.49 AM [CS API]> Error | VersitInterface.cpp(1966) : Missing VEvent components (0x892) [268C:000A-188C] 04/05/2013 09:07:50.49 AM [CS API]> Error | calendarapiworker.cpp(405) : Missing VEvent components (0x892) [268C:000A-188C] 04/05/2013 09:07:50.49 AM [CS API]> Exit CalCreateEntry, return:0x0892, Missing VEvent components. [268C:000A-188C] 04/05/2013 09:07:50.49 AM [CS API]> Error | calendarapi.c(370) : Missing VEvent components (0x892)
  • 13. 13 C API Documentation • A complete function reference is included in the C API toolkit • The calapi.h file also has lots of useful comments Sample comment: /********************************************************************************* * CalReadRange * This will return data for all entries that begin within a specified date range, * with paging capabilities (similar to NIFReadEntries) in cases where there is * more data than can be returned in a single call. * Specifically, this can return one or both of: * 1) iCalendar generated from view level data about the calendar entries in the * date range * 2) A list of UIDs for each calendar entry in the date range * * ... * * Inputs: ... * * Outputs: ... * * Returns: ... */
  • 14. 14 What We’ll Cover … • Overview of C&S APIs • C&S in the C API toolkit • C&S in LotusScript, Java and SSJS • REST calendar service • Wrap-up
  • 15. 15 C&S in LotusScript, Java & SSJS • One object model  NotesCalendar  NotesCalendarEntry  NotesCalendarNotice • Three language bindings • Java developers can use open source ical4j C API Toolkit (calapi.h) Java Wrappers LotusScript Wrappers Core C&S Logic NotesCalendar Back-end Classes Customer solutions using LotusScript Customer solutions using Notes Java API Customer solutions using SSJS JS Wrappers
  • 16. 16 C&S Backend Classes Session getCalendar(Database db) NotesCalendar readRange(...) getEntry(String uid) createEntry(String ical) getNewInvitations() NotesCalendarEntry read() update(String ical) remove() delegate(...) ... getNotices() NotesCalendarNotice read() accept() decline() delegate(...) ...
  • 17. 17 A Few Calendar Entry Methods (Java) • Read the iCalendar representation for a range of events  (NotesCalendar class) String readRange(DateTime start, DateTime end); • Read the iCalendar for a single event  (NotesEntryCalendar class) String read(); • Create a new event from iCalendar  (NotesCalendar class) NotesCalendarEntry createEntry(String icalentry); Compare these methods with the equivalent C functions.
  • 18. 18 A Few Calendar Notice Methods (Java) • Get a list of new invitations  (NotesCalendar class) Vector getNewInvitations(DateTime start, DateTime since); • Get a list of notices for a single event  (NotesCalendarEntry class) Vector getNotices(); • Process a single notice (accept, decline, etc.)  (NotesCalendarNotice class) void accept(String comments);  (NotesCalendarNotice class) void decline(String comments);
  • 20. 20 Tips for Using the C&S Backend Classes • Remember the Notes.ini setting  CSDebugAPI=1 • Don't forget to recycle (Java and SSJS)  For example NotesCalendarEntry.recycle() frees any native memory associated with the entry  Particularly important when the parent database and session remain open • See the NotesError class for useful error codes (Java and SSJS)  NOTES_ERR_ERRSENDINGNOTICES  NOTES_ERR_NOTACCEPTED  NOTES_ERR_NEWERVERSIONEXISTS, etc.
  • 21. 21 C&S Backend Classes Documentation • See Domino Designer for help on each language binding • LotusScript help  IBM Domino Designer Basic User Guide and Reference > LotusScript/COM/OLE Classes > LotusScript Classes A-Z > NotesCalendar (LotusScript) • Java help  IBM Domino Designer Basic User Guide and Reference > Java/CORBA Classes > Java Classes A-Z > NotesCalendar (Java) • Server-side JavaScript help  IBM Domino Designer XPages Reference > Domino > NotesCalendar (JavaScript)
  • 22. 22 What We’ll Cover … • Overview of C&S APIs • C&S in the C API toolkit • C&S in LotusScript, Java and SSJS • REST calendar service • Wrap-up
  • 23. 23 Review of C&S APIs Available in 9.0 Social Edition C API Toolkit (calapi.h) Java Wrappers LotusScript Wrappers Core C&S Logic NotesCalendar Back-end Classes Customer solutions using LotusScript Customer solutions using Notes Java API Customer solutions using C / C++ Customer solutions using SSJS JS Wrappers • Each interface works on either Notes or Domino • But your application must be co-located with Notes or Domino
  • 24. 24 C&S APIs Planned for 9.x C API Toolkit (calapi.h) Java Wrappers LotusScript Wrappers Core C&S Logic NotesCalendar Back-end Classes Customer solutions using LotusScript Customer solutions using Notes Java API Customer solutions using C / C++ Customer solutions using SSJS JS Wrappers Customer solutions using REST REST Service HTTP • Calendar service will provide remote access to the same C&S implementation
  • 25. 25 Calendar Service Design • Accessible from any HTTP client  Web applications (Dojo, jQuery, etc.)  Native mobile applications  Open Social gadgets  Server-to-server applications • Keep it simple  Uses the C&S back-end classes  Uses any authentication scheme supported by Domino (basic, session, SAML, etc.)  Same syntax as other IBM services
  • 26. 26 Calendar Service Design (continued) • Functional design  Create, read, update and delete calendar entries  Get a list of new invitations or unapplied notices  Simple actions to process entries and notices  Control implicit scheduling • Resource-oriented  Calendars, events and notices are resources – each with a unique URL  Use simple verbs to act on resources (GET, PUT, POST & DELETE)  Navigate between resources
  • 27. 27 iCalendar vs. JSON • Most calendar service requests support either iCalendar or JSON • JSON may be easier to use with JavaScript • iCalendar may be easier to use with an open source parser / generator (ical4j, libical, etc.) JSON event: { "events": [ { "id": "8A3941390301436885257AD700661DAE", "summary": "Super Bowl XLVII", "location": "New Orleans", "start": { "date": "2013-02-03", "time": "23:30:00", "utc": true }, "end": { "date": "2013-02-04", "time": "03:00:00", "utc": true } } ] } iCalendar event: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Lotus ... //NONSGML ... BEGIN:VEVENT DTSTART:20130203T233000Z DTEND:20130204T030000Z LAST-MODIFIED:20121217T183957Z DTSTAMP:20121217T184244Z SUMMARY:Super Bowl XLVII LOCATION:New Orleans UID:8A3941390301436885257AD700661DAE END:VEVENT END:VCALENDAR
  • 28. 28 A Few Calendar Entry Requests (REST) • Read a range of events (JSON or iCalendar)  GET /{database}/api/calendar/events  GET /{database}/api/calendar/events?format=icalendar • Read a single event (JSON or iCalendar)  GET /{database}/api/calendar/events/{uid}  GET /{database}/api/calendar/events/{uid}?format=icalendar • Create a new event  POST /{database}/api/calendar/events Compare these REST requests with the other C&S APIs.
  • 29. 29 A Few Calendar Notice Requests (REST) • Get a list of new invitations  GET /{database}/api/calendar/invitations • Get a list of notices for a single event  GET /{database}/api/calendar/events/{uid}/notices • Process a single notice (accept, decline, etc.)  PUT /{database}/api/calendar/events/{uid}/action?type={action}
  • 30. 30 Sample JSON Response • Read a range of events  GET /{database}/api/calendar/events JSON response: { "events": [ { "id": "8A3941390301436885257AD700661DAE", "summary": "Super Bowl XLVII", "location": "New Orleans", "start": { "date": "2013-02-03", "time": "23:30:00", "utc": true }, "end": { "date": "2013-02-04", "time": "03:00:00", "utc": true } }, { "id": "09C4206D7BD743D685257AB0007BA513", "summary": "Repeating Appointment", "location": "test", "start": {...}, "end": {...} }, ... ] }
  • 31. 31 Sample iCalendar Response • Read a range of events  GET /{database}/api/calendar/events?format=icalendar iCalendar response: BEGIN:VCALENDAR X-LOTUS-CHARSET:UTF-8 VERSION:2.0 BEGIN:VEVENT DTSTART:20130203T233000Z DTEND:20130204T030000Z SUMMARY:Super Bowl XLVII LOCATION:New Orleans UID:8A3941390301436885257AD700661DAE X-LOTUS-SUMMARYDATAONLY:TRUE END:VEVENT BEGIN:VEVENT DTSTART:20130205T140000Z DTEND:20130205T150000Z SUMMARY:Repeating Appointment LOCATION:test UID:09C4206D7BD743D685257AB0007BA513 X-LOTUS-SUMMARYDATAONLY:TRUE END:VEVENT ... END:VCALENDAR
  • 33. 33 Calendar Service Release Plan • Like other REST services, it will be released on OpenNTF first  Part of the XPages Extension Library  Available to early adopters, source included  Limited support by the OpenNTF community • Product release vehicle is TBD • More on the extension library development model: Continuous development released as open source 8.5.3 UP1 N/D 8.5.3 N/D 9.0 Social Edition 9.0 UP1 (not in plan)
  • 34. 34 What We’ll Cover … • Overview of C&S APIs • C&S in the C API toolkit • C&S in LotusScript, Java and SSJS • REST calendar service • Wrap-up
  • 35. 35 Additional Resources • www-01.ibm.com/software/lotus/category/messaging  IBM Notes and Domino 9.0 Social Edition • www-10.lotus.com/ldd/ddwiki.nsf  IBM Notes and Domino Application Development Wiki • extlib.openntf.org  Extension library on OpenNTF • tools.ietf.org/pdf/rfc5545.pdf  iCalendar standard specification • ical4j.sourceforge.net/index.html  Java library for parsing and generating iCalendar
  • 36. 36 7 Key Points to Take Home • One C&S implementation; multiple interfaces • iCalendar model encapsulates internal complexity • Take advantage of implicit scheduling • Choose an open source iCalendar library • Use CSDebugAPI=1 for development • Watch OpenNTF for the REST calendar service • REST services are strategically important for remote access to Domino
  • 37. 37 Your Turn! How to contact me: Dave Delay ddelay@us.ibm.com