如何使用LotusScript获取表单的基础视图 [英] How to get the underlying view of a form using lotusscript

查看:134
本文介绍了如何使用LotusScript获取表单的基础视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 lotusscript 的新手.我们有一个传统的莲花音符/多米诺骨牌系统.我们需要将数据从Lotus Notes迁移到oracle. Lotus Domino的数据模型与oracle的数据模型完全不同.因此,我们将根据莲花笔记表格创建一个关系表.我可以使用Lotusscript以编程方式访问视图.但是我无法使用Lotusscript获得与 Notes表单相关联的视图.谁能提供一个代码段或解释from和view之间的关系?我需要迁移与单个表单相关联的数据,即使该数据与多个 notes视图相关联.

下面的代码段会起作用吗?

Dim session As New NotesSession
Dim db As NotesDatabase
Dim notesDocumentCollection As NotesDocumentCollection

Set db = session.CurrentDatabase
Set notesDocumentCollection = db.FTSearch( """Form=Help Ticket""", 0)

For i = 1 To notesDocumentCollection.Count    
  Set doc = notesDocumentCollection.GetNthDocument( i )  
  ' process each document 

End Forall

解决方案

在Lotus Notes中,视图使用选择条件进行操作.这些条件可以引用表格(但不是必须).例如,假设您创建一个名为"HelpTicket"的表单.然后可以使用视图选择公式"选择使用此表单创建的任何文档,以在视图中显示,如下所示:

SELECT Form="HelpTicket"

…,然后可以添加视图中的列,以通过引用HelpTicket表单上布置的字段从选定的文档中提取数据.

我怀疑您对表单/视图关系感到困惑的是围绕迁移数据的想法:表单既是其关联数据的架构定义,又是一种在文档上呈现该数据的方式,基于文档.从理论上讲,数据可以通过Notes中任意多种形式的定义"来表示,即数据和表示形式是完全分开的,但是实际上,在表格和引用该表​​格的文档之间存在着一种联系.

顺便说一句,值得一提的是Lotus Notes不是关系数据库系统,它可以更容易地描述为基于文档的数据库或"NoSQL"的形式. /p>

现在,返回视图:然后这些视图通过列,类别和基于基础数据的简单计算来显示数据(视图列可以简单地引用字段值,也可以通过专有Lotus对该值执行基本操作注释公式语言).

因此,简而言之,您需要迁移的数据是Lotus Notes文档.这些视图无关紧要,尽管您可能希望在报告/可视化所述数据方面复制它们提供的内容.

I am a newbie in lotusscript. We have a legacy lotus notes/domino system. We need to migrate the data from lotus notes to oracle. Lotus domino's data model is entirely different than that of oracle's data model. So, we are creating a relational table per Lotus notes form. I can access the views programmaticaly using lotusscript. But I couldn't get the views associated with a Notes form using lotusscript. Could anyone please give a code snippet or explain the relation between from and view? I need to migrate the data associated with a single form even if it is connected with multiple notes views.

Will the following code snippet work?

Dim session As New NotesSession
Dim db As NotesDatabase
Dim notesDocumentCollection As NotesDocumentCollection

Set db = session.CurrentDatabase
Set notesDocumentCollection = db.FTSearch( """Form=Help Ticket""", 0)

For i = 1 To notesDocumentCollection.Count    
  Set doc = notesDocumentCollection.GetNthDocument( i )  
  ' process each document 

End Forall

解决方案

In Lotus Notes, views operate using selection criteria. These criteria can reference forms (but don't have to). For example, say you create a form called "HelpTicket". Any documents created using this form can then be selected for display in a view using a "view selection formula" like so:

SELECT Form="HelpTicket"

… and columns in the view can then be added to pull out data from the selected documents, by referencing the fields laid-out on the HelpTicket form.

Where I suspect you're getting confused with regards the form / view relationship is around this idea of migrating the data: forms are both a schema definition for their associated data, and a way of presenting that data, on a document-by-document basis. Theoretically, data can be presented via any number of form "definitions" in Notes, i.e. data and presentation are quite separate, but in practical terms there is a relationship between a form and the documents that reference it.

As an aside, it's probably worth mentioning that Lotus Notes is not a relational database system, it can be more readily described as a document-based database, or a form of "NoSQL".

Now, back to views: these then present data via columns, categories, and simple calculations based on the underlying data (a view column may either simply reference a field value, or can perform basic operations on that value via the proprietary Lotus Notes formula language).

So, in short, the data you need to migrate are your Lotus Notes documents. The views are kind of irrelevant, although you may wish to replicate what they offer in terms of reporting / visualising said data.

这篇关于如何使用LotusScript获取表单的基础视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆