Top Banner
OpenNTF Domino API: The Community API Paul Withers – Intec Systems Ltd Martin Jinoch 20-3-2014 @EngageUG #engageug 1
27

Engage 2014 OpenNTF Domino API Slides

May 09, 2015

Download

Technology

Paul Withers

Presentation by Paul Withers and Martin Jinoch at Engage 2014 about OpenNTF Domino API
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Engage 2014 OpenNTF Domino API Slides

OpenNTF Domino API: The Community API

Paul Withers – Intec Systems Ltd

Martin Jinoch

20-3-2014 @EngageUG #engageug 1

Page 2: Engage 2014 OpenNTF Domino API Slides

Paul Withers

• IBM Champion

• Author of XPages Extension Library

• OpenNTF Director

• Co-Developer of OpenNTF Domino API

20-3-2014 @EngageUG #engageug 2

Page 3: Engage 2014 OpenNTF Domino API Slides

Martin Jinoch

• Notes developer since version 3.0

• Java/XPages

• Source control

• Test driven development

20-3-2014 @EngageUG #engageug 3

Page 4: Engage 2014 OpenNTF Domino API Slides

Agenda

• Why Did We Bother?

• Deployment and Configuration

• What’s Available?

• How Do I Convert My Code?

20-3-2014 @EngageUG #engageug 4

Page 6: Engage 2014 OpenNTF Domino API Slides

Why Java?

• One install per server

• Run contexts • XPages

• Java / JAR Design Elements

• Agents (slightly different deployment model)

• Applets / Servlets

• Plugins (Client/Designer/OSGi)

• DOTS Tasks

• SSJS just runs Java methods • So most classes and methods are available in SSJS as well!

20-3-2014 @EngageUG #engageug 6

Page 7: Engage 2014 OpenNTF Domino API Slides

Why Develop It?

• Bridge gap between LotusScript and Java developers

• Remove risk of infinite loops in DocumentCollections

• No need to recycle

• Take advantage of List and Sets (Collections)

• More intuitively named parameters

• No need to catch NotesExceptions

• Pass more Java objects to methods

• Lots of helper methods

• In context Javadocs

20-3-2014 @EngageUG #engageug 7

Page 8: Engage 2014 OpenNTF Domino API Slides

After?

Paul Withers: I have a checkIsUnique() method that you pass a View, a Key, and the current Document. Would that be a useful addition to DominoUtils?

Nathan T. Freeman: sure that looks useful

Nathan T. Freeman: BUT...

Nathan T. Freeman: you're forgetting something

Nathan T. Freeman: you own the API :)

Nathan T. Freeman: View.checkUnique(Object key, Document doc)

20-3-2014 @EngageUG #engageug 8

Page 9: Engage 2014 OpenNTF Domino API Slides

Why Use It?

• Upgrading to 9.0.1 (can be forked for 9.0)

• Open source can be used

• Don’t want to work out where you need to recycle now

• Didn’t realise DateTimes and Vectors were so toxic

• You prefer beer and chocolate and User Groups!

20-3-2014 @EngageUG #engageug 9

Page 10: Engage 2014 OpenNTF Domino API Slides

Agenda

• Why Did We Bother?

• Deployment and Configuration

• What’s Available?

• How Do I Convert My Code?

20-3-2014 @EngageUG #engageug 10

Page 11: Engage 2014 OpenNTF Domino API Slides

Deployment

• Download from OpenNTF or download as part of OpenNTF Essentials from http://essentials.openntf.org

• Upload Update Site to server

• Issue console command “restart task http”

• Sufficient for OSGi-dependent contexts since M4

20-3-2014 @EngageUG #engageug 11

Page 12: Engage 2014 OpenNTF Domino API Slides

Deployment to Client / Designer

• Install Update Site or OpenNTF Essentials via Widget Catalog or via File > Application > Install

• Designed for Server and Client 9.0.1

20-3-2014 @EngageUG #engageug 12

Page 13: Engage 2014 OpenNTF Domino API Slides

Enable Library for Each NSF

• No draggable components, so we can’t enable it for you

• Enable on Page Generation tab of Xsp Properties

20-3-2014 @EngageUG #engageug 13

Page 14: Engage 2014 OpenNTF Domino API Slides

Configure Xsp Properties

• org.openntf.domino.xsp= • godmode: session & database auto-converted to

org.openntf.domino

• marcel: always convert MIME

• raid: run in debug mode

• khan: turn on all fixes, e.g. appendItemValue()

“I am…better.”

“At what?”

“Everything.”

• e.g. org.openntf.domino.xsp=godmode,mime,khan 20-3-2014 @EngageUG #engageug 14

Page 15: Engage 2014 OpenNTF Domino API Slides

Configure Xsp Properties for OpenLog

• Same as in XPages OpenLog Logger • xsp.openlog.filepath • xsp.openlog.displayError • xsp.openlog.genericErrorMessage • xsp.openlog.email • xsp.openlog.debugLevel • xsp.openlog.suppressEventTrace

20-3-2014 @EngageUG #engageug 15

Page 16: Engage 2014 OpenNTF Domino API Slides

Agenda

• Why Did We Bother?

• Deployment and Configuration

• What’s Available?

• How Do I Convert My Code?

20-3-2014 @EngageUG #engageug 16

Page 17: Engage 2014 OpenNTF Domino API Slides

Packages

• org.openntf.domino: core code

• org.openntf.domino.designer: future DDE-specific code

• org.openntf.domino.plugin: core packaged in a plugin • If you want to modify and test, build this

• org.openntf.domino.xsp: OSGi-specific code

• org.openntf.domino.xsp.feature: feature project

• org.openntf.domino.xsp.update: update site project • Delete features & plugins folders, open site.xml, click Build All

and export as General > File System

20-3-2014 @EngageUG #engageug 17

Page 18: Engage 2014 OpenNTF Domino API Slides

Core API Packages

• org.openntf.domino • Core Domino API interfaces

• Import classes from this package

• org.openntf.domino.ext • Extension interfaces

• Look here for methods we’ve added

• org.openntf.domino.impl • Implementations of interfaces

• Look here for the actual code

20-3-2014 @EngageUG #engageug 18

Page 19: Engage 2014 OpenNTF Domino API Slides

Key Additions

• XPages OpenLog Logger

• Transactional Processing

• Database Event Listeners

• Graph Database

• Jobs and Tasks

• Email Helper

• Sync Helper

• Document Scanner

• Index Database

20-3-2014 @EngageUG #engageug 19

Page 20: Engage 2014 OpenNTF Domino API Slides

Work in Progress

• Classes for ALL Design Elements

• Data Schemas

• Name / Value Picker DataProviders

• Read / write XPages, Custom Controls, JARs

• Recycle performance optimisation

• Index Database optimisation

• Collection sorting and progress serialisation

• AtFormulaParser – quicker 20-3-2014 @EngageUG #engageug 20

Page 21: Engage 2014 OpenNTF Domino API Slides

Demo

20-3-2014 @EngageUG #engageug 21

Page 22: Engage 2014 OpenNTF Domino API Slides

Agenda

• Why Did We Bother?

• Deployment and Configuration

• What’s Available?

• How Do I Convert My Code?

20-3-2014 @EngageUG #engageug 22

Page 23: Engage 2014 OpenNTF Domino API Slides

How do I convert my code?

1. Do nothing and use old code with a new one together (not recommended!)

2. Replace all implicit objects via godmode

3. Search and replace imports (lotus.domino -> org.openntf.domino)

4. Remove unnecessary code (try catch blocks, “throws NotesException”, recycle() calls, …)

5. Enjoy the power of helper methods

20-3-2014 @EngageUG #engageug 23

Page 24: Engage 2014 OpenNTF Domino API Slides

How do I convert my code

• Use old code with new one together

Converting from new API objects to original and back via Factory.fromLotus() and Factory.toLotus() methods

• org.openntf.domino.xsp=godmode

iddqd anyone?

• Change import lotus.domino -> org.openntf.domino

Search and replace in DDE can do this for you for a whole project

20-3-2014 @EngageUG #engageug 24

Page 25: Engage 2014 OpenNTF Domino API Slides

Demo

20-3-2014 @EngageUG #engageug 25

Page 27: Engage 2014 OpenNTF Domino API Slides

Questions!

• Paul Withers • Intec Systems Ltd

[email protected]

• http://www.intec.co.uk/blog

• twitter.com/paulswithers

• Martin Jinoch • http://jinoch.cz

• twitter.com/mjinoch

20-3-2014 @EngageUG #engageug 27