【问题标题】:Remove Lotus Notes design element inheritance programmatically以编程方式删除 Lotus Notes 设计元素继承
【发布时间】:2009-08-10 15:25:33
【问题描述】:

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

  • DXL 导出 (ForceNoteFormat=true) + XSLT。 由于导入器中的字段验证问题(!)而失败。
  • DXL 导出 (ForceNoteFormat=false) + XSLT。 似乎可行,但我宁愿不要将 DXL 解决方案用于这种通用的解决方案。

我想探索的领域:

  • 遍历所有(设计)注释,删除 $Class 项。

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

【问题讨论】:

  • 讽刺的是,我想“以编程方式禁用”Lotus Notes!
  • @Mitch: 我知道如何处理 DXL... :-)
  • 像这样的问题和this other one,让我想完全抛弃Notes,专门使用Ruby(及其宝石),这是一个更理智、设计更好的代码共享系统。 Notes 共享代码的系统是复制和粘贴。太糟糕了:Notes有很多闪光的光辉,但最终还是被一万张纸剪掉了。

标签: lotus-notes lotus-domino


【解决方案1】:

以下 sub 似乎有效,它从 7.0.3 客户端可以生成的任何设计元素中删除标志。我从同一主题的Ian's blog 条目中获得了关于NotesNoteCollection 的线索:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多