首页 \ 问答 \ 遍历Lotus Domino中的每个文档(Iterating over every document in Lotus Domino)

遍历Lotus Domino中的每个文档(Iterating over every document in Lotus Domino)

我想迭代(可能是大的)Lotus Domino数据库中的每个文档,并且如果处理中断(网络连接错误,应用程序重新启动等),能够从最后一个文档继续执行。 我没有对数据库的写入权限。

我正在寻找一种方法,我不必从服务器上下载那些已处理的文档。 所以,我必须将一些起始信息传递给服务器,该文档应该是(可能重新启动的)处理中的第一个。

  1. 我已经检查了AllDocuments属性和DocumentColletion.getNthDocument方法,但是这个属性是未排序的,所以我猜这个订单可以在两次调用之间改变。

  2. 另一个想法是使用公式查询,但似乎并没有这些查询可能的顺序。

  3. 第三个想法是具有相应Document.getLastModifiedDatabase.getModifiedDocuments方法。 它看起来不错,但是在我看来,返回的集合的顺序没有记录,并且基于创建时间而不是最后修改时间。

    以下是基于官方示例的示例代码:

    System.out.println("startDate: " + startDate);
    final DocumentCollection documentCollection = 
            database.getModifiedDocuments(startDate, Database.DBMOD_DOC_DATA);
    
    Document doc = documentCollection.getFirstDocument();
    while (doc != null) {
        System.out.println("#lastmod: " + doc.getLastModified() + 
                    " #created: " + doc.getCreated());
        doc = documentCollection.getNextDocument(doc);
    }
    

    它打印以下内容:

    startDate: 2012.07.03 08:51:11 CEDT
    #lastmod: 2012.07.03 08:51:11 CEDT #created: 2012.02.23 10:35:31 CET
    #lastmod: 2012.08.03 12:20:33 CEDT #created: 2012.06.01 16:26:35 CEDT
    #lastmod: 2012.07.03 09:20:53 CEDT #created: 2012.07.03 09:20:03 CEDT
    #lastmod: 2012.07.21 23:17:35 CEDT #created: 2012.07.03 09:24:44 CEDT
    #lastmod: 2012.07.03 10:10:53 CEDT #created: 2012.07.03 10:10:41 CEDT
    #lastmod: 2012.07.23 16:26:22 CEDT #created: 2012.07.23 16:26:22 CEDT
    

    (我在这里没有使用任何AgentContext来访问数据库,数据库对象来自session.getDatabase(null, databaseName)调用。)

有什么方法可以用Lotus Domino Java API可靠地做到这一点?


I'd like iterate over every document in a (probably big) Lotus Domino database and be able to continue it from the last one if the processing breaks (network connection error, application restart etc.). I don't have write access to the database.

I'm looking for a way where I don't have to download those documents from the server which were already processed. So, I have to pass some starting information to the server which document should be the first in the (possibly restarted) processing.

  1. I've checked the AllDocuments property and the DocumentColletion.getNthDocument method but this property is unsorted so I guess the order can change between two calls.

  2. Another idea was using a formula query but it does not seem that ordering is possible with these queries.

  3. The third idea was the Database.getModifiedDocuments method with a corresponding Document.getLastModified one. It seemed good but it looks to me that the ordering of the returned collection is not documented and based on creation time instead of last modification time.

    Here is a sample code based on the official example:

    System.out.println("startDate: " + startDate);
    final DocumentCollection documentCollection = 
            database.getModifiedDocuments(startDate, Database.DBMOD_DOC_DATA);
    
    Document doc = documentCollection.getFirstDocument();
    while (doc != null) {
        System.out.println("#lastmod: " + doc.getLastModified() + 
                    " #created: " + doc.getCreated());
        doc = documentCollection.getNextDocument(doc);
    }
    

    It prints the following:

    startDate: 2012.07.03 08:51:11 CEDT
    #lastmod: 2012.07.03 08:51:11 CEDT #created: 2012.02.23 10:35:31 CET
    #lastmod: 2012.08.03 12:20:33 CEDT #created: 2012.06.01 16:26:35 CEDT
    #lastmod: 2012.07.03 09:20:53 CEDT #created: 2012.07.03 09:20:03 CEDT
    #lastmod: 2012.07.21 23:17:35 CEDT #created: 2012.07.03 09:24:44 CEDT
    #lastmod: 2012.07.03 10:10:53 CEDT #created: 2012.07.03 10:10:41 CEDT
    #lastmod: 2012.07.23 16:26:22 CEDT #created: 2012.07.23 16:26:22 CEDT
    

    (I don't use any AgentContext here to access the database. The database object comes from a session.getDatabase(null, databaseName) call.)

Is there any way to reliably do this with the Lotus Domino Java API?


原文:https://stackoverflow.com/questions/13020620
更新时间:2023-10-09 18:10

最满意答案

这个功能?

x=linspace(0,600,1000);
y=Iapp(x);
plot(x,y)

function y=Iapp(t)
    r=mod(t,120);
    c=floor(t/120);
    VAL1=0;
    VAL2=0.5 + 0.2*c;
    y=VAL1.*(r<=100) + VAL2.*(r>100);
end

在这里输入图像描述


This function?

x=linspace(0,600,1000);
y=Iapp(x);
plot(x,y)

function y=Iapp(t)
    r=mod(t,120);
    c=floor(t/120);
    VAL1=0;
    VAL2=0.5 + 0.2*c;
    y=VAL1.*(r<=100) + VAL2.*(r>100);
end

enter image description here

相关问答

更多
  • 你必须计算到每种颜色的距离,并选择最小的。 有几种方法可以做到这一点。 一个简单的方法是计算距离将是: sqrt((r-r1)^2+(g-g1)^2+(b-b1)^2) 更好的方法可能是加入加权值来计算距离,例如转换RGB-> YUV时使用的值: Y = 0.299 * R + 0.587 * G + 0.114 * B 在这种情况下,你会使用 sqrt(((r - r1) * .299)^2 + ((g - g1) * .587)^2 + ((b - b1) * .114)^2) 当然,由于您不需要 ...
  • 您正在寻找functools.partial : >>> import functools >>> def foo(number): ... print number ... >>> bar = functools.partial(foo, 1) >>> bar() 1 You're looking for functools.partial: >>> import functools >>> def foo(number): ... print number ... >>> bar ...
  • 如果你在呼叫外部定义你的功能,你可以多次使用它。 var bigfunction = function(big) { ... }; $('#element').click(bigfunction); $('#another_element').click(bigfunction); 你也可以用通常的方式声明它: function bigfunction(big) { ... }; If you define your function external to the call you can use ...
  • 我建议一个enum public enum ErrorType { error, warning, info } public void ShowMe(ErrorType errorType) { switch (errorType) { case ErrorType.error: //do stuff break; case ErrorType.warning: //do stuff ...
  • 这个功能? x=linspace(0,600,1000); y=Iapp(x); plot(x,y) function y=Iapp(t) r=mod(t,120); c=floor(t/120); VAL1=0; VAL2=0.5 + 0.2*c; y=VAL1.*(r<=100) + VAL2.*(r>100); end This function? x=linspace(0,600,1000); y=Iapp(x); plot(x,y) function ...
  • 正如@ Spo1ler评论的那样,传递一个Action而不是Action : void f(Action a) { a(); } ... f(() => _delegate("string")); As @Spo1ler commented, pass an Action instead of Action: void f(Action a) { a(); } ... f(() => _delegate("string"));
  • 如果要调用函数值,则需要使用call 。 引用文档 (参见函数): 因此,在Go表示法中,“call .XY 1 2”是dot.XY(1,2),其中Y是函数值字段,映射条目等。 在这个例子中, X看起来像这样: type X struct { Y func(a int, b int) int } You need to use call if you want to call a function value. To quote the docs (See under Functions): Th ...
  • 您可以使用StackTrace和StackFrame来获取当前方法的名称 StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(1); string method = sf.GetMethod().ToString(); 对于属性,返回的方法名称将包含magic get_或set_前缀。 但是,我不认为您可以将其重构为内联宏或函数,就像在C ++中一样。 但是如果你重构一个实用程序方法来干掉它,你可能只需要向StackTrace返回一 ...
  • 如果您要使用与默认MM / DD / YYYY不同的日期格式,则需要在选项中指定。 更新小提琴: http : //jsfiddle.net/cuxm50k2/2/ 更新的选项: $('#rental-range').daterangepicker({ autoApply: true, startDate: start, endDate: end, locale: { format: 'YYYY/MM/DD' } }, cb); If you're going to use a ...
  • 将“state”存储在文件,共享prefs或sqlite数据库中。 然后你只需要在应用程序唤醒时进行一系列工作,然后你可以选择一个警报和广播接收器。 我在这里有一个简单的SharedPreferences示例: Android共享偏好设置 Store "state" in a file, in shared prefs or in a sqlite database. Then you just need to do a bundle of work when your app wakes up and y ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)