Automating Google Workspace (GWS) & more with Apps Script
Engage 2014 OpenNTF Domino API Slides
1. OpenNTF Domino API:
The Community API
Paul Withers – Intec Systems Ltd
Martin Jinoch
20-3-2014 @EngageUG #engageug 1
2. Paul Withers
• IBM Champion
• Author of XPages Extension Library
• OpenNTF Director
• Co-Developer of OpenNTF Domino
API
20-3-2014 @EngageUG #engageug 2
3. Martin Jinoch
• Notes developer since version 3.0
• Java/XPages
• Source control
• Test driven development
20-3-2014 @EngageUG #engageug 3
4. Agenda
•Why Did We Bother?
•Deployment and Configuration
•What’s Available?
•How Do I Convert My Code?
20-3-2014 @EngageUG #engageug 4
6. 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
7. 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
8. 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
9. 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
10. Agenda
•Why Did We Bother?
•Deployment and Configuration
•What’s Available?
•How Do I Convert My Code?
20-3-2014 @EngageUG #engageug 10
11. 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
12. 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
13. 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
14. 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
15. 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
16. Agenda
•Why Did We Bother?
•Deployment and Configuration
•What’s Available?
•How Do I Convert My Code?
20-3-2014 @EngageUG #engageug 16
17. 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
18. 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
20. 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
22. Agenda
•Why Did We Bother?
•Deployment and Configuration
•What’s Available?
•How Do I Convert My Code?
20-3-2014 @EngageUG #engageug 22
23. 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
24. 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