从数据库中读取“模板版本是”

Dmy*_*kyi 1 lotus-notes lotusscript lotus-domino xpages

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

我试过了:

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

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

在此处输入图片说明

Per*_*ten 5

这是使用 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");
}
Run Code Online (Sandbox Code Playgroud)

同样,您可以获得模板构建日期:

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();
}
Run Code Online (Sandbox Code Playgroud)