以编程方式删除Lotus Notes设计元素继承 [英] Remove Lotus Notes design element inheritance programmatically
本文介绍了以编程方式删除Lotus Notes设计元素继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
作为创建基本修订控制系统的一部分,我想以编程方式禁用Lotus Notes模板上的设计元素级别继承.到目前为止,我已经尝试了以下方法:
As part of an effort to create a rudimentary revision control system, I would like to programmatically disable design element level inheritance on a Lotus Notes template. I have so far tried the following:
- DXL导出(ForceNoteFormat = true)+ XSLT.失败,导入器中的字段(!)上存在验证问题.
- DXL导出(ForceNoteFormat = false)+ XSLT.似乎可以工作,但我宁愿不使用DXL解决方案来处理这种常规问题.
- DXL export (ForceNoteFormat=true) + XSLT. This failed with a validation problem in the importer, on fields(!).
- DXL export (ForceNoteFormat=false) + XSLT. Seems to work, but I'd rather not use a DXL solution for something this general.
我想探索的区域:
- 遍历所有(设计)注释,删除
$Class
项目.
有人对如何做到这一点有建议吗,或者有其他方法可以消除继承吗?
Does anybody have a suggestion on how to do this, or another approach that will remove inheritance?
推荐答案
以下子代码似乎有效,它从7.0.3客户端可以生成的任何设计元素中删除了该标志.我从Ian的博客了解了有关NotesNoteCollection
的线索相同主题的条目:
The following sub seems to work, it removes the flag from any design element a 7.0.3 client can produce. I got the clues about NotesNoteCollection
from Ian's blog entry on the same subject:
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
这篇关于以编程方式删除Lotus Notes设计元素继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文