以编程方式删除Lotus Notes设计元素继承

问题描述 投票:2回答:1

作为创建基本修订控制系统的一部分,我想以编程方式禁用Lotus Notes模板上的设计元素级别继承。到目前为止,我已经尝试了以下方法:

  • DXL导出(ForceNoteFormat = true)+ XSLT。失败,因为导入器中的字段(!)上存在验证问题。
  • DXL导出(ForceNoteFormat = false)+ XSLT。似乎可以正常工作,但我宁愿不使用DXL解决方案来处理这种常规问题。

我想探索的区域:

  • 在所有(设计)注解中,删除$Class项目。

有人对如何执行此操作有任何建议,或者是否有其他方法可以删除继承?

lotus-notes lotus-domino
1个回答
4
投票

以下子代码似乎起作用,它从7.0.3客户端可以产生的任何设计元素中删除该标志。我从同一主题的NotesNoteCollection条目中获得了有关Ian's blog的线索:

Private Sub clearDesignInheritance(db As notesdatabase)
    On Error Goto errorthrower

    Dim nc As NotesNoteCollection
    Set nc = db.CreateNoteCollection(True) ' Select all note types...
    nc.SelectDocuments=False ' ...except data documents.

    Call nc.BuildCollection

    Dim noteid As String
    noteid = nc.GetFirstNoteId

    Dim doc As notesdocument

    Do Until noteid=""
        Set doc = db.GetDocumentByID(noteid)
        If doc.HasItem("$Class") Then
            Call doc.RemoveItem("$Class")
            Call doc.save(False,False,False)
        End If
        noteid = nc.GetNextNoteId(noteid)
    Loop

    Exit Sub
ErrorThrower:
    Error Err, Error & Chr(13) + "Module: " & Cstr( Getthreadinfo(1) ) & ", Line: " & Cstr( Erl )
End Sub
© www.soinside.com 2019 - 2024. All rights reserved.