Malin
Malin

Reputation: 697

Implementing OpenNTF DOmino API in my XPages, what should I change in code?

Regulations breakthrough! Due to major issues with recycling in XPages I got green light to install and use OpenNTF's Domino API now to leave a lot of recycling of Notes objects to ODA.

But what should I consider to change in code?

Besides creation of database object:

Database db = Utils.getSession().getDatabase("", "file.nsf");

Session sess = Factory.getSession(SessionType.CURRENT);
Database db = sess.getDatabase("", "file.nsf", true);

I noticed I saw code examples that stated SessionType.NATIVE. What is the difference?

I notice an additional parameter in sess.getDatabase("", "file.nsf", true). What is that for?

I also wonder what to do with all the exception handling that I have in my current code. Can I keep this or should I remove this?

What about logging for exceptions, do they appear automagically in openlog or not? Or how should I setup use of openlog?

Nowadays I use a different OpenNTF addon for use of OpenLog https://www.openntf.org/main.nsf/project.xsp?r=project/XPages%20OpenLog%20Logger . Can I remove this then?

I am looking for an example application for code but I have not found any yet. Perhaps you know a good source?

Thank you in advance for your guidance!

Upvotes: 0

Views: 224

Answers (2)

Paul Stephen Withers
Paul Stephen Withers

Reputation: 15729

SessionType.NATIVE is used to run as the server. For the last few years I never used SessionAsSigner, only SessionType.NATIVE.

XPages OpenLog logger was incorporated into ODA. There may be different package names to import, but there are no differences in functionality. As I made changes to XPages OpenLog Logger, the same changes were made in ODA.

The demo app is available at http://paulswithers.me.uk/odaDemoApp and includes some documentation, including getting a database. You basically just need a single parameter and, if the database doesn’t exist, you get null returned, as would be normal for a Java method - no need to check if it’s

Upvotes: 1

Fredrik Norling
Fredrik Norling

Reputation: 3484

In the zipfile of the OpenNTF Domino API there is an apidoc folder this contains javadoc for the api.

Upvotes: 0

Related Questions