SlideShare a Scribd company logo
Boost your JAVA Code with the
OpenNTF Domino API
Oliver Busse
We4IT GmbH, Germany
April 11, 2016
Oliver Busse
• „Bleeding Yellow“ since R4.5
• Software Architect at We4IT
• Member of the development team of
Aveedo® Application Framework
• IBM Champion for ICS in 2015 + 2016
• OpenNTF Member Director
• XPages Advocate
• IBM Bluemix curious
@zeromancer1972
www.oliverbusse.com
Agenda
• What is the OpenNTF Domino API?
• Setup and Implementation
• Other Considerations
• Tons of examples
What is the OpenNTF Domino API?
What is the OpenNTF Domino API?
• It‘s an open source project on OpenNTF
• It‘s was started in April 2013
• It‘s maintained by generous developers you may know
• It fills the gaps and gives the power you always wanted in Java for
Domino
• It‘s often refered to as „ODA“
What is the OpenNTF Domino API? (cont‘d)
• The ODA consists of several packages
• core
• formula
• rest
• xsp
• …
• It‘s an OSGi plugin
• It‘s designed for running on the Domino server (9.0.x+)
• It‘s designed for XPages (Java, SSJS) and Plugins
• It can‘t be used in Java Agents 
Key developers of the ODA
• Nathan T. Freeman (US/MX)
• Paul S. Withers (UK)
• Jesse Gallagher (US)
• Roland Praml (DE)
• Martin Jinoch (CZ)
• René Winkelmeyer (DE)
• Tim Tripcony † (#CodeForTim) (US)
Setup & Implementation
Resources
• Grab it from OpenNTF (recommended)
• http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20
API
• Grab it from the Git-Repo
• https://github.com/OpenNTF/org.openntf.domino
• Grab it from the OpenNTF Stash (latest)
• https://stash.openntf.org/projects/ODA
On your system
• Since the ODA is an OSGi plugin you can install it via the update site
mechanism
• It runs as an extension to the XSP runtime on the HTTP server JVM
• It comes with it‘s own logger
Setup: prepare the server
• Set the signer of the NSF as „Sign or run…“ in server
document‘s security section
Setup: prepare the updatesite
• Create an updatesite NSF
• Name it whatever you
want
• Make sure you set ACL to
let the server READ
documents
Setup: import ODA into update site
• Find the site.xml file to import it as a local update site
into your NSF
• After import goto „Actions, Sign all Content“
Setup: add the ODA to server startup
• Add a new line to your server‘s notes.ini file
• edit file manually or
• use a configuration setting (prefered)
• OSGI_HTTP_DYNAMIC_BUNDLES=updatesite.nsf
Setup: add the ODA to server startup
• This is what you should see when the server starts:
HTTP JVM: CLFAD0330I: NSF Based plugins are being installed
in the OSGi runtime. For more information please consult the
log
• Check the plugins with
– tell http osgi ss openntf
Setup: prepare Domino Designer
• Open DDE‘s preferences
• Goto „Domino Designer“ section
• Activate „Enable Eclipse plug-in install“
• Open the update site NSF you just created
• Goto „Actions, Show URLs“
• Copy one of the two URLs to clipboard
• Goto „File, Application, Install“
• Choose „Search for new features to install“
• On the next screen „Add (a) Remote Location“
• Enter a name for it and paste the URL in the clipboard
• On the next screen check the ODA entry and click next/yes if you are asked to
Other Considerations
Other Considerations
• ODA utilizes the OpenLog project
• XspOpenLogUtil.logEvent(…)
• XspOpenLogUtil.logError(…)
• Get familiar with the OpenLog project from OpenNTF
• Create a new OpenLog.nsf file in your server‘s root (if you haven‘t
already)
Examples
Examples
• Session handling
• View handling (loops)
• Document & Field handling
• DateTime enhancements
• Transactions
• Xots
• Graphs
Session handling
Session handling: different approaches
• Extension Library
• ExtlibUtil.getCurrentSession();
• ExtlibUtil.getCurrentSessionAsSigner();
• ExtlibUtil.getCurrentSessionAsSignerWithFullAccess();
• needs exception handling
• XSPUtil
• like ExtlibUtil
• needs exception handling
• Factory
• Factory.getSession();
• uses enums for different session types
• no exception handling needed!
View handling
View handling: what you are used to (1)
View handling: what you are used to (2)
What you now are able to do
Document handling
Safe lines of code by using new methods
• New creation methods
• Database.createDocument(String, Object, …)
• Database.createDocument(HashMap fields)
• Alternatives to replaceItemValue
• Document.put(String field, Object o)
• Document.putAll(HashMap fields)
• Alternatives to getItemValueXXX
• Document.get(Object o) // document acts like a Map<?>
• Document.getItemValue(String field, Class type)
getItemValue: what you are used to
• getItemValue returns a Vector
• Vectors are not type save
• editor / compiler complains non-type-safety
• they can contain „anything“
• you have to check what is inside
• if the item does not exist you are running into trouble…
getItemValue: what you can do now
• cast to a type of your choice
• ArrayList<?> values = doc.getItemValue(„foo", ArrayList.class);
• forget type safety
• define your own!
• a non existing item is returned as null, not as empty Vector
• can be handled
DateTime enhancements
DateTime enhancements
• Session.createDateTime(y,m,d,hh,mm,ss)
• uses int values
• conversion toJavaDate() not necessary
• DateTime.isBefore();
• DateTime.isAfter();
• useful comparisons
• DateTime.equalsIgnoreDate();
• DateTime.equalsIgnoreTime();
Transactions
Transactions
• ODA adds transactional capabilities to your Notes data
• You can modify documents without saving them
individually (e.g. in a loop)
• You can also rollback every modification if you need to
(e.g. when you run into an error)
Transactions (cont‘d)
• Create a new DatabaseTransaction object from the database
• DatabaseTransaction txn = db.startTransaction();
• Perform your modifications
• Decide whether to commit or rollback
• txn.commit();
• txn.rollback();
Xots
Xots
• Xots = XPages OSGi Tasklet Service
• It‘s the extended version of DOTS (Domino Tasklet Service)
• Executes up to 10x faster than Java Agent code
• Use cases
• Can be coded inside the NSF, no plugin project needed
• Multi-threaded tasks like Runnable, but you can return values
• Bulk execution of time consuming code
• very new feature (alpha)
Xots (cont‘d)
• Advantages
• More granular time and event triggering than in Agents
• Can run with server-side permissions
• Runs in a shared container (JVM) unlikely of an Agent which runs in a dedicated
JVM
• you can exchange data between tasklets
• It‘s coded in a plain Java class and not in an Agent design element
• You can use SCM systems
Xots (cont‘d)
• Core elements of tasklet
• Interface Callable<?>
• Interface Future<?>
• get() method to get the return value(s)
• only if you are interested in a return value
• Class Xots from the ODA
• submit() method to create a tasklet
• schedule() methods to create a periodic tasklet
• use the PeriodicScheduler!
Contribute!
Contribute to the ODA
• Get the sources
• the version on OpenNTF Stash should be the latest
• https://stash.openntf.org/projects/ODA
• Setup Eclipse (Luna+)
• Set „Access Restrictions“ to „Warning“
• Setup Maven (install e2m plugin)
• Setup Domino Build Management
Resources
• The XPages demo applications
• https://bitbucket.org/zeromancer1972/sutol-2015-oda-graph-demo
• A nice glossary
• http://www.intec.co.uk/from-xpages-to-web-app-glossary/
• OpenNTF Domino API
• http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API
• http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API%20Demo%20Database
• Xots
• http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-one/
• http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-two/
• http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-three/
• Domino Build Management
• https://www.openntf.org/main.nsf/project.xsp?r=project/IBM%20Domino%20Update%20Site%20for%20Build%20Management
Q & A
Utilizing the OpenNTF Domino API
www.we4it.com

More Related Content

PPTX
Utilizing the open ntf domino api
PPTX
Benchmarking Redis by itself and versus other NoSQL databases
KEY
Mongo db admin_20110316
PDF
Scala at Treasure Data
PPTX
MongoDB
PDF
Webinar: What's new in Neo4j 2.0
PDF
Why we love ArangoDB. The hunt for the right NosQL Database
PPTX
Presentation: mongo db & elasticsearch & membase
Utilizing the open ntf domino api
Benchmarking Redis by itself and versus other NoSQL databases
Mongo db admin_20110316
Scala at Treasure Data
MongoDB
Webinar: What's new in Neo4j 2.0
Why we love ArangoDB. The hunt for the right NosQL Database
Presentation: mongo db & elasticsearch & membase

What's hot (20)

PPTX
Building a friendly .NET SDK to connect to Space
PPTX
OData support in Cast Iron 7.5.1
PDF
Distributed Logging Architecture in Container Era
PDF
Presto at Facebook - Presto Meetup @ Boston (10/6/2015)
PPT
JavaOne_2010
PDF
SearchHub - How to Spend Your Summer Keeping it Real: Presented by Grant Inge...
PPTX
ELK - Stack - Munich .net UG
PPTX
Redis & MongoDB: Stop Big Data Indigestion Before It Starts
PPTX
Presto Meetup 2016 Small Start
PPTX
Alex Thissen "Server-less compute with .NET based Azure Functions"
PPT
Asp #2
PPTX
mongodb-aggregation-may-2012
PDF
Ruby and Distributed Storage Systems
PDF
Open Source Software, Distributed Systems, Database as a Cloud Service
PPTX
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
PDF
Tale of ISUCON and Its Bench Tools
PPTX
Slick – the modern way to access your Data
PDF
Presto changes
PDF
Empowering developers to deploy their own data stores
PPTX
Log analysis using Logstash,ElasticSearch and Kibana
Building a friendly .NET SDK to connect to Space
OData support in Cast Iron 7.5.1
Distributed Logging Architecture in Container Era
Presto at Facebook - Presto Meetup @ Boston (10/6/2015)
JavaOne_2010
SearchHub - How to Spend Your Summer Keeping it Real: Presented by Grant Inge...
ELK - Stack - Munich .net UG
Redis & MongoDB: Stop Big Data Indigestion Before It Starts
Presto Meetup 2016 Small Start
Alex Thissen "Server-less compute with .NET based Azure Functions"
Asp #2
mongodb-aggregation-may-2012
Ruby and Distributed Storage Systems
Open Source Software, Distributed Systems, Database as a Cloud Service
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Tale of ISUCON and Its Bench Tools
Slick – the modern way to access your Data
Presto changes
Empowering developers to deploy their own data stores
Log analysis using Logstash,ElasticSearch and Kibana
Ad

Viewers also liked (20)

PPTX
Fix & fertig: Best Practises für "XPages-Migranten"
PDF
bccon-2014 key01 ibm_collaboration_solutions_connect_2014
PDF
bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-libraries
PDF
DNUG 38: "Einen Rahmen schaffen: Vorteile durch Frameworks in der Domino-Webe...
PPTX
Dnug 112014 modernization_openn_ntf_ersatzsession
PDF
Find your data
PDF
OSA Anwendertreffen 2014 - "Clients ausgedünnt: Notes-/Domino-Anwendungen web...
PPTX
ISBG 2016 - XPages on IBM Bluemix
PDF
DNUG 2014 Herbstkonferenz: Moderne Architektur - Hochskalierbare Anwendungsar...
PPTX
SUTOL 2015 - Utilizing the OpenNTF Domino API
PDF
ULC - Connect 2014 Nachlese
PPTX
Transformations - a TLCC & Teamstudio Webinar
PPTX
Transformations
PPTX
GraphDb in XPages
PDF
Xpages - oder was man mit einer alten Notes-DB so alles anstellen kann
PDF
Out of the Blue - the Workflow in Bluemix Development
PPTX
Out of the Blue: Getting started with IBM Bluemix development
PDF
Java & Notes - Mit Eclipse neue Features für Notes entwickeln | C.Habermueller
PPTX
MWLUG 2016 : AD117 : Xpages & jQuery DataTables
PPTX
XPages on Bluemix - the Do's and Dont's
Fix & fertig: Best Practises für "XPages-Migranten"
bccon-2014 key01 ibm_collaboration_solutions_connect_2014
bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-libraries
DNUG 38: "Einen Rahmen schaffen: Vorteile durch Frameworks in der Domino-Webe...
Dnug 112014 modernization_openn_ntf_ersatzsession
Find your data
OSA Anwendertreffen 2014 - "Clients ausgedünnt: Notes-/Domino-Anwendungen web...
ISBG 2016 - XPages on IBM Bluemix
DNUG 2014 Herbstkonferenz: Moderne Architektur - Hochskalierbare Anwendungsar...
SUTOL 2015 - Utilizing the OpenNTF Domino API
ULC - Connect 2014 Nachlese
Transformations - a TLCC & Teamstudio Webinar
Transformations
GraphDb in XPages
Xpages - oder was man mit einer alten Notes-DB so alles anstellen kann
Out of the Blue - the Workflow in Bluemix Development
Out of the Blue: Getting started with IBM Bluemix development
Java & Notes - Mit Eclipse neue Features für Notes entwickeln | C.Habermueller
MWLUG 2016 : AD117 : Xpages & jQuery DataTables
XPages on Bluemix - the Do's and Dont's
Ad

Similar to Utilizing the OpenNTF Domino API (20)

PPTX
Utilizing the OpenNTF Domino API
PPTX
OpenNTF Domino API - Overview Introduction
PDF
Getting Started with the OpenNTF Domino API
PDF
DanNotes 2013: OpenNTF Domino API
PDF
OpenNTF Domino API (ODA): Super-Charging Domino Development
PDF
Engage 2014 OpenNTF Domino API Slides
PPTX
BP207 - Meet the Java Application Server You Already Own – IBM Domino
PDF
OpenNTF Webinar - October 2021: Return of the DOTS
PPTX
The power of dots
PDF
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
PPTX
Let me introduce you: DOTS
PPTX
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
PDF
OpenNTF Webinar 05/07/13: OpenNTF - The IBM Collaboration Solutions App Dev C...
PDF
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
ODP
Intro to XPages for Administrators (DanNotes, November 28, 2012)
PPTX
An XPager's Guide to Process Server-Side Jobs on Domino
PDF
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
ODP
The xsp starter kit
PDF
AD1545 - Extending the XPages Extension Library
PPTX
OpenNTF Webinar May 2021 - Jesse
Utilizing the OpenNTF Domino API
OpenNTF Domino API - Overview Introduction
Getting Started with the OpenNTF Domino API
DanNotes 2013: OpenNTF Domino API
OpenNTF Domino API (ODA): Super-Charging Domino Development
Engage 2014 OpenNTF Domino API Slides
BP207 - Meet the Java Application Server You Already Own – IBM Domino
OpenNTF Webinar - October 2021: Return of the DOTS
The power of dots
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
Let me introduce you: DOTS
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
OpenNTF Webinar 05/07/13: OpenNTF - The IBM Collaboration Solutions App Dev C...
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
Intro to XPages for Administrators (DanNotes, November 28, 2012)
An XPager's Guide to Process Server-Side Jobs on Domino
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
The xsp starter kit
AD1545 - Extending the XPages Extension Library
OpenNTF Webinar May 2021 - Jesse

More from Oliver Busse (6)

PDF
HCL Domino Volt - der NSF Killer?
PPTX
Outlook becomes a Team Player - with a clever add-in
PDF
The NERD stuff - opening for Domino to the modern web developer
PDF
DNUG Development Day 2019
PDF
DNUG44 Watson Workspace
PPTX
Paradiesisch - OpenNTF
HCL Domino Volt - der NSF Killer?
Outlook becomes a Team Player - with a clever add-in
The NERD stuff - opening for Domino to the modern web developer
DNUG Development Day 2019
DNUG44 Watson Workspace
Paradiesisch - OpenNTF

Recently uploaded (20)

PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
history of c programming in notes for students .pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
top salesforce developer skills in 2025.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
AI in Product Development-omnex systems
PPTX
L1 - Introduction to python Backend.pptx
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
ai tools demonstartion for schools and inter college
Design an Analysis of Algorithms I-SECS-1021-03
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
history of c programming in notes for students .pptx
Wondershare Filmora 15 Crack With Activation Key [2025
VVF-Customer-Presentation2025-Ver1.9.pptx
How Creative Agencies Leverage Project Management Software.pdf
Nekopoi APK 2025 free lastest update
How to Choose the Right IT Partner for Your Business in Malaysia
Design an Analysis of Algorithms II-SECS-1021-03
Upgrade and Innovation Strategies for SAP ERP Customers
top salesforce developer skills in 2025.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
AI in Product Development-omnex systems
L1 - Introduction to python Backend.pptx
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
ISO 45001 Occupational Health and Safety Management System
Operating system designcfffgfgggggggvggggggggg
ai tools demonstartion for schools and inter college

Utilizing the OpenNTF Domino API

  • 1. Boost your JAVA Code with the OpenNTF Domino API Oliver Busse We4IT GmbH, Germany April 11, 2016
  • 2. Oliver Busse • „Bleeding Yellow“ since R4.5 • Software Architect at We4IT • Member of the development team of Aveedo® Application Framework • IBM Champion for ICS in 2015 + 2016 • OpenNTF Member Director • XPages Advocate • IBM Bluemix curious @zeromancer1972 www.oliverbusse.com
  • 3. Agenda • What is the OpenNTF Domino API? • Setup and Implementation • Other Considerations • Tons of examples
  • 4. What is the OpenNTF Domino API?
  • 5. What is the OpenNTF Domino API? • It‘s an open source project on OpenNTF • It‘s was started in April 2013 • It‘s maintained by generous developers you may know • It fills the gaps and gives the power you always wanted in Java for Domino • It‘s often refered to as „ODA“
  • 6. What is the OpenNTF Domino API? (cont‘d) • The ODA consists of several packages • core • formula • rest • xsp • … • It‘s an OSGi plugin • It‘s designed for running on the Domino server (9.0.x+) • It‘s designed for XPages (Java, SSJS) and Plugins • It can‘t be used in Java Agents 
  • 7. Key developers of the ODA • Nathan T. Freeman (US/MX) • Paul S. Withers (UK) • Jesse Gallagher (US) • Roland Praml (DE) • Martin Jinoch (CZ) • René Winkelmeyer (DE) • Tim Tripcony † (#CodeForTim) (US)
  • 9. Resources • Grab it from OpenNTF (recommended) • http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20 API • Grab it from the Git-Repo • https://github.com/OpenNTF/org.openntf.domino • Grab it from the OpenNTF Stash (latest) • https://stash.openntf.org/projects/ODA
  • 10. On your system • Since the ODA is an OSGi plugin you can install it via the update site mechanism • It runs as an extension to the XSP runtime on the HTTP server JVM • It comes with it‘s own logger
  • 11. Setup: prepare the server • Set the signer of the NSF as „Sign or run…“ in server document‘s security section
  • 12. Setup: prepare the updatesite • Create an updatesite NSF • Name it whatever you want • Make sure you set ACL to let the server READ documents
  • 13. Setup: import ODA into update site • Find the site.xml file to import it as a local update site into your NSF • After import goto „Actions, Sign all Content“
  • 14. Setup: add the ODA to server startup • Add a new line to your server‘s notes.ini file • edit file manually or • use a configuration setting (prefered) • OSGI_HTTP_DYNAMIC_BUNDLES=updatesite.nsf
  • 15. Setup: add the ODA to server startup • This is what you should see when the server starts: HTTP JVM: CLFAD0330I: NSF Based plugins are being installed in the OSGi runtime. For more information please consult the log • Check the plugins with – tell http osgi ss openntf
  • 16. Setup: prepare Domino Designer • Open DDE‘s preferences • Goto „Domino Designer“ section • Activate „Enable Eclipse plug-in install“ • Open the update site NSF you just created • Goto „Actions, Show URLs“ • Copy one of the two URLs to clipboard • Goto „File, Application, Install“ • Choose „Search for new features to install“ • On the next screen „Add (a) Remote Location“ • Enter a name for it and paste the URL in the clipboard • On the next screen check the ODA entry and click next/yes if you are asked to
  • 18. Other Considerations • ODA utilizes the OpenLog project • XspOpenLogUtil.logEvent(…) • XspOpenLogUtil.logError(…) • Get familiar with the OpenLog project from OpenNTF • Create a new OpenLog.nsf file in your server‘s root (if you haven‘t already)
  • 20. Examples • Session handling • View handling (loops) • Document & Field handling • DateTime enhancements • Transactions • Xots • Graphs
  • 22. Session handling: different approaches • Extension Library • ExtlibUtil.getCurrentSession(); • ExtlibUtil.getCurrentSessionAsSigner(); • ExtlibUtil.getCurrentSessionAsSignerWithFullAccess(); • needs exception handling • XSPUtil • like ExtlibUtil • needs exception handling • Factory • Factory.getSession(); • uses enums for different session types • no exception handling needed!
  • 24. View handling: what you are used to (1)
  • 25. View handling: what you are used to (2)
  • 26. What you now are able to do
  • 28. Safe lines of code by using new methods • New creation methods • Database.createDocument(String, Object, …) • Database.createDocument(HashMap fields) • Alternatives to replaceItemValue • Document.put(String field, Object o) • Document.putAll(HashMap fields) • Alternatives to getItemValueXXX • Document.get(Object o) // document acts like a Map<?> • Document.getItemValue(String field, Class type)
  • 29. getItemValue: what you are used to • getItemValue returns a Vector • Vectors are not type save • editor / compiler complains non-type-safety • they can contain „anything“ • you have to check what is inside • if the item does not exist you are running into trouble…
  • 30. getItemValue: what you can do now • cast to a type of your choice • ArrayList<?> values = doc.getItemValue(„foo", ArrayList.class); • forget type safety • define your own! • a non existing item is returned as null, not as empty Vector • can be handled
  • 32. DateTime enhancements • Session.createDateTime(y,m,d,hh,mm,ss) • uses int values • conversion toJavaDate() not necessary • DateTime.isBefore(); • DateTime.isAfter(); • useful comparisons • DateTime.equalsIgnoreDate(); • DateTime.equalsIgnoreTime();
  • 34. Transactions • ODA adds transactional capabilities to your Notes data • You can modify documents without saving them individually (e.g. in a loop) • You can also rollback every modification if you need to (e.g. when you run into an error)
  • 35. Transactions (cont‘d) • Create a new DatabaseTransaction object from the database • DatabaseTransaction txn = db.startTransaction(); • Perform your modifications • Decide whether to commit or rollback • txn.commit(); • txn.rollback();
  • 36. Xots
  • 37. Xots • Xots = XPages OSGi Tasklet Service • It‘s the extended version of DOTS (Domino Tasklet Service) • Executes up to 10x faster than Java Agent code • Use cases • Can be coded inside the NSF, no plugin project needed • Multi-threaded tasks like Runnable, but you can return values • Bulk execution of time consuming code • very new feature (alpha)
  • 38. Xots (cont‘d) • Advantages • More granular time and event triggering than in Agents • Can run with server-side permissions • Runs in a shared container (JVM) unlikely of an Agent which runs in a dedicated JVM • you can exchange data between tasklets • It‘s coded in a plain Java class and not in an Agent design element • You can use SCM systems
  • 39. Xots (cont‘d) • Core elements of tasklet • Interface Callable<?> • Interface Future<?> • get() method to get the return value(s) • only if you are interested in a return value • Class Xots from the ODA • submit() method to create a tasklet • schedule() methods to create a periodic tasklet • use the PeriodicScheduler!
  • 41. Contribute to the ODA • Get the sources • the version on OpenNTF Stash should be the latest • https://stash.openntf.org/projects/ODA • Setup Eclipse (Luna+) • Set „Access Restrictions“ to „Warning“ • Setup Maven (install e2m plugin) • Setup Domino Build Management
  • 42. Resources • The XPages demo applications • https://bitbucket.org/zeromancer1972/sutol-2015-oda-graph-demo • A nice glossary • http://www.intec.co.uk/from-xpages-to-web-app-glossary/ • OpenNTF Domino API • http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API • http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API%20Demo%20Database • Xots • http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-one/ • http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-two/ • http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-three/ • Domino Build Management • https://www.openntf.org/main.nsf/project.xsp?r=project/IBM%20Domino%20Update%20Site%20for%20Build%20Management
  • 43. Q & A