简体   繁体   English

C#将导出的DXL打开为NotesDocument

[英]c# open exported DXL as NotesDocument

Does any1 know, if it is possible to open a DXL (Domino XML) as a NotesDocument object? 是否可以打开DXL(Domino XML)作为NotesDocument对象?

When a Notes client is installed you can add a reference to "Interop.Domino" and use the Domino objects with C#. 安装Notes客户端后,可以添加对“ Interop.Domino”的引用,并将Domino对象与C#一起使用。 Infact I have tried some DXLImporter stuff, but with no luck ... It seems, that the DXLImporter only can import into NotesDatabases. 实际上,我已经尝试了一些DXLImporter的东西,但是没有运气……看来,DXLImporter只能导入到NotesDatabases中。

Is there a way to open up a DXL exported file (NotesStream) as a NotesDocument to access the content as Notes objects? 有没有一种方法可以将DXL导出文件(NotesStream)作为NotesDocument打开,以作为Notes对象访问内容? (esp. Richtext) (尤其是Richtext)

Any idea? 任何想法? Big thanks. 太谢谢了。

// SiL // SiL

A NotesDocument- Object can never stand alone. NotesDocumentObject对象永远不能独立存在。 It always needs a parent database. 它总是需要一个父数据库。 This is true no matter how you get the NotesDocument object. 无论如何获取NotesDocument对象,这都是事实。 In your special case you need a "dumb" container nsf that you use to import the XML to. 在特殊情况下,您需要一个“哑”容器nsf,用于将XML导入到该容器。 After importing you can access the NotesDocument. 导入后,您可以访问NotesDocument。

You need to find the document using its universalid. 您需要使用其通用ID查找文档。 This universalid can be found in the XML as "unid"- Property of the nodeinfo- node: 可以在XML中以“ unid”找到此通用标识-nodeinfo-节点的属性:

<document xmlns='http://www.lotus.com/dxl' version='9.0' maintenanceversion='1.4' 
  replicaid='C1257C270049C111' form='Offer'>
  <noteinfo noteid='188a6' unid='FE4CB54C2D7C9ABCC1257E620027FCE4' sequence='3'>

As stated by Stan in the comments this might or might not work. 正如Stan在评论中所指出的那样,这可能行不通。 An imported document can get a different Universalid if a document with that UNID already exists and/or import- options are set accordingly. 如果已经存在具有该UNID的文档和/或已相应设置import-option,则导入的文档可以使用不同的Universalid。 Better user NotesDXLExporter.GetFirstImportedNoteID to get the document. 更好的用户NotesDXLExporter.GetFirstImportedNoteID来获取文档。

You could even import the whole database from an xml- struct, but that might be to much overhead for such a simple task, but of course it depends on your needs. 您甚至可以从xml结构导入整个数据库,但这对于这样一个简单的任务可能会增加很多开销,但是当然这取决于您的需求。

as a "hack" or "workaround" you could import this document to a database, that is always there on any Lotus Notes Client, eg the bookmark.nsf or the names.nsf, but I would not recommend to do so. 作为“黑客”或“解决方法”,您可以将此文档导入数据库,该数据库始终在任何Lotus Notes客户端上存在,例如,bookmark.nsf或names.nsf,但我不建议这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM