OpenNTF Domino API: Making
Domino Work The Way You Want
Paul Withers
Intec Systems Ltd

September
Paul Withers
• XPages Developer since 2009
• IBM Champion
• Author of XPages Extension
Library
• Co-Developer of OpenNTF
D...
Agenda
• Background
• Why Bother?
• Installation and Architecture
• Using the API
• Investigating the API
Why Java?
• Current Run Contexts

• Accessible Objects*

•

Agents

•

Databases

•

XPages

•

Directories

•

Java / JAR...
Java in Domino
Not Just for Java
• SSJS
• #{javascript:…} means parse this string
using SSJS rules
• Pass commands to VariableResolver
• ...
Why Bother?

* See http://www.shoeboxblog.com/wp-content/uploads/2010/02/life-before-google-500x496.jpg
Why Develop It?
• Out-dated objects (Vectors)
• Out-dated iteration rules
• Unhelpful content assist
• Argument names arg0...
Why Use It?

Inline
Documentation

Garbage
Collection

Auto-logging

Auto-boxing

Iterables

Helpers
How Do You Use It?

GitHub source

Install Update
Site in DDE

OpenNTF
download

Drop JAR in
Domino JVM
(outside OSGi)

Up...
Installation on Server
• Upload org.openntf.domino.xsp into
Update Site Db
• “Restart task http” on console
• Sufficient f...
Installation on Server
• For non-OSGi contexts, e.g. Agents:
• Save org.openntf.domino JAR to
<domino>jvmlibext
Installation on Client / Designer
• Install Update Site
via Widget Catalog
or via File >
Application > Install
• For agent...
OpenNTF Essentials
• Also part of OpenNTF Essentials
• Only XPages / OSGi part
• Does not include jar file
• Download from...
Enable Library for NSF
• Remember to add it to Xsp Properties
Configure Xsp Properties
• org.openntf.domino.xsp=….
•
•
•
•

godmode: override session and database objects
marcel: alway...
Configure Xsp Properties
• OpenLog
•
•
•
•
•

xsp.openlog.filepath
xsp.openlog.displayError
xsp.openlog.genericErrorMessag...
See Demo App
• All available in the demo application

https://github.com/paulswithers/org.op
enntf.domino-Demo-Database
Using Demo Database
• Download and sign
• Go to Administration page
• Create Sample DataSet
• Familiar? Sort of…
• Based o...
Sample Pages
Java Comparator
Creating Pages
Java Methods
• New#{compositeData.title}Bean &
Old#{compositeData.title}Bean
• Register in faces-config.xml
• Add public v...
Reviewing the Source
• Install / open Eclipse
• Using Git
• Clone repository from GitHub
• Import projects
Packages
• org.openntf.domino: core code
• org.openntf.domino.designer: future Designer-specific
functionality
• org.openn...
Core API Packages
• src: main code
• test: test scripts
• tinkerpop: graph db code
• data: sample error log
• doc: JavaDoc...
src Package
• org.openntf.domino
• Core interfaces
• Import these classes
• org.openntf.domino.ext
• Extension interfaces
...
Enabling SSJS
• Core cannot have XPages dependencies
• Must be in org.openntf.domino.xsp
• org.openntf.domino.xsp.script
•...
How It’s Normally Done
How We Do It?
• WRAPPED_CLASSES adds each class
required for SSJS
• Iterated to create one OpenFunction object
for each cl...
Benefits?
• If we add a new public non-static method,
it’s automatically added
• If we add a new class, we just need to ad...
Recent Additions (M3, M4)
• Database Event
Listeners
• Graph Database
• Jobs and Tasks
• Email Helper
• XPages OpenLog
Log...
Work in Progress
• Classes for ALL Design
Elements
• Read / write XPages,
Custom Controls, JARs
• Data Schemas
• Big Data ...
Thank You
• Paul Withers
• pwithers@intec.co.uk
• http://www.intec.co.uk/blog
• @paulswithers
• https://github.com/OpenNTF...
Upcoming SlideShare
Loading in...5
×

DanNotes 2013: OpenNTF Domino API

1,867

Published on

OpenNTF Domino API presentation at DanNotes November 2013

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,867
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
35
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

DanNotes 2013: OpenNTF Domino API

  1. 1. OpenNTF Domino API: Making Domino Work The Way You Want Paul Withers Intec Systems Ltd September
  2. 2. Paul Withers • XPages Developer since 2009 • IBM Champion • Author of XPages Extension Library • Co-Developer of OpenNTF Domino API • Notes cheat sheets
  3. 3. Agenda • Background • Why Bother? • Installation and Architecture • Using the API • Investigating the API
  4. 4. Why Java? • Current Run Contexts • Accessible Objects* • Agents • Databases • XPages • Directories • Java / JAR Design Element • Documents • Applets • Design Elements • Servlets • ACLs • Java Addins • Admin Requests • Client Plugin • Names • Designer Plugin • HTTP Requests / Responses • OSGi Plugin • Sessions • DOTS Task • File Attachments *Accessible objects can vary by context
  5. 5. Java in Domino
  6. 6. Not Just for Java • SSJS • #{javascript:…} means parse this string using SSJS rules • Pass commands to VariableResolver • Look for corresponding variable name • Map to a Java object/method • Add variable and mapping to registry • In org.openntf.domino.xsp plugin (most)
  7. 7. Why Bother? * See http://www.shoeboxblog.com/wp-content/uploads/2010/02/life-before-google-500x496.jpg
  8. 8. Why Develop It? • Out-dated objects (Vectors) • Out-dated iteration rules • Unhelpful content assist • Argument names arg0, arg1 • No Javadoc • Recycling – here be dragons! • Exceptional exception handling
  9. 9. Why Use It? Inline Documentation Garbage Collection Auto-logging Auto-boxing Iterables Helpers
  10. 10. How Do You Use It? GitHub source Install Update Site in DDE OpenNTF download Drop JAR in Domino JVM (outside OSGi) Upload Update Site to Server Drop JAR in Designer JVM (outside OSGi)
  11. 11. Installation on Server • Upload org.openntf.domino.xsp into Update Site Db • “Restart task http” on console • Sufficient for OSGi-dependent contexts since M4
  12. 12. Installation on Server • For non-OSGi contexts, e.g. Agents: • Save org.openntf.domino JAR to <domino>jvmlibext
  13. 13. Installation on Client / Designer • Install Update Site via Widget Catalog or via File > Application > Install • For agents save org.openntf.domino JAR to <notes>jvm libext
  14. 14. OpenNTF Essentials • Also part of OpenNTF Essentials • Only XPages / OSGi part • Does not include jar file • Download from http://essentials.openntf.org • Copy Update Site database to server • Update notes.ini • Restart server • Install in client (see OpenNTF webinar)
  15. 15. Enable Library for NSF • Remember to add it to Xsp Properties
  16. 16. Configure Xsp Properties • org.openntf.domino.xsp=…. • • • • godmode: override session and database objects marcel: always convert MIME raid: run in debug mode khan: turns on all “fixes”, e.g. appendItemValue "I am... better." "At what?" "Everything." • e.g. org.openntf.domino.xsp=godmode,khan
  17. 17. Configure Xsp Properties • OpenLog • • • • • xsp.openlog.filepath xsp.openlog.displayError xsp.openlog.genericErrorMessage xsp.openlog.email xsp.openlog.debugLevel
  18. 18. See Demo App • All available in the demo application https://github.com/paulswithers/org.op enntf.domino-Demo-Database
  19. 19. Using Demo Database • Download and sign • Go to Administration page • Create Sample DataSet • Familiar? Sort of… • Based on Extension Library code • Uses org.openntf.domino • Use Import Comparator to compare
  20. 20. Sample Pages
  21. 21. Java Comparator
  22. 22. Creating Pages
  23. 23. Java Methods • New#{compositeData.title}Bean & Old#{compositeData.title}Bean • Register in faces-config.xml • Add public void methods • For comparator, set javaMethodName to method name • Create text files • Copy & paste bean code
  24. 24. Reviewing the Source • Install / open Eclipse • Using Git • Clone repository from GitHub • Import projects
  25. 25. Packages • org.openntf.domino: core code • org.openntf.domino.designer: future Designer-specific functionality • org.openntf.domino.plugin: core packaged in plugin • If you want to modify and test, build this • org.openntf.domino.xsp: XPages-specific code • org.openntf.domino.xsp.feature: feature project • org.openntf.domino.xsp.update: update project • Build All and export
  26. 26. Core API Packages • src: main code • test: test scripts • tinkerpop: graph db code • data: sample error log • doc: JavaDoc • resources: various resource files
  27. 27. src Package • org.openntf.domino • Core interfaces • Import these classes • org.openntf.domino.ext • Extension interfaces (new methods) • org.openntf.domino.impl • Implementations of interfaces - actual code
  28. 28. Enabling SSJS • Core cannot have XPages dependencies • Must be in org.openntf.domino.xsp • org.openntf.domino.xsp.script • WrapperOpenDomino.register() • Adds objects for each class • getMethodMap() creates map for each method • OpenFunction.call() calls that method
  29. 29. How It’s Normally Done
  30. 30. How We Do It? • WRAPPED_CLASSES adds each class required for SSJS • Iterated to create one OpenFunction object for each class • Generic Code to add all public non-static methods to Map • generateMethodMap() • Limitations on ellipses / generic parameters • There are ways round this!
  31. 31. Benefits? • If we add a new public non-static method, it’s automatically added • If we add a new class, we just need to add new element in WRAPPED_CLASSES Map
  32. 32. Recent Additions (M3, M4) • Database Event Listeners • Graph Database • Jobs and Tasks • Email Helper • XPages OpenLog Logger • New 9.0.1 methods added
  33. 33. Work in Progress • Classes for ALL Design Elements • Read / write XPages, Custom Controls, JARs • Data Schemas • Big Data Models • MapPicker / ListPicker as dataProviders • NamePicker dataProviders • Support
  34. 34. Thank You • Paul Withers • pwithers@intec.co.uk • http://www.intec.co.uk/blog • @paulswithers • https://github.com/OpenNTF/ org.openntf.domino • https://github.com/paulswithers/org.opennt f.domino-Demo-Database
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×