gpt4 book ai didi

xpages - 从数据库读取 "Template version is"

转载 作者:行者123 更新时间:2023-12-02 16:25:53 25 4
gpt4 key购买 nike

我需要从数据库中读取一个属性:模板版本是

我试过:

  1. 检查了 NotesDatabase 类(LS 和 Java),但没有很快找到任何东西。
  2. 检查了 catalog.nsf,仍然看不到那个值。

有人知道怎么做吗?谢谢。

enter image description here

最佳答案

这是使用 Java 获取模板版本的便捷代码片段:

private static String getVersionNumber(Database db) {
NoteCollection noteCollection;
noteCollection = db.createNoteCollection(true);
noteCollection.setSelectSharedFields(true);
noteCollection.setSelectionFormula("$TITLE=\"$TemplateBuild\"");
noteCollection.buildCollection();
final String noteID = noteCollection.getFirstNoteID();
final Document designDoc = db.getDocumentByID(noteID);

return designDoc.getItemValueString("$TemplateBuild");
}

同样可以得到模板构建日期:

private static Date getBuildDate(Database db) {
NoteCollection noteCollection;
noteCollection = db.createNoteCollection(true);
noteCollection.setSelectSharedFields(true);
noteCollection.setSelectionFormula("$TITLE=\"$TemplateBuild\"");
noteCollection.buildCollection();
final String noteID = noteCollection.getFirstNoteID();
final Document designDoc = db.getDocumentByID(noteID);

return ((DateTime) designDoc.getItemValueDateTimeArray("$TemplateBuildDate").get(0)).toJavaDate();
}

关于xpages - 从数据库读取 "Template version is",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64554377/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com