2009-08-10 33 views
2

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

  • DXL导出(ForceNoteFormat = true)+ XSLT。由于导入程序中的验证问题(字段(!))失败。
  • DXL导出(ForceNoteFormat = false)+ XSLT。似乎可行,但我宁愿不使用DXL解决方案来处理这个问题。

的区域,我想探索:

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

有没有人有建议如何做到这一点,或另一种方法,将删除继承?

+1

讽刺意味的是,我想“编程禁用” Lotus Notes的! – 2009-08-10 15:36:08

+0

@Mitch:我知道如何处理DXL ... :-) – 2009-08-10 16:19:20

+0

这是这样的问题,[这另一个](http://stackoverflow.com/q/2248663/241142),这让我想要抛弃Notes完全和专门使用Ruby(和它的宝石),一个更加明智和更好的共享代码的系统。 Notes的共享代码系统是复制和粘贴。这太糟糕了:票据有许多辉煌的闪光,但最终还是有一万人死于纸上剪纸。 – iconoclast 2013-04-12 14:07:13

回答

4

下面的子代似乎起作用,它从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