实现 OpenNTF Domino API 在我的 XPages 中,代码需要做哪些更改?

huangapple go评论89阅读模式
英文:

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

问题

规定突破!由于 XPages 中回收利用存在重大问题,我获得了安装和使用 OpenNTF 的 Domino API 的绿灯,现在可以将许多 Notes 对象的回收工作交给 ODA(OpenNTF Domino API)。

但是在代码中我应该考虑做哪些更改?

除了创建数据库对象之外:

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

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

我注意到我看到了一些代码示例中提到了 SessionType.NATIVE。这有什么区别?

我注意到 sess.getDatabase("", "file.nsf", true) 中有一个额外的参数。那是做什么用的?

我还想知道我现在代码中的所有异常处理该怎么办。我可以保留还是应该删除?

关于异常的日志记录,它们会自动出现在 openlog 中吗,还是需要进行设置?或者我应该如何设置使用 openlog?

现在我使用一个不同的 OpenNTF 插件来使用 OpenLog,链接:https://www.openntf.org/main.nsf/project.xsp?r=project/XPages%20OpenLog%20Logger。那我现在可以将它删除吗?

我正在寻找一个代码示例应用,但我还没有找到合适的。也许你知道一个好的来源?

非常感谢您的指导!

英文:

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!

答案1

得分: 1

SessionType.NATIVE 用于作为服务器运行。在过去的几年里,我从未使用 SessionAsSigner,只用 SessionType.NATIVE。

XPages OpenLog 记录器已并入 ODA。可能有不同的包名称需要导入,但功能上没有区别。当我对 XPages OpenLog 记录器进行更改时,相同的更改也会应用于 ODA。

演示应用程序可在 http://paulswithers.me.uk/odaDemoApp 找到,其中包括一些文档,包括获取数据库的方法。你只需要一个参数,如果数据库不存在,将返回 null,这与 Java 方法的正常行为相符 - 无需检查它是否存在。

英文:

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

答案2

得分: 0

在 OpenNTF Domino API 的压缩文件中,有一个 apidoc 文件夹,其中包含了 API 的 Javadoc。

英文:

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

huangapple
  • 本文由 发表于 2020年10月1日 19:46:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/64154749.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定