PDA

View Full Version : 关于简要表的帮助


imzh
14-09-06, 05:30 PM
这些是从帮助中提取的一些内容,偶这两天要研究试验一把,呵呵

关于简要表
----------------

简要表表单

简要表表单对于收集特定用户或特定数据库的值很有用。这些值存储在“简要表”文档中。将这些文档分离为简要表文档的是这些文档的显示方式和返回的域值。 对于数据库的每个用户,每个表单只能有一个简要表文档;或者说如果表单对所有的用户可用,那么一个数据库只能有一个简要表文档。
简要表文档允许快速提取数据,因为当存储简要表的数据库打开时它们已经进入缓存。简要表文档除了一定程度上不可见(不在视图中显示也不包括在数据库的文档计数中)外,它和其它数据库文档一样。用户通过设计出的操作按钮或代理创建简要表文档,操作按钮和代理可以用 LotusScript 或公式语言进行设计。
数据库可以有匹配您指定密钥的单个或多个简要表文档,例如:为数据库的每个用户创建一个简要表文档的 @username 密钥,或是为一周中每一天指定一个不同简要表文档的密钥。使用单一简要表文档还是使用多个简要表文档取决于设计需要。使用单一简要表文档来包含数据库中所有文档都需要的设置(例如:环境变量)。对需要进一步定制的设置(例如:用户惯用选项)使用多个简要表文档。如果要创建一个对所有用户可用的简要表文档,那么在数据库的存取控制列表 (ACL) 中至少要有“作者”存取级别。
可以使用任意表单来创建简要表文档。创建表单后,可以使用公式中的 @CommandEditProfile,或使用 LotusScript 程序中的 UIWorkspace.EditProfile 或 NotesDatabase GetProfileDocument 为应用程序创建按钮、操作或代理来创建或提取简要表。在每种情况下,Notes 查找使用指定的表单名称创建的简要表文档;如果不存在,则创建一个简要表文档。关于简要表文档的样例,请参阅“讨论 - Notes & Web (R5.0)”模板中的 Interest Profile 表单。

创建简要表表单

1. 创建一个表单,该表单中的域将保存要存储在简要表文档中的值。
2. 选择“设计”“表单属性”,取消选择“包含在菜单中”。
3. 保存表单。
4. 不要将表单包含在任何视图中。详细信息,请参阅设计视图。
5. 创建按钮、操作或代理来创建或存取简要表文档,这些按钮、操作或代理是使用 LotusScript NotesDatabase GetProfileDocument 成员函数、UIWorkspace.EditProfile 或者公式语言 @Command EditProfile 设计的。
可以使用 @Command([EditProfile]) 或 @SetProfileField 来创建或编辑简要表文档。可以使用 @GetProfileField 从现有简要表文档中提取域值。关于完整语法的描述,请参阅“帮助”中与这些命令有关的主题。
使用 SetProfileField 和 GetProfileField 命令设置和提取简要表文档的域值。如果不存在简要表文档,SetProfileField 命令也可以创建简要表文档。
不能使用 @command 或 @function 删除简要表文档。如果必须删除,请使用 LotusScript。
如果您更喜欢 Script 而不是公式,请使用 LotusScript 例程创建和编辑简要表文档。NotesUIWorkspace 类的 EditProfile 成员函数与在公式中使用 @Command([EditProfile]) 命令产生的效果相同。
要用 Script 来设置和提取简要表文档的域值,请使用 GetProfileDocument 成员函数取得文档的句柄。随后就可以从文档中提取值或设置新值,如同在其它文档中一样。
使用 NotesDocument 类的 IsProfile 属性来判定一个 NotesDocument 对象是否是简要表文档。使用 NameOfProfile 属性提取简要表文档的名称。



EditProfile

样例
在“编辑”模式下打开新的或现有的简要表文档。
语法
@Command( [EditProfile] ; formname; username )
参数
formname
文本。简要表的基础表单。必须存在于数据库中。
username
文本。可选。与简要表相关的用户名。
用法
可以快速访问简要表文档,使用它们保存不希望出现在用户文档中的信息,并且在数据库中通过 Script 共享信息。
每人在每个数据库仅仅有给定的表单的一个简要表能够存在。如果没有给出用户名称创建一个简要表,Notes 假定它是数据库中该表单仅有的一个简要表。创建应用于整个数据库的简要表至少要有“作者”存取级别。
使用 EditProfile 保存的文档是隐藏的。

样例: EditProfile
1. 这个公式打开了讨论数据库中的 Mary Tsen 的 Interest Profile。
@Command([EditProfile];"Interest Profile";"Mary Tsen/Worksavers/US")
2. 这个公式为当前用户创建一个 "Calendar Profile" 文档或打开该用户现有的 "Calendar Profile"。
@Command([EditProfile];"CalendarProfile";@UserName)
3. 这个公式为当前数据库创建新的 Archive Profile 文档或在“编辑”模式下打开该用户现有的 Archive Profile。
@Command([EditProfile];"Archive Profile")
4. 在 Domino 目录中使用此公式将打开 Server\Setup Profile 文档。
@Command([EditProfile];"Profile")



@GetProfileField
从简要表文档中提取域,并高速缓存这个域的值,以备会话的其它部分使用。

语法
@GetProfileField(profilename ; fieldname [ ; username] )
参数
profilename
文本。简要表文档的名称,该文档中包含有所要访问的域。
fieldname
文本。所要访问的域的名称。
username
文本。与此简要表文档相关联的用户名。
返回值
fieldvalue
域值。

样例:@GetProfileField
1. 以下样例取得“Interest Profile”文档中的“Profile Categories”域的内容。
@GetProfileField("Interest Profile"; "Profile Categories")

2. 以下样例为当前用户取得“Interest Profile”中的“Profile Categories”域的内容。
@GetProfileField("Interest Profile"; "Profile Categories"; @UserName)


@SetProfileField
在简要表文件中设置域值。

语法
@SetProfileField(profilename ; fieldname ; value [ ; username] )
参数
profilename
文本。要存取的域所在的简要表文档名称。
fieldname
文本。要存取的域的名称。
value
文本。要设置的域值。
username
文本。与简要表文档有关的用户名。
返回值
value
所设置的域值。


样例:@SetProfileField
1. 以下的样例将 Profile Categories 域的内容设置为当前的平台信息,这个域包含在 Interest Profile 文档中。
@SetProfileField("Interest Profile"; "Profile Categories", @Platform)
2. 以下的样例为当前用户将 Profile Categories 域的内容设置为当前的平台信息,这个域包含在 Interest Profile 文档中。
@SetProfileField("Interest Profile"; "Profile Categories", @Platform, @UserName)


GetProfileDocument method

Retrieves or creates a Profile document.

Defined in
NotesDatabase
Syntax
Set notesDocument = notesDatabase.GetProfileDocument( profilename$ [, uniqueKey$ ] )
Parameters
profilename$
String. The name or an alias of the Profile document.
uniqueKey$
String. Optional. The unique key associated with the Profile document.
Return value
notesDocument
NotesDocument. The Profile document that matches the given name.

Examples: GetProfileDocument method

This example gets the "Interest Profile" Profile document based on the current user and displays items from it.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim profileAuthors As NotesItem
Dim profileStrings As NotesItem
Dim stringAuthors As String
Dim stringStrings As String
Set db = session.CurrentDatabase
Set doc = db.GetProfileDocument("Interest Profile", _
session.UserName)
Set profileAuthors = doc.GetFirstItem("ProfileAuthors")
Set profileStrings = doc.GetFirstItem("ProfileStrings")
stringAuthors = ""
stringStrings = ""
Forall profileAuthor In profileAuthors.Values
stringAuthors = stringAuthors & Chr(10) &profileAuthor
End Forall
Forall profileString In profileStrings.Values
stringStrings = stringStrings & Chr(10) &profileString
End Forall
If stringAuthors = "" Then
stringAuthors = "None"
Else
stringAuthors = Right _
(stringAuthors, Len(stringAuthors) - 1)
End If
If stringStrings = "" Then
stringAuthors = "None"
Else
stringStrings = Right _
(stringStrings, Len(stringStrings) - 1)
End If
Messagebox stringAuthors,, "Profile authors"
Messagebox stringStrings,, "Profile strings"



NotesUIWorkspace EditProfile method

Opens a new or existing Profile document in Edit mode.

Defined in
NotesUIWorkspace
Syntax
Set notesUIDocument = notesUIWorkspace.EditProfile( profileName$ [, uniqueKey$] )
Parameters
profileName$
String. The name or an alias of the Profile document, or the form name to use to display the Profile document.
uniqueKey$
String. Optional. The key associated with the Profile document.
Usage
You can efficiently store information in Profile documents. You can access them quickly and use them in templates to store specific information, or to share variables across scripts within a database.
Only one profile of a given form or name can exist per database per key. If you create a profile without a key, Notes assumes it's the only Profile document of that type in the database. You need at least author access to create a profile that applies to an entire database.
Documents saved with EditProfile are hidden.

EditProfile method example:

This example opens an "Interest Profile" profile document for the current user. If none exists, it creates a profile document.
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Call workspace.EditProfile _
("Interest Profile", session.UserName)


EditProfileDocument @Command

Creates a new or opens an existing profile document in Edit mode.
Note This @command is new with Release 6.
Syntax
@Command( [EditProfileDocument] ; formname; uniqueKey )
Parameters
formname
Text. The form upon which the profile is based. Must exist in the database.
uniqueKey
Text. Optional. The unique key that identifies the profile.
Usage
This command executes immediately. Use the EditProfile @command to execute after all @functions. See the Order of evaluation for formula statements topic for more details.
You can access profile documents quickly and use them to store information that you don't want in user documents and to share information across scripts within a database.
Only one profile of a given form can exist per database per key. If you create a profile without a key, Notes assumes it's the only profile document of that form in the database. You need at least author access to create a profile that applies to an entire database.
Documents saved with EditProfileDocument are hidden.
This function does not work in Web applications. Use @SetProfileField to create a profile document in a Web application.

恋猪明
14-09-06, 10:33 PM
非常好。各位要向楼主学习哦。。。+精华

ppxiaofei
15-11-06, 10:25 AM
我现在接收一个notes系统,发现有些域值是从简要表中取得的,
可是我看了两天也不知道简要表信息是什么时候被创建的,而且在试图中不能看到简要表,该怎么做?

空空空
15-11-06, 01:00 PM
用表单就可以打开简要表啊,你可以查看一下哪张表单,然后直接打开就可以了啊

wlmars150
01-12-06, 11:37 PM
楼主,我曾经用过简要表,发现一个问题。在这里提出来,望大家指教。
在简要表文档里面可以添加附件,但是附件只能添加一个,如果是多个的话,会有替换前一个附件。
不过这个问题我并不确定,因为我同事使用时曾经放入两个附件,这个问题我自己测试时就无法再次模拟出来了!

yy611612
30-03-08, 03:19 PM
不得不感谢楼主

tomzhao
08-01-09, 04:33 PM
一个简要表只能和一个表单关联吧,如果我有两个表单,在代理中用
db.GetProfileDocument("CounterProfile")生成一个简要表,这个简要表和谁关联呢,还有CounterProfile不是所要关联的表单名吧

空空空
08-01-09, 04:58 PM
CounterProfile 就是表单名