1

我想从 Notes 数据库中获取所有冲突文档。到目前为止,我有这个:

Domino.NotesSession notesSession;
Domino.NotesDatabase notesDatabase = this.OpenDatabase(out notesSession);

Domino.NotesDateTime dateTime = notesSession.CreateDateTime(String.Empty);

Domino.NotesDocumentCollection results =
    notesDatabase.Search(this.SearchString, dateTime, 0);

例如,它适用于:

searchString = "@Contains(ShortName;\"Bob\")";

我怎样才能对冲突文件进行等效处理?

4

2 回答 2

5

试试这个:

searchString = "@IsAvailable($Conflict)";
于 2010-03-24T14:50:12.097 回答
2

文档中有一个字段将任何 Notes 文档标记为冲突,称为“$Conflict”。如果它出现在文档上,那么您就知道这是一个冲突,(就像 Carlos 逃避的那样)。

您可以在具有公式的数据库中创建一个视图。

选择@isAvailable("$Conflict")

然后循环浏览视图中的所有文档。看起来你是用 Java 做的,所以我认为它看起来像这样

import lotus.domino.*;
import java.util.*;
//.....
//.....
        Session s = NotesFactory.createSession();
        Database db = s.getDatabase("server", "filename");
        View vw = db.getView("viewname");
        Document doc = null;
        doc = vw.getFirstDocument();

        while (doc != null) {
            // do what you want in here.
            doc = vw.getNextDocument(doc);
            }

You'll need to make sure you have added the Domino jars to your project. This is a good reference for setting up the eclipse IDE for Domino java development.

PS. You can also modify the design of the database to minimise replication conflicts. But I won't bore you here with the details. Post a comment if you would like to know and ill provide instructions on this thread.

于 2010-03-26T05:27:27.527 回答